]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
let sofia recover work in some tcp situations
authorAnthony Minessale <anthm@freeswitch.org>
Tue, 23 Jul 2013 18:52:49 +0000 (13:52 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Tue, 23 Jul 2013 18:52:49 +0000 (13:52 -0500)
src/mod/endpoints/mod_sofia/sofia.c
src/mod/endpoints/mod_sofia/sofia_glue.c
src/switch_core_media.c

index 276c87a858e31a1bc344d288ac6df5e7a17fbd69..35c325fefa31cc8f260036d163000baa93bbf5b5 100644 (file)
@@ -253,7 +253,7 @@ static void extract_header_vars(sofia_profile_t *profile, sip_t const *sip,
                        
                        switch_channel_set_variable(channel, "sip_full_via", (char *)stream.data);
 
-                       if (switch_channel_direction(channel) == SWITCH_CALL_DIRECTION_OUTBOUND) {
+                       if (switch_channel_direction(channel) == SWITCH_CALL_DIRECTION_OUTBOUND || switch_stristr("TCP", (char *)stream.data)) {
                                switch_channel_set_variable(channel, "sip_recover_via", (char *)stream.data);
                        }
 
index fccc577fa835d617bd24c6ec96e9741d9bf6b3b5..ea403e7d3831095c041a76059102eb45b86030fb 100644 (file)
@@ -986,7 +986,6 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
                switch_channel_set_variable(channel, "sip_to_host", sofia_glue_get_host(to_str, switch_core_session_get_pool(session)));
                switch_channel_set_variable(channel, "sip_from_host", sofia_glue_get_host(from_str, switch_core_session_get_pool(session)));
 
-
                if (!(tech_pvt->nh = nua_handle(tech_pvt->profile->nua, NULL,
                                                                                NUTAG_URL(url_str),
                                                                                TAG_IF(call_id, SIPTAG_CALL_ID_STR(call_id)),
@@ -1221,6 +1220,7 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
                                                  "Local SDP:\n%s\n", tech_pvt->mparams.local_sdp_str);
        }
 
+
        if (sofia_use_soa(tech_pvt)) {
                nua_invite(tech_pvt->nh,
                                   NUTAG_AUTOANSWER(0),
@@ -1850,10 +1850,13 @@ int sofia_recover_callback(switch_core_session_t *session)
                tech_pvt->redirected = switch_core_session_sprintf(session, "sip:%s", switch_channel_get_variable(channel, "sip_contact_uri"));
 
                if (zstr(rr)) {
-                       switch_channel_set_variable_printf(channel, "sip_invite_route_uri", "<sip:%s@%s:%s;lr>",
+                       switch_channel_set_variable_printf(channel, "sip_invite_route_uri", "<sip:%s@%s:%s;transport=%s>",
                                                                                           switch_channel_get_variable(channel, "sip_from_user"),
-                                                                                          switch_channel_get_variable(channel, "sip_network_ip"), switch_channel_get_variable(channel, "sip_network_port")
+                                                                                          switch_channel_get_variable(channel, "sip_network_ip"), 
+                                                                                          switch_channel_get_variable(channel, "sip_network_port"),
+                                                                                          switch_channel_get_variable(channel,"sip_via_protocol")
                                                                                           );
+
                }
 
                tech_pvt->dest = switch_core_session_sprintf(session, "sip:%s", switch_channel_get_variable(channel, "sip_from_uri"));
@@ -1889,8 +1892,6 @@ int sofia_recover_callback(switch_core_session_t *session)
        if (session) {
                const char *use_uuid;
 
-               switch_channel_set_flag(channel, CF_RECOVERING);
-
                if ((use_uuid = switch_channel_get_variable(channel, "origination_uuid"))) {
                        if (switch_core_session_set_uuid(session, use_uuid) == SWITCH_STATUS_SUCCESS) {
                                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "%s set UUID=%s\n", switch_channel_get_name(channel),
index 989aacb361af4f02346f323dffc5e161a926c6be..22e082d90da5ad3a8781f0a9883c3e98e29543e1 100644 (file)
@@ -7478,7 +7478,7 @@ SWITCH_DECLARE (void) switch_core_media_recover_session(switch_core_session_t *s
        ip = switch_channel_get_variable(session->channel, SWITCH_LOCAL_MEDIA_IP_VARIABLE);
        port = switch_channel_get_variable(session->channel, SWITCH_LOCAL_MEDIA_PORT_VARIABLE);
 
-
+       switch_channel_set_flag(session->channel, CF_RECOVERING);
 
        if (switch_channel_test_flag(session->channel, CF_PROXY_MODE)  || !(ip && port)) {
                return;