make send_dtmf parse w and W for 500 and 1000 ms pause

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4086 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2007-01-29 20:11:26 +00:00
parent d246f3a07b
commit 2d4d6ea756
1 changed files with 29 additions and 7 deletions

View File

@ -2469,7 +2469,29 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_send_dtmf(switch_core_sessio
switch_status_t status = SWITCH_STATUS_FALSE; switch_status_t status = SWITCH_STATUS_FALSE;
if (session->endpoint_interface->io_routines->send_dtmf) { if (session->endpoint_interface->io_routines->send_dtmf) {
if ((status = session->endpoint_interface->io_routines->send_dtmf(session, dtmf)) == SWITCH_STATUS_SUCCESS) { if (strchr(dtmf, 'w') || strchr(dtmf, 'W')) {
char *d;
for (d = dtmf; d && *d; d++) {
char digit[2] = "";
if (*d == 'w') {
switch_yield(500000);
continue;
} else if (*d == 'W') {
switch_yield(1000000);
continue;
}
digit[0] = *d;
if ((status = session->endpoint_interface->io_routines->send_dtmf(session, digit)) != SWITCH_STATUS_SUCCESS) {
return status;
}
}
} else {
status = session->endpoint_interface->io_routines->send_dtmf(session, dtmf);
}
if (status == SWITCH_STATUS_SUCCESS) {
for (ptr = session->event_hooks.send_dtmf; ptr; ptr = ptr->next) { for (ptr = session->event_hooks.send_dtmf; ptr; ptr = ptr->next) {
if ((status = ptr->send_dtmf(session, dtmf)) != SWITCH_STATUS_SUCCESS) { if ((status = ptr->send_dtmf(session, dtmf)) != SWITCH_STATUS_SUCCESS) {
break; break;