MODENDP-169
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@11160 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
6c622d5c27
commit
c488041f4a
|
@ -801,6 +801,7 @@ static switch_status_t load_config(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
globals.indev = globals.outdev = globals.ringdev = -1;
|
globals.indev = globals.outdev = globals.ringdev = -1;
|
||||||
|
globals.sample_rate = 8000;
|
||||||
|
|
||||||
if ((settings = switch_xml_child(cfg, "settings"))) {
|
if ((settings = switch_xml_child(cfg, "settings"))) {
|
||||||
for (param = switch_xml_child(settings, "param"); param; param = param->next) {
|
for (param = switch_xml_child(settings, "param"); param; param = param->next) {
|
||||||
|
@ -821,7 +822,7 @@ static switch_status_t load_config(void)
|
||||||
globals.sample_rate = atoi(val);
|
globals.sample_rate = atoi(val);
|
||||||
} else if (!strcmp(var, "codec-ms")) {
|
} else if (!strcmp(var, "codec-ms")) {
|
||||||
int tmp = atoi(val);
|
int tmp = atoi(val);
|
||||||
if (SWITCH_ACCEPTABLE_INTERVAL(tmp)) {
|
if (switch_check_interval(globals.sample_rate, tmp)) {
|
||||||
globals.codec_ms = tmp;
|
globals.codec_ms = tmp;
|
||||||
} else {
|
} else {
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING,
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING,
|
||||||
|
|
|
@ -1007,6 +1007,13 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_activate_ice(switch_rtp_t *rtp_sessio
|
||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void ping_socket(switch_rtp_t *rtp_session)
|
||||||
|
{
|
||||||
|
uint32_t o = UINT_MAX;
|
||||||
|
switch_size_t len = sizeof(o);
|
||||||
|
switch_socket_sendto(rtp_session->sock_input, rtp_session->local_addr, 0, (void *) &o, &len);
|
||||||
|
}
|
||||||
|
|
||||||
SWITCH_DECLARE(void) switch_rtp_break(switch_rtp_t *rtp_session)
|
SWITCH_DECLARE(void) switch_rtp_break(switch_rtp_t *rtp_session)
|
||||||
{
|
{
|
||||||
if (!switch_rtp_ready(rtp_session)) {
|
if (!switch_rtp_ready(rtp_session)) {
|
||||||
|
@ -1023,9 +1030,7 @@ SWITCH_DECLARE(void) switch_rtp_break(switch_rtp_t *rtp_session)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rtp_session->sock_input) {
|
if (rtp_session->sock_input) {
|
||||||
uint32_t o = UINT_MAX;
|
ping_socket(rtp_session);
|
||||||
switch_size_t len = sizeof(o);
|
|
||||||
switch_socket_sendto(rtp_session->sock_input, rtp_session->local_addr, 0, (void *) &o, &len);
|
|
||||||
}
|
}
|
||||||
switch_mutex_unlock(rtp_session->flag_mutex);
|
switch_mutex_unlock(rtp_session->flag_mutex);
|
||||||
}
|
}
|
||||||
|
@ -1037,6 +1042,7 @@ SWITCH_DECLARE(void) switch_rtp_kill_socket(switch_rtp_t *rtp_session)
|
||||||
if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_IO)) {
|
if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_IO)) {
|
||||||
switch_clear_flag(rtp_session, SWITCH_RTP_FLAG_IO);
|
switch_clear_flag(rtp_session, SWITCH_RTP_FLAG_IO);
|
||||||
if (rtp_session->sock_input) {
|
if (rtp_session->sock_input) {
|
||||||
|
ping_socket(rtp_session);
|
||||||
switch_socket_shutdown(rtp_session->sock_input, SWITCH_SHUTDOWN_READWRITE);
|
switch_socket_shutdown(rtp_session->sock_input, SWITCH_SHUTDOWN_READWRITE);
|
||||||
}
|
}
|
||||||
if (rtp_session->sock_output && rtp_session->sock_output != rtp_session->sock_input) {
|
if (rtp_session->sock_output && rtp_session->sock_output != rtp_session->sock_input) {
|
||||||
|
|
Loading…
Reference in New Issue