mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
add channel-driver callbacks for variable length DTMF
teach ast_write() to call those new callbacks git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@8851 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
11
channel.c
11
channel.c
@@ -2295,9 +2295,16 @@ int ast_write(struct ast_channel *chan, struct ast_frame *fr)
|
|||||||
ast_log(LOG_WARNING, "Don't know how to handle control frames yet\n");
|
ast_log(LOG_WARNING, "Don't know how to handle control frames yet\n");
|
||||||
break;
|
break;
|
||||||
case AST_FRAME_DTMF_BEGIN:
|
case AST_FRAME_DTMF_BEGIN:
|
||||||
|
if (chan->tech->send_digit_begin)
|
||||||
|
res = chan->tech->send_digit_begin(chan, fr->subclass);
|
||||||
|
else
|
||||||
|
res = 0;
|
||||||
|
break;
|
||||||
case AST_FRAME_DTMF_END:
|
case AST_FRAME_DTMF_END:
|
||||||
/* nothing to do with these yet */
|
if (chan->tech->send_digit_end)
|
||||||
res = 0;
|
res = chan->tech->send_digit_end(chan);
|
||||||
|
else
|
||||||
|
res = 0;
|
||||||
break;
|
break;
|
||||||
case AST_FRAME_DTMF:
|
case AST_FRAME_DTMF:
|
||||||
ast_clear_flag(chan, AST_FLAG_BLOCKING);
|
ast_clear_flag(chan, AST_FLAG_BLOCKING);
|
||||||
|
@@ -189,6 +189,12 @@ struct ast_channel_tech {
|
|||||||
/*! Send a literal DTMF digit */
|
/*! Send a literal DTMF digit */
|
||||||
int (* const send_digit)(struct ast_channel *chan, char digit);
|
int (* const send_digit)(struct ast_channel *chan, char digit);
|
||||||
|
|
||||||
|
/*! Start sending a literal DTMF digit */
|
||||||
|
int (* const send_digit_begin)(struct ast_channel *chan, char digit);
|
||||||
|
|
||||||
|
/*! Stop sending the last literal DTMF digit */
|
||||||
|
int (* const send_digit_end)(struct ast_channel *chan);
|
||||||
|
|
||||||
/*! Call a given phone number (address, etc), but don't
|
/*! Call a given phone number (address, etc), but don't
|
||||||
take longer than timeout seconds to do so. */
|
take longer than timeout seconds to do so. */
|
||||||
int (* const call)(struct ast_channel *chan, char *addr, int timeout);
|
int (* const call)(struct ast_channel *chan, char *addr, int timeout);
|
||||||
|
Reference in New Issue
Block a user