]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-3688 try this also with sofia loglevel all 9
authorAnthony Minessale <anthm@freeswitch.org>
Sun, 20 Nov 2011 01:12:08 +0000 (19:12 -0600)
committerAnthony Minessale <anthm@freeswitch.org>
Sun, 20 Nov 2011 01:12:08 +0000 (19:12 -0600)
src/mod/endpoints/mod_sofia/mod_sofia.c
src/mod/endpoints/mod_sofia/mod_sofia.h
src/mod/endpoints/mod_sofia/sofia.c
src/mod/endpoints/mod_sofia/sofia_glue.c

index 1e1f3dacbf387a169d28d14c215982c879ae275e..8389a495c3e425a6ab29d22eaf1384e91fbbdbfe 100644 (file)
@@ -2319,7 +2319,7 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
 
                                                if (switch_channel_test_flag(channel, CF_PROXY_MEDIA)) {
                                                        sofia_glue_tech_patch_sdp(tech_pvt);
-                                                       sofia_glue_tech_proxy_remote_addr(tech_pvt);
+                                                       sofia_glue_tech_proxy_remote_addr(tech_pvt, NULL);
                                                }
                                                if (sofia_use_soa(tech_pvt)) {
                                                        nua_respond(tech_pvt->nh, code, su_strdup(nua_handle_home(tech_pvt->nh), reason), SIPTAG_CONTACT_STR(tech_pvt->reply_contact),
index edd58babf149ab7c08468bed6309c30b192602ee..b13d9ffd3553fb8a0b670d842a4f398379c0b5f7 100644 (file)
@@ -1037,7 +1037,7 @@ int sofia_glue_transport_has_tls(const sofia_transport_t tp);
 const char *sofia_glue_get_unknown_header(sip_t const *sip, const char *name);
 switch_status_t sofia_glue_build_crypto(private_object_t *tech_pvt, int index, switch_rtp_crypto_key_type_t type, switch_rtp_crypto_direction_t direction);
 void sofia_glue_tech_patch_sdp(private_object_t *tech_pvt);
-switch_status_t sofia_glue_tech_proxy_remote_addr(private_object_t *tech_pvt);
+switch_status_t sofia_glue_tech_proxy_remote_addr(private_object_t *tech_pvt, const char *sdp_str);
 void sofia_presence_event_thread_start(void);
 void sofia_reg_expire_call_id(sofia_profile_t *profile, const char *call_id, int reboot);
 void sofia_reg_check_call_id(sofia_profile_t *profile, const char *call_id);
index 752754ccc3df7f41b267a262a954233311df5c38..a1325394080f01a1e684871b2fcf5c15cf416a7e 100644 (file)
@@ -4935,7 +4935,7 @@ static void sofia_handle_sip_r_invite(switch_core_session_t *session, int status
                                                sip->sip_content_type && sip->sip_content_type->c_subtype && switch_stristr("sdp", sip->sip_content_type->c_subtype)) {
                                                tech_pvt->remote_sdp_str = switch_core_session_strdup(tech_pvt->session, sip->sip_payload->pl_data);
                                                r_sdp = tech_pvt->remote_sdp_str;
-                                               sofia_glue_tech_proxy_remote_addr(tech_pvt);
+                                               sofia_glue_tech_proxy_remote_addr(tech_pvt, NULL);
                                        }
 
                                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Passing %d %s to other leg\n", status, phrase);
@@ -5780,6 +5780,10 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
                                                        goto done;
                                                }
 
+                                               if (switch_channel_test_flag(channel, CF_PROXY_MODE)) {
+                                                       sofia_glue_tech_proxy_remote_addr(tech_pvt, r_sdp);
+                                               }
+
                                                msg = switch_core_session_alloc(other_session, sizeof(*msg));
                                                msg->message_id = SWITCH_MESSAGE_INDICATE_MEDIA_REDIRECT;
                                                msg->from = __FILE__;
index aa6fdded3fa529b2e790949cf78545ac902cd30c..52096dd02bed7cca64fd068f0552e210a0f9d821 100644 (file)
@@ -1374,7 +1374,7 @@ char *sofia_overcome_sip_uri_weakness(switch_core_session_t *session, const char
 }
 
 #define RA_PTR_LEN 512
-switch_status_t sofia_glue_tech_proxy_remote_addr(private_object_t *tech_pvt)
+switch_status_t sofia_glue_tech_proxy_remote_addr(private_object_t *tech_pvt, const char *sdp_str)
 {
        const char *err;
        char rip[RA_PTR_LEN] = "";
@@ -1384,23 +1384,27 @@ switch_status_t sofia_glue_tech_proxy_remote_addr(private_object_t *tech_pvt)
        int x;
        const char *val;
 
-       if (zstr(tech_pvt->remote_sdp_str)) {
+       if (zstr(sdp_str)) {
+               sdp_str = tech_pvt->remote_sdp_str;
+       }
+
+       if (zstr(sdp_str)) {
                return SWITCH_STATUS_FALSE;
        }
 
-       if ((p = (char *) switch_stristr("c=IN IP4 ", tech_pvt->remote_sdp_str)) || (p = (char *) switch_stristr("c=IN IP6 ", tech_pvt->remote_sdp_str))) {
+       if ((p = (char *) switch_stristr("c=IN IP4 ", sdp_str)) || (p = (char *) switch_stristr("c=IN IP6 ", sdp_str))) {
                ip_ptr = p + 9;
        }
 
-       if ((p = (char *) switch_stristr("m=audio ", tech_pvt->remote_sdp_str))) {
+       if ((p = (char *) switch_stristr("m=audio ", sdp_str))) {
                port_ptr = p + 8;
        }
 
-       if ((p = (char *) switch_stristr("m=image ", tech_pvt->remote_sdp_str))) {
+       if ((p = (char *) switch_stristr("m=image ", sdp_str))) {
                port_ptr = p + 8;
        }
 
-       if ((p = (char *) switch_stristr("m=video ", tech_pvt->remote_sdp_str))) {
+       if ((p = (char *) switch_stristr("m=video ", sdp_str))) {
                vid_port_ptr = p + 8;
        }
 
@@ -2399,7 +2403,7 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
 
        if (switch_channel_test_flag(channel, CF_PROXY_MEDIA)) {
                if (switch_rtp_ready(tech_pvt->rtp_session)) {
-                       sofia_glue_tech_proxy_remote_addr(tech_pvt);
+                       sofia_glue_tech_proxy_remote_addr(tech_pvt, NULL);
                }
                sofia_glue_tech_patch_sdp(tech_pvt);
        }
@@ -3167,7 +3171,7 @@ switch_status_t sofia_glue_activate_rtp(private_object_t *tech_pvt, switch_rtp_f
        }
 
        if (switch_channel_test_flag(tech_pvt->channel, CF_PROXY_MEDIA)) {
-               if ((status = sofia_glue_tech_proxy_remote_addr(tech_pvt)) != SWITCH_STATUS_SUCCESS) {
+               if ((status = sofia_glue_tech_proxy_remote_addr(tech_pvt, NULL)) != SWITCH_STATUS_SUCCESS) {
                        goto end;
                }
 
@@ -3490,7 +3494,7 @@ switch_status_t sofia_glue_activate_rtp(private_object_t *tech_pvt, switch_rtp_f
                        }
 
                        if (switch_channel_test_flag(tech_pvt->channel, CF_PROXY_MEDIA)) {
-                               if ((status = sofia_glue_tech_proxy_remote_addr(tech_pvt)) != SWITCH_STATUS_SUCCESS) {
+                               if ((status = sofia_glue_tech_proxy_remote_addr(tech_pvt, NULL)) != SWITCH_STATUS_SUCCESS) {
                                        goto end;
                                }