[Freeswitch-trunk] [commit] r3558 - in freeswitch/trunk/src: . mod/endpoints/mod_sofia
Freeswitch SVN
anthm at freeswitch.org
Wed Dec 6 12:19:08 EST 2006
Author: anthm
Date: Wed Dec 6 12:19:07 2006
New Revision: 3558
Modified:
freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
freeswitch/trunk/src/switch_channel.c
freeswitch/trunk/src/switch_core.c
Log:
tweak
Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c Wed Dec 6 12:19:07 2006
@@ -1214,7 +1214,7 @@
case SWITCH_CAUSE_ORIGINATOR_CANCEL:
return 487;
default:
- return 500;
+ return 480;
}
}
@@ -3938,6 +3938,7 @@
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 @@
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";
+ }
- 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);
+ 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, from_port);
switch_channel_set_variable(channel, "sip_from_uri", uri);
Modified: freeswitch/trunk/src/switch_channel.c
==============================================================================
--- freeswitch/trunk/src/switch_channel.c (original)
+++ freeswitch/trunk/src/switch_channel.c Wed Dec 6 12:19:07 2006
@@ -1114,7 +1114,7 @@
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 @@
if (*p == '$') {
vtype = 1;
}
- if (*p == '^') {
+ if (*(p+1) != '{') {
vtype = 2;
}
@@ -1219,7 +1219,7 @@
len++;
}
- if (*p == '$' || *p == '^') {
+ if (*p == '$') {
p--;
} else {
*c++ = *p;
Modified: freeswitch/trunk/src/switch_core.c
==============================================================================
--- freeswitch/trunk/src/switch_core.c (original)
+++ freeswitch/trunk/src/switch_core.c Wed Dec 6 12:19:07 2006
@@ -2651,7 +2651,7 @@
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);
}
}
}
More information about the Freeswitch-trunk
mailing list