Merge the changes from the /team/group/vldtmf_fixup branch.

The main bug being addressed here is a problem introduced when two SIP
channels using SIP INFO dtmf have their media directly bridged.  So, when a
DTMF END frame comes into Asterisk from an incoming INFO message, Asterisk
would try to emulate a digit of some length by first sending a DTMF BEGIN
frame and sending a DTMF END later timed off of incoming audio.  However,
since there was no audio coming in, the DTMF_END was never generated.  This
caused DTMF based features to no longer work.

To fix this, the core now knows when a channel doesn't care about DTMF BEGIN
frames (such as a SIP channel sending INFO dtmf).  If this is the case, then
Asterisk will not emulate a digit of some length, and will instead just pass
through the single DTMF END event.

Channel drivers also now get passed the length of the digit to their digit_end
callback.  This improves SIP INFO support even further by enabling us to put
the real digit duration in the INFO message instead of a hard coded 250ms.
Also, for an incoming INFO message, the duration is read from the frame and
passed into the core instead of just getting ignored.

(issue #8597, maybe others...)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51311 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Russell Bryant
2007-01-19 17:49:38 +00:00
parent 879a71e921
commit 33235b40d6
18 changed files with 200 additions and 109 deletions

View File

@@ -159,7 +159,7 @@ static char cid_name[AST_MAX_EXTENSION];
static struct ast_channel *phone_request(const char *type, int format, void *data, int *cause);
static int phone_digit_begin(struct ast_channel *ast, char digit);
static int phone_digit_end(struct ast_channel *ast, char digit);
static int phone_digit_end(struct ast_channel *ast, char digit, unsigned int duration);
static int phone_call(struct ast_channel *ast, char *dest, int timeout);
static int phone_hangup(struct ast_channel *ast);
static int phone_answer(struct ast_channel *ast);
@@ -246,12 +246,12 @@ static int phone_digit_begin(struct ast_channel *chan, char digit)
return 0;
}
static int phone_digit_end(struct ast_channel *ast, char digit)
static int phone_digit_end(struct ast_channel *ast, char digit, unsigned int duration)
{
struct phone_pvt *p;
int outdigit;
p = ast->tech_pvt;
ast_log(LOG_NOTICE, "Dialed %c\n", digit);
ast_log(LOG_DEBUG, "Dialed %c\n", digit);
switch(digit) {
case '0':
case '1':
@@ -282,7 +282,7 @@ static int phone_digit_end(struct ast_channel *ast, char digit)
ast_log(LOG_WARNING, "Unknown digit '%c'\n", digit);
return -1;
}
ast_log(LOG_NOTICE, "Dialed %d\n", outdigit);
ast_log(LOG_DEBUG, "Dialed %d\n", outdigit);
ioctl(p->fd, PHONE_PLAY_TONE, outdigit);
p->lastformat = -1;
return 0;
@@ -335,7 +335,7 @@ static int phone_call(struct ast_channel *ast, char *dest, int timeout)
{
digit++;
while (*digit)
phone_digit_end(ast, *digit++);
phone_digit_end(ast, *digit++, 0);
}
}