]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
update
authorAnthony Minessale <anthony.minessale@gmail.com>
Fri, 22 Feb 2008 14:06:13 +0000 (14:06 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Fri, 22 Feb 2008 14:06:13 +0000 (14:06 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7722 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/mod_sofia.c
src/mod/endpoints/mod_sofia/sofia_glue.c

index 7d6dc384a245ad684d5a43015fe325c106429afe..b0fb1d38b4fae6ed618a2f3498438a1bc3c06c5a 100644 (file)
@@ -960,10 +960,14 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
                                                        TAG_IF(!switch_strlen_zero(max_forwards), SIPTAG_MAX_FORWARDS_STR(max_forwards)), TAG_END());
                        } else {
                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Responding with %d %s\n", code, reason);
-
+                               
                                if (!switch_strlen_zero(((char *)msg->pointer_arg))) {
+                                       tech_pvt->local_sdp_str = switch_core_session_strdup(tech_pvt->session, (char *)msg->pointer_arg);
+                                       if (switch_channel_test_flag(channel, CF_PROXY_MEDIA)) {
+                                               sofia_glue_tech_patch_sdp(tech_pvt);
+                                       }
                                        nua_respond(tech_pvt->nh, code, reason, SIPTAG_CONTACT_STR(tech_pvt->reply_contact),
-                                                               SOATAG_USER_SDP_STR(msg->pointer_arg),
+                                                               SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str),
                                                                SOATAG_AUDIO_AUX("cn telephone-event"),
                                                                NUTAG_INCLUDE_EXTRA_SDP(1),
                                                                TAG_END());
index eb3c69d926386d80158408db4f81ae9eb57c302a..95348ef3e60d3100b23ad6260851287d6480b27f 100644 (file)
@@ -753,11 +753,18 @@ void sofia_glue_tech_patch_sdp(private_object_t *tech_pvt)
        }
        
        if (!(ip_ptr && port_ptr)) {
+               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "%s SDP Error! [%s]\n", switch_channel_get_name(tech_pvt->channel), tech_pvt->local_sdp_str);
                return;
        }
 
-       if (sofia_glue_tech_choose_port(tech_pvt, 1) != SWITCH_STATUS_SUCCESS) {
-               return;
+       if (switch_strlen_zero(tech_pvt->adv_sdp_audio_ip) || !tech_pvt->adv_sdp_audio_port) {
+               if (sofia_glue_tech_choose_port(tech_pvt, 1) != SWITCH_STATUS_SUCCESS) {
+                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "%s I/O Error\n", switch_channel_get_name(tech_pvt->channel));
+                       return;
+               }
+               tech_pvt->iananame = switch_core_session_strdup(tech_pvt->session, "NO-NAME");
+               tech_pvt->rm_rate = 8000;
+               tech_pvt->codec_ms = 20;
        }
 
        tech_pvt->orig_local_sdp_str = tech_pvt->local_sdp_str;
@@ -790,11 +797,8 @@ void sofia_glue_tech_patch_sdp(private_object_t *tech_pvt)
                *q++ = *p++;
        }
        
-       tech_pvt->iananame = switch_core_session_strdup(tech_pvt->session, "NO-NAME");
-
-       tech_pvt->rm_rate = 8000;
-       tech_pvt->codec_ms = 20;
-       
+       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s Patched SDP\n%s\n%s\n", 
+                                         switch_channel_get_name(tech_pvt->channel), tech_pvt->orig_local_sdp_str, tech_pvt->local_sdp_str);
 }