Allow a digitstream to contain a flash character ('f' or 'F') when sending dtmf strin...
authorMatthew Fredrickson <creslin@digium.com>
Tue, 10 Jan 2006 21:35:45 +0000 (21:35 +0000)
committerMatthew Fredrickson <creslin@digium.com>
Tue, 10 Jan 2006 21:35:45 +0000 (21:35 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7948 65c4cc65-6c06-0410-ace0-fbb531ad65f3

app.c

diff --git a/app.c b/app.c
index f6eb18e..40dbc75 100644 (file)
--- a/app.c
+++ b/app.c
@@ -304,10 +304,16 @@ int ast_dtmf_stream(struct ast_channel *chan,struct ast_channel *peer,char *digi
                                f.frametype = AST_FRAME_DTMF;
                                f.subclass = *ptr;
                                f.src = "ast_dtmf_stream";
-                               if (strchr("0123456789*#abcdABCD",*ptr)==NULL) {
-                                       ast_log(LOG_WARNING, "Illegal DTMF character '%c' in string. (0-9*#aAbBcCdD allowed)\n",*ptr);
+                               if (strchr("0123456789*#abcdfABCDF",*ptr)==NULL) {
+                                       ast_log(LOG_WARNING, "Illegal DTMF character '%c' in string. (0-9*#aAbBcCdDfF allowed)\n",*ptr);
                                } else {
-                                       res = ast_write(chan, &f);
+                                       if (*ptr == 'f' || *ptr == 'F') {
+                                               /* ignore return values if not supported by channel */
+                                               ast_indicate(chan, AST_CONTROL_FLASH);
+                                               res = 0;
+                                       } else {
+                                               res = ast_write(chan, &f);
+                                       }
                                        if (res) 
                                                break;
                                        /* pause between digits */