mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-14 16:15:04 +00:00
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
This commit is contained in:
parent
5bf91bd2ae
commit
702cb03231
@ -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
|
|||||||
|
|
||||||
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
|
|||||||
|
|
||||||
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();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user