mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-06-03 11:58:36 +00:00
late neg + video issues
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7834 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
87223a5c1e
commit
df5c3d292a
@ -532,6 +532,7 @@ switch_status_t sofia_glue_tech_choose_video_port(private_object_t *tech_pvt)
|
|||||||
return SWITCH_STATUS_FALSE;
|
return SWITCH_STATUS_FALSE;
|
||||||
}
|
}
|
||||||
sdp_port = tech_pvt->local_sdp_video_port;
|
sdp_port = tech_pvt->local_sdp_video_port;
|
||||||
|
|
||||||
|
|
||||||
if (tech_pvt->profile->extrtpip) {
|
if (tech_pvt->profile->extrtpip) {
|
||||||
if (sofia_glue_ext_address_lookup(&ip, &sdp_port, tech_pvt->profile->extrtpip, switch_core_session_get_pool(tech_pvt->session)) !=
|
if (sofia_glue_ext_address_lookup(&ip, &sdp_port, tech_pvt->profile->extrtpip, switch_core_session_get_pool(tech_pvt->session)) !=
|
||||||
@ -1633,6 +1634,10 @@ switch_status_t sofia_glue_activate_rtp(private_object_t *tech_pvt, switch_rtp_f
|
|||||||
|
|
||||||
sofia_glue_check_video_codecs(tech_pvt);
|
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 (switch_test_flag(tech_pvt, TFLAG_VIDEO) && tech_pvt->video_rm_encoding) {
|
||||||
flags = (switch_rtp_flag_t) (SWITCH_RTP_FLAG_USE_TIMER | SWITCH_RTP_FLAG_AUTOADJ |
|
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);
|
SWITCH_RTP_FLAG_DATAWAIT | SWITCH_RTP_FLAG_NOBLOCK | SWITCH_RTP_FLAG_RAW_WRITE);
|
||||||
@ -1662,10 +1667,14 @@ switch_status_t sofia_glue_activate_rtp(private_object_t *tech_pvt, switch_rtp_f
|
|||||||
|
|
||||||
if (switch_rtp_ready(tech_pvt->video_rtp_session)) {
|
if (switch_rtp_ready(tech_pvt->video_rtp_session)) {
|
||||||
switch_channel_set_flag(tech_pvt->channel, CF_VIDEO);
|
switch_channel_set_flag(tech_pvt->channel, CF_VIDEO);
|
||||||
|
} else {
|
||||||
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "VIDEO RTP REPORTS ERROR: [%s]\n", switch_str_nil(err));
|
||||||
|
switch_channel_hangup(tech_pvt->channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
|
||||||
|
goto end;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "RTP REPORTS ERROR: [%s]\n", switch_str_nil(err));
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "AUDIO RTP REPORTS ERROR: [%s]\n", switch_str_nil(err));
|
||||||
switch_channel_hangup(tech_pvt->channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
|
switch_channel_hangup(tech_pvt->channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
|
||||||
switch_clear_flag_locked(tech_pvt, TFLAG_IO);
|
switch_clear_flag_locked(tech_pvt, TFLAG_IO);
|
||||||
status = SWITCH_STATUS_FALSE;
|
status = SWITCH_STATUS_FALSE;
|
||||||
|
@ -428,6 +428,11 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_set_local_address(switch_rtp_t *rtp_s
|
|||||||
|
|
||||||
*err = NULL;
|
*err = NULL;
|
||||||
|
|
||||||
|
if (switch_strlen_zero(host) || !port) {
|
||||||
|
*err = "Address Error";
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
if (switch_sockaddr_info_get(&rtp_session->local_addr, host, SWITCH_UNSPEC, port, 0, rtp_session->pool) != SWITCH_STATUS_SUCCESS) {
|
if (switch_sockaddr_info_get(&rtp_session->local_addr, host, SWITCH_UNSPEC, port, 0, rtp_session->pool) != SWITCH_STATUS_SUCCESS) {
|
||||||
*err = "Local Address Error!";
|
*err = "Local Address Error!";
|
||||||
goto done;
|
goto done;
|
||||||
@ -468,17 +473,13 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_set_local_address(switch_rtp_t *rtp_s
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (++x > 500) {
|
if (++x > 1000) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
switch_yield(1000);
|
switch_yield(1000);
|
||||||
}
|
}
|
||||||
switch_socket_opt_set(new_sock, SWITCH_SO_NONBLOCK, FALSE);
|
switch_socket_opt_set(new_sock, SWITCH_SO_NONBLOCK, FALSE);
|
||||||
|
|
||||||
if (!ilen) {
|
|
||||||
*err = "Send myself a packet failed!";
|
|
||||||
goto done;
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
old_sock = rtp_session->sock;
|
old_sock = rtp_session->sock;
|
||||||
@ -740,13 +741,28 @@ SWITCH_DECLARE(switch_rtp_t *) switch_rtp_new(const char *rx_host,
|
|||||||
switch_memory_pool_t *pool)
|
switch_memory_pool_t *pool)
|
||||||
{
|
{
|
||||||
switch_rtp_t *rtp_session = NULL;
|
switch_rtp_t *rtp_session = NULL;
|
||||||
|
|
||||||
if (switch_rtp_create(&rtp_session, payload, samples_per_interval, ms_per_packet, flags, timer_name, err, pool) != SWITCH_STATUS_SUCCESS) {
|
if (switch_strlen_zero(rx_host)) {
|
||||||
|
*err = "Missing local host";
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!rx_port) {
|
||||||
|
*err = "Missing local port";
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (switch_strlen_zero(tx_host)) {
|
||||||
|
*err = "Missing remote host";
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!tx_port) {
|
||||||
|
*err = "Missing local port";
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (switch_rtp_set_remote_address(rtp_session, tx_host, tx_port, err) != SWITCH_STATUS_SUCCESS) {
|
if (switch_rtp_create(&rtp_session, payload, samples_per_interval, ms_per_packet, flags, timer_name, err, pool) != SWITCH_STATUS_SUCCESS) {
|
||||||
rtp_session = NULL;
|
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -754,6 +770,11 @@ SWITCH_DECLARE(switch_rtp_t *) switch_rtp_new(const char *rx_host,
|
|||||||
rtp_session = NULL;
|
rtp_session = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (switch_rtp_set_remote_address(rtp_session, tx_host, tx_port, err) != SWITCH_STATUS_SUCCESS) {
|
||||||
|
rtp_session = NULL;
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
end:
|
end:
|
||||||
|
|
||||||
if (rtp_session) {
|
if (rtp_session) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user