Extend the ast_senddigit and ast_dtmf_stream API calls to allow the duration of the DTMF digit(s) to be specified and make the SendDTMF application have the capability to use it.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@78278 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Joshua Colp
2007-08-06 21:52:30 +00:00
parent 431c60f818
commit 9ef1b0a974
8 changed files with 30 additions and 26 deletions

View File

@@ -245,7 +245,7 @@ int ast_app_messagecount(const char *context, const char *mailbox, const char *f
return 0;
}
int ast_dtmf_stream(struct ast_channel *chan, struct ast_channel *peer, const char *digits, int between)
int ast_dtmf_stream(struct ast_channel *chan, struct ast_channel *peer, const char *digits, int between, unsigned int duration)
{
const char *ptr;
int res = 0;
@@ -274,7 +274,7 @@ int ast_dtmf_stream(struct ast_channel *chan, struct ast_channel *peer, const ch
/* ignore return values if not supported by channel */
ast_indicate(chan, AST_CONTROL_FLASH);
} else
ast_senddigit(chan, *ptr);
ast_senddigit(chan, *ptr, duration);
/* pause between digits */
if ((res = ast_safe_sleep(chan, between)))
break;

View File

@@ -2657,14 +2657,14 @@ int ast_senddigit_end(struct ast_channel *chan, char digit, unsigned int duratio
return 0;
}
int ast_senddigit(struct ast_channel *chan, char digit)
int ast_senddigit(struct ast_channel *chan, char digit, unsigned int duration)
{
if (chan->tech->send_digit_begin) {
ast_senddigit_begin(chan, digit);
ast_safe_sleep(chan, AST_DEFAULT_EMULATE_DTMF_DURATION);
ast_safe_sleep(chan, (duration >= AST_DEFAULT_EMULATE_DTMF_DURATION ? duration : AST_DEFAULT_EMULATE_DTMF_DURATION));
}
return ast_senddigit_end(chan, digit, AST_DEFAULT_EMULATE_DTMF_DURATION);
return ast_senddigit_end(chan, digit, (duration >= AST_DEFAULT_EMULATE_DTMF_DURATION ? duration : AST_DEFAULT_EMULATE_DTMF_DURATION));
}
int ast_prod(struct ast_channel *chan)