提交 702cb032 authored 作者: Michael Jerris's avatar Michael Jerris

don't send very large dtmf strings or block on very large dtmf strings.

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7221 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 5bf91bd2
...@@ -973,6 +973,11 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_send_dtmf_string(switch_core ...@@ -973,6 +973,11 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_send_dtmf_string(switch_core
return SWITCH_STATUS_FALSE; return SWITCH_STATUS_FALSE;
} }
if (strlen(dtmf_string) > 99) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Attempt to send very large dtmf string ignored!\n");
return SWITCH_STATUS_FALSE;
}
string = switch_core_session_strdup(session, dtmf_string); string = switch_core_session_strdup(session, dtmf_string);
argc = switch_separate_string(string, '+', argv, (sizeof(argv) / sizeof(argv[0]))); argc = switch_separate_string(string, '+', argv, (sizeof(argv) / sizeof(argv[0])));
......
...@@ -1202,7 +1202,10 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_queue_rfc2833(switch_rtp_t *rtp_sessi ...@@ -1202,7 +1202,10 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_queue_rfc2833(switch_rtp_t *rtp_sessi
if ((rdigit = malloc(sizeof(*rdigit))) != 0) { if ((rdigit = malloc(sizeof(*rdigit))) != 0) {
*rdigit = *dtmf; *rdigit = *dtmf;
switch_queue_push(rtp_session->dtmf_data.dtmf_queue, rdigit); if ((switch_queue_trypush(rtp_session->dtmf_data.dtmf_queue, rdigit)) != SWITCH_STATUS_SUCCESS) {
free(rdigit);
return SWITCH_STATUS_FALSE;
}
} else { } else {
abort(); abort();
} }
...@@ -1222,7 +1225,10 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_queue_rfc2833_in(switch_rtp_t *rtp_se ...@@ -1222,7 +1225,10 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_queue_rfc2833_in(switch_rtp_t *rtp_se
if ((rdigit = malloc(sizeof(*rdigit))) != 0) { if ((rdigit = malloc(sizeof(*rdigit))) != 0) {
*rdigit = *dtmf; *rdigit = *dtmf;
switch_queue_push(rtp_session->dtmf_data.dtmf_inqueue, rdigit); if ((switch_queue_trypush(rtp_session->dtmf_data.dtmf_inqueue, rdigit)) != SWITCH_STATUS_SUCCESS) {
free(rdigit);
return SWITCH_STATUS_FALSE;
}
} else { } else {
abort(); abort();
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论