diff --git a/channel.c b/channel.c index 3db38b6cc1059ae5e88a47b244a126eca641e416..c961f575c78a1d4254e8b34e6302b45f1984cb73 100644 --- a/channel.c +++ b/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"); break; 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: - /* nothing to do with these yet */ - res = 0; + if (chan->tech->send_digit_end) + res = chan->tech->send_digit_end(chan); + else + res = 0; break; case AST_FRAME_DTMF: ast_clear_flag(chan, AST_FLAG_BLOCKING); diff --git a/include/asterisk/channel.h b/include/asterisk/channel.h index 59fbee5fffcde8be9496feb55052428244264895..4b120d8cf26d5d2766402fc03e87dbde4dd711b1 100644 --- a/include/asterisk/channel.h +++ b/include/asterisk/channel.h @@ -189,6 +189,12 @@ struct ast_channel_tech { /*! Send a literal DTMF 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 take longer than timeout seconds to do so. */ int (* const call)(struct ast_channel *chan, char *addr, int timeout);