diff options
author | Mark Spencer <markster@digium.com> | 2004-05-20 00:29:09 +0000 |
---|---|---|
committer | Mark Spencer <markster@digium.com> | 2004-05-20 00:29:09 +0000 |
commit | 61ce9296565fd06d325acd22bc423c8b1c03fbf1 (patch) | |
tree | 05f62ccb5c5f44a6aaf5e2b8855363ef810f1c97 | |
parent | 67e1c5942744b3d0a2e37bf01c7dfb84204411e8 (diff) |
Merge Mike's announcement enhancements
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3020 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rwxr-xr-x | apps/app_dial.c | 12 | ||||
-rwxr-xr-x | channel.c | 5 | ||||
-rwxr-xr-x | include/asterisk/channel.h | 3 |
3 files changed, 17 insertions, 3 deletions
diff --git a/apps/app_dial.c b/apps/app_dial.c index 9125e0437..10ba7f8a8 100755 --- a/apps/app_dial.c +++ b/apps/app_dial.c @@ -418,6 +418,7 @@ static int dial_exec(struct ast_channel *chan, void *data) char *stack,*var; int play_to_caller=0,play_to_callee=0; int playargs=0; + int digit = 0; if (!data) { ast_log(LOG_WARNING, "Dial requires an argument (technology1/number1&technology2/number2...|optional timeout|options)\n"); @@ -837,11 +838,16 @@ static int dial_exec(struct ast_channel *chan, void *data) // Now Stream the File if (!res) res = ast_streamfile(peer,announcemsg,peer->language); - if (!res) - res = ast_waitstream(peer,""); - + if (!res) { + digit = ast_waitstream(peer, AST_DIGIT_ANY); + } // Ok, done. stop autoservice res = ast_autoservice_stop(chan); + if (digit > 0 && !res) + res = ast_senddigit(chan, digit); + else + res = digit; + } else res = 0; @@ -1431,6 +1431,11 @@ static int do_senddigit(struct ast_channel *chan, char digit) return 0; } +int ast_senddigit(struct ast_channel *chan, char digit) +{ + return do_senddigit(chan, digit); +} + int ast_prod(struct ast_channel *chan) { struct ast_frame a = { AST_FRAME_VOICE }; diff --git a/include/asterisk/channel.h b/include/asterisk/channel.h index c6c3e2461..e420a1982 100755 --- a/include/asterisk/channel.h +++ b/include/asterisk/channel.h @@ -614,6 +614,9 @@ int ast_sendtext(struct ast_channel *chan, char *text); * Read a char of text from a channel * Returns 0 on success, -1 on failure */ + +int ast_senddigit(struct ast_channel *chan, char digit); + int ast_recvchar(struct ast_channel *chan, int timeout); //! Browse channels in use |