git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3558 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2006-12-06 17:19:07 +00:00
parent f7bcbb7216
commit 9914dd71f5
3 changed files with 14 additions and 7 deletions

View File

@ -1214,7 +1214,7 @@ static int hangup_cause_to_sip(switch_call_cause_t cause) {
case SWITCH_CAUSE_ORIGINATOR_CANCEL:
return 487;
default:
return 500;
return 480;
}
}
@ -3938,6 +3938,7 @@ static void sip_i_invite(nua_t *nua,
char *req_user, *req_host, *req_port;
char *contact_user, *contact_host, *contact_port;
char *via_rport, *via_host, *via_port;
char *from_port;
char uri[1024];
if (!(tech_pvt = (private_object_t *) switch_core_session_alloc(session, sizeof(private_object_t)))) {
@ -4017,10 +4018,16 @@ static void sip_i_invite(nua_t *nua,
switch_channel_set_variable(channel, "sip_from_user_stripped", (char *)from->a_url->url_user);
}
switch_channel_set_variable(channel, "sip_from_host", (char *) from->a_url->url_host);
switch_channel_set_variable(channel, "sip_from_port", (char *) from->a_url->url_port);
if (!(from_port = (char *) from->a_url->url_port)) {
from_port = "5060";
}
switch_channel_set_variable(channel, "sip_from_port", from_port);
snprintf(uri, sizeof(uri), "%s@%s:%s", (char *) from->a_url->url_user, (char *) from->a_url->url_host, (char *) from->a_url->url_port);
snprintf(uri, sizeof(uri), "%s@%s:%s", (char *) from->a_url->url_user, (char *) from->a_url->url_host, from_port);
switch_channel_set_variable(channel, "sip_from_uri", uri);

View File

@ -1114,7 +1114,7 @@ SWITCH_DECLARE(char *) switch_channel_expand_variables(switch_channel_t *channel
size_t sp = 0, len = 0, olen = 0, vtype = 0, br = 0, cpos, block = 128;
char *sub_val = NULL, *func_val = NULL;
if (!strchr(in, '$') && !strchr(in, '^')) {
if (!strchr(in, '$')) {
return in;
}
@ -1130,7 +1130,7 @@ SWITCH_DECLARE(char *) switch_channel_expand_variables(switch_channel_t *channel
if (*p == '$') {
vtype = 1;
}
if (*p == '^') {
if (*(p+1) != '{') {
vtype = 2;
}
@ -1219,7 +1219,7 @@ SWITCH_DECLARE(char *) switch_channel_expand_variables(switch_channel_t *channel
len++;
}
if (*p == '$' || *p == '^') {
if (*p == '$') {
p--;
} else {
*c++ = *p;

View File

@ -2651,7 +2651,7 @@ static void switch_core_standard_on_ring(switch_core_session_t *session)
return;
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "No Dialplan, Aborting\n");
switch_channel_hangup(session->channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
switch_channel_hangup(session->channel, SWITCH_CAUSE_NO_ROUTE_DESTINATION);
}
}
}