]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
update
authorAnthony Minessale <anthony.minessale@gmail.com>
Sat, 8 Mar 2008 21:37:17 +0000 (21:37 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Sat, 8 Mar 2008 21:37:17 +0000 (21:37 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7848 d0543943-73ff-0310-b7d9-9358b9ac24b2

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

index 3efb6a16513594713180f9639b24ad991b0da1fb..248878c1c1ebe76df850ff013cf7e3681b0f4849 100644 (file)
@@ -223,8 +223,12 @@ switch_status_t sofia_on_hangup(switch_core_session_t *session)
        switch_call_cause_t cause = switch_channel_get_cause(channel);
        int sip_cause = hangup_cause_to_sip(cause);
 
-       if (tech_pvt->profile->rtpip && tech_pvt->local_sdp_audio_port) {
-               switch_rtp_release_port(tech_pvt->profile->rtpip, tech_pvt->local_sdp_audio_port);
+       if (tech_pvt->profile->rtpip) {
+               if (tech_pvt->local_sdp_audio_port) {
+                       switch_rtp_release_port(tech_pvt->profile->rtpip, tech_pvt->local_sdp_audio_port);
+               } else if (tech_pvt->local_sdp_video_port) {
+                       switch_rtp_release_port(tech_pvt->profile->rtpip, tech_pvt->local_sdp_video_port);
+               }
        }
 
        if (switch_test_flag(tech_pvt, TFLAG_SIP_HOLD) && cause != SWITCH_CAUSE_ATTENDED_TRANSFER) {
index 586a37b5567e7bb1328b8c44c78d524da9a69137..cda7b7c2e0c010d4cc671e8aa20ee26ab05a7797 100644 (file)
@@ -488,8 +488,9 @@ switch_status_t sofia_glue_tech_choose_port(private_object_t *tech_pvt, int forc
                        return SWITCH_STATUS_SUCCESS;
                }
        }
-       if (tech_pvt->adv_sdp_audio_port) {
-               switch_rtp_release_port(tech_pvt->adv_sdp_audio_ip, tech_pvt->adv_sdp_audio_port);
+
+       if (tech_pvt->local_sdp_audio_port) {
+               switch_rtp_release_port(tech_pvt->profile->rtpip, tech_pvt->local_sdp_audio_port);
        }
 
 
@@ -527,6 +528,10 @@ switch_status_t sofia_glue_tech_choose_video_port(private_object_t *tech_pvt)
                return SWITCH_STATUS_SUCCESS;
        }
 
+       if (tech_pvt->local_sdp_video_port) {
+               switch_rtp_release_port(tech_pvt->profile->rtpip, tech_pvt->local_sdp_video_port);
+       }
+
        if (!(tech_pvt->local_sdp_video_port = switch_rtp_request_port(tech_pvt->profile->rtpip))) {
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "No RTP ports available!\n");
                return SWITCH_STATUS_FALSE;
@@ -1634,11 +1639,11 @@ switch_status_t sofia_glue_activate_rtp(private_object_t *tech_pvt, switch_rtp_f
 
                sofia_glue_check_video_codecs(tech_pvt);
 
-               if (!tech_pvt->local_sdp_video_port) {
-                       sofia_glue_tech_choose_video_port(tech_pvt);
-               }
-               
                if (switch_test_flag(tech_pvt, TFLAG_VIDEO) && tech_pvt->video_rm_encoding) {
+                       if (!tech_pvt->local_sdp_video_port) {
+                               sofia_glue_tech_choose_video_port(tech_pvt);
+                       }
+
                        flags = (switch_rtp_flag_t) (SWITCH_RTP_FLAG_USE_TIMER | SWITCH_RTP_FLAG_AUTOADJ | 
                                                                                 SWITCH_RTP_FLAG_DATAWAIT | SWITCH_RTP_FLAG_NOBLOCK | SWITCH_RTP_FLAG_RAW_WRITE);
                        sofia_glue_tech_set_video_codec(tech_pvt, 0);