]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
update
authorAnthony Minessale <anthony.minessale@gmail.com>
Mon, 10 Mar 2008 16:13:12 +0000 (16:13 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Mon, 10 Mar 2008 16:13:12 +0000 (16:13 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7850 d0543943-73ff-0310-b7d9-9358b9ac24b2

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

index 248878c1c1ebe76df850ff013cf7e3681b0f4849..4dfb4f8a6803222c25bc5b5609f82b725ef29b8a 100644 (file)
@@ -223,13 +223,6 @@ 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) {
-               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) {
                const char *buuid;
index cda7b7c2e0c010d4cc671e8aa20ee26ab05a7797..ce8d227cec56ef3c651c368e08c620d5125e94dc 100644 (file)
@@ -223,7 +223,9 @@ void sofia_glue_set_local_sdp(private_object_t *tech_pvt, const char *ip, uint32
        }
 
        if (switch_test_flag(tech_pvt, TFLAG_VIDEO)) {                                                  
-               sofia_glue_tech_choose_video_port(tech_pvt);
+               if (!tech_pvt->local_sdp_video_port) {
+                       sofia_glue_tech_choose_video_port(tech_pvt);
+               }
 
                if ((v_port = tech_pvt->adv_sdp_video_port)) {
                        switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "m=video %d RTP/AVP", v_port);
@@ -523,7 +525,7 @@ switch_status_t sofia_glue_tech_choose_video_port(private_object_t *tech_pvt)
        char *ip = tech_pvt->profile->rtpip;
        switch_port_t sdp_port;
        char tmp[50];
-
+       
        if (switch_channel_test_flag(tech_pvt->channel, CF_PROXY_MODE) || switch_channel_test_flag(tech_pvt->channel, CF_PROXY_MEDIA) || tech_pvt->adv_sdp_video_port) {
                return SWITCH_STATUS_SUCCESS;
        }
@@ -1174,10 +1176,14 @@ void sofia_glue_deactivate_rtp(private_object_t *tech_pvt)
 
        if (tech_pvt->rtp_session) {
                switch_rtp_destroy(&tech_pvt->rtp_session);
+       } else if (tech_pvt->local_sdp_audio_port) {
+               switch_rtp_release_port(tech_pvt->profile->rtpip, tech_pvt->local_sdp_audio_port);
        }
 
        if (tech_pvt->video_rtp_session) {
                switch_rtp_destroy(&tech_pvt->video_rtp_session);
+       } else if (tech_pvt->local_sdp_video_port) {
+               switch_rtp_release_port(tech_pvt->profile->rtpip, tech_pvt->local_sdp_video_port);
        }
 
 }