OPENZAP-30 add support for flash hook as part of the dial string using 'F'

git-svn-id: http://svn.openzap.org/svn/openzap/trunk@612 a93c3328-9c30-0410-af19-c9cd2b2d52af
This commit is contained in:
Michael Jerris
2008-11-20 23:46:15 +00:00
parent 7d75e8df89
commit f8b23330bc
3 changed files with 18 additions and 1 deletions

View File

@@ -1712,7 +1712,14 @@ static zap_status_t handle_dtmf(zap_channel_t *zchan, zap_size_t datalen)
if (zap_buffer_read(zchan->gen_dtmf_buffer, digits, dblen) && !zap_strlen_zero_buf(digits)) {
zap_log(ZAP_LOG_DEBUG, "%d:%d GENERATE DTMF [%s]\n", zchan->span_id, zchan->chan_id, digits);
for (cur = digits; *cur; cur++) {
cur = digits;
if (*cur == 'F') {
zap_channel_command(zchan, ZAP_COMMAND_FLASH, NULL);
cur++;
}
for (; *cur; cur++) {
int wrote = 0;
if ((wrote = teletone_mux_tones(&zchan->tone_session, &zchan->tone_session.TONES[(int)*cur]))) {
zap_buffer_write(zchan->dtmf_buffer, zchan->tone_session.buffer, wrote * 2);