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) {
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);
}
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;
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);