git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7841 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale
2008-03-08 02:11:21 +00:00
parent f2fe5d6977
commit e65075b63f
3 changed files with 14 additions and 3 deletions

View File

@@ -765,12 +765,17 @@ SWITCH_DECLARE(switch_rtp_t *) switch_rtp_new(const char *rx_host,
if (switch_rtp_create(&rtp_session, payload, samples_per_interval, ms_per_packet, flags, timer_name, err, pool) != SWITCH_STATUS_SUCCESS) {
goto end;
}
switch_mutex_lock(rtp_session->flag_mutex);
if (switch_rtp_set_local_address(rtp_session, rx_host, rx_port, err) != SWITCH_STATUS_SUCCESS) {
switch_mutex_unlock(rtp_session->flag_mutex);
rtp_session = NULL;
goto end;
}
if (switch_rtp_set_remote_address(rtp_session, tx_host, tx_port, err) != SWITCH_STATUS_SUCCESS) {
switch_mutex_unlock(rtp_session->flag_mutex);
rtp_session = NULL;
goto end;
}
@@ -778,6 +783,7 @@ SWITCH_DECLARE(switch_rtp_t *) switch_rtp_new(const char *rx_host,
end:
if (rtp_session) {
switch_mutex_unlock(rtp_session->flag_mutex);
rtp_session->ready = 2;
rtp_session->rx_host = switch_core_strdup(rtp_session->pool, rx_host);
rtp_session->rx_port = rx_port;