]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
tweak
authorAnthony Minessale <anthony.minessale@gmail.com>
Wed, 6 Dec 2006 17:19:07 +0000 (17:19 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Wed, 6 Dec 2006 17:19:07 +0000 (17:19 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3558 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/mod_sofia.c
src/switch_channel.c
src/switch_core.c

index ff16c8018d2f486ea9eeb90c627900088a392880..f3d4af40e9375c3c846f9fc12a97845afb4d1f41 100644 (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);
             
             
index 2a3fa1d0478ba8f34781681a8daa53a1b43b9ee4..b8b98d4e1f4d7ad77b97e5713ed0da5aa2fbcb8b 100644 (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;
index fb50166e6554e73c63f36c4dce8ed1af486d43e9..0f7f1a235767698a65801b1aa5b854729acacb45 100644 (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);
                        }
                }
        }