diff --git a/src/mod/endpoints/mod_exosip/mod_exosip.c b/src/mod/endpoints/mod_exosip/mod_exosip.c index ebc7cf7904..39507fd4e5 100644 --- a/src/mod/endpoints/mod_exosip/mod_exosip.c +++ b/src/mod/endpoints/mod_exosip/mod_exosip.c @@ -586,7 +586,9 @@ static switch_status_t activate_rtp(struct private_object *tech_pvt) } } else { switch_channel_t *channel = switch_core_session_get_channel(tech_pvt->session); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "RTP REPORTS ERROR: [%s]\n", err); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "RTP REPORTS ERROR: [%s][%s:%d]\n", err, + tech_pvt->local_sdp_audio_ip, + tech_pvt->local_sdp_audio_port); switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER); switch_set_flag_locked(tech_pvt, TFLAG_BYE); switch_clear_flag_locked(tech_pvt, TFLAG_IO); diff --git a/src/switch.c b/src/switch.c index 0048050766..51cac5af3a 100644 --- a/src/switch.c +++ b/src/switch.c @@ -84,10 +84,6 @@ int main(int argc, char *argv[]) nice(-20); #endif -#ifdef HAVE_MLOCKALL - mlockall(MCL_CURRENT|MCL_FUTURE); -#endif - #ifndef WIN32 if (argv[1] && !strcmp(argv[1], "-stop")) { pid_t pid = 0; @@ -182,6 +178,11 @@ int main(int argc, char *argv[]) switch_event_fire(&event); } +#ifdef HAVE_MLOCKALL + mlockall(MCL_CURRENT|MCL_FUTURE); +#endif + + #ifdef CRASH_PROT #define __CP "ENABLED" #else diff --git a/src/switch_rtp.c b/src/switch_rtp.c index 7832db0589..e7fd95f361 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -298,8 +298,8 @@ SWITCH_DECLARE(switch_port_t) switch_rtp_request_port(void) switch_mutex_lock(port_lock); port = NEXT_PORT; NEXT_PORT += 2; - if (port > RTP_END_PORT) { - port = RTP_START_PORT; + if (NEXT_PORT > RTP_END_PORT) { + NEXT_PORT = RTP_START_PORT; } switch_mutex_unlock(port_lock); return port;