Merge "AMI PlayDTMF Action: Make not compete with channel's media thread."

This commit is contained in:
George Joseph
2018-06-21 10:25:32 -05:00
committed by Gerrit Code Review
3 changed files with 37 additions and 3 deletions

View File

@@ -4810,12 +4810,28 @@ int ast_senddigit_end(struct ast_channel *chan, char digit, unsigned int duratio
int ast_senddigit(struct ast_channel *chan, char digit, unsigned int duration)
{
if (duration < AST_DEFAULT_EMULATE_DTMF_DURATION) {
duration = AST_DEFAULT_EMULATE_DTMF_DURATION;
}
if (ast_channel_tech(chan)->send_digit_begin) {
ast_senddigit_begin(chan, digit);
ast_safe_sleep(chan, (duration >= AST_DEFAULT_EMULATE_DTMF_DURATION ? duration : AST_DEFAULT_EMULATE_DTMF_DURATION));
ast_safe_sleep(chan, duration);
}
return ast_senddigit_end(chan, digit, (duration >= AST_DEFAULT_EMULATE_DTMF_DURATION ? duration : AST_DEFAULT_EMULATE_DTMF_DURATION));
return ast_senddigit_end(chan, digit, duration);
}
int ast_senddigit_external(struct ast_channel *chan, char digit, unsigned int duration)
{
if (duration < AST_DEFAULT_EMULATE_DTMF_DURATION) {
duration = AST_DEFAULT_EMULATE_DTMF_DURATION;
}
if (ast_channel_tech(chan)->send_digit_begin) {
ast_senddigit_begin(chan, digit);
usleep(duration * 1000);
}
return ast_senddigit_end(chan, digit, duration);
}
int ast_prod(struct ast_channel *chan)