From dcca8f345fa55b146fe6b0930df18b226809cc70 Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Fri, 19 Jan 2007 18:06:03 +0000 Subject: Merged revisions 51311 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r51311 | russell | 2007-01-19 11:49:38 -0600 (Fri, 19 Jan 2007) | 23 lines 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/trunk@51314 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- channels/chan_jingle.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'channels/chan_jingle.c') diff --git a/channels/chan_jingle.c b/channels/chan_jingle.c index 201f7fe1c..493c2f13b 100644 --- a/channels/chan_jingle.c +++ b/channels/chan_jingle.c @@ -169,7 +169,7 @@ AST_MUTEX_DEFINE_STATIC(jinglelock); /*!< Protect the interface list (of jingle_ /* Forward declarations */ static struct ast_channel *jingle_request(const char *type, int format, void *data, int *cause); static int jingle_digit_begin(struct ast_channel *ast, char digit); -static int jingle_digit_end(struct ast_channel *ast, char digit); +static int jingle_digit_end(struct ast_channel *ast, char digit, unsigned int duration); static int jingle_call(struct ast_channel *ast, char *dest, int timeout); static int jingle_hangup(struct ast_channel *ast); static int jingle_answer(struct ast_channel *ast); @@ -1182,13 +1182,7 @@ static int jingle_indicate(struct ast_channel *ast, int condition, const void *d return res; } -static int jingle_digit_begin(struct ast_channel *chan, char digit) -{ - /* XXX Does jingle have a concept of the length of a dtmf digit ? */ - return 0; -} - -static int jingle_digit_end(struct ast_channel *ast, char digit) +static int jingle_digit(struct ast_channel *ast, char digit, unsigned int duration) { struct jingle_pvt *p = ast->tech_pvt; struct jingle *client = p->parent; @@ -1223,9 +1217,7 @@ static int jingle_digit_end(struct ast_channel *ast, char digit) iks_insert_node(jingle, dtmf); ast_mutex_lock(&p->lock); - if(ast->dtmff.frametype == AST_FRAME_DTMF) { - ast_verbose("Sending 250ms dtmf!\n"); - } else if (ast->dtmff.frametype == AST_FRAME_DTMF_BEGIN) { + if (ast->dtmff.frametype == AST_FRAME_DTMF_BEGIN) { iks_insert_attrib(dtmf, "action", "button-down"); } else if (ast->dtmff.frametype == AST_FRAME_DTMF_END) { iks_insert_attrib(dtmf, "action", "button-up"); @@ -1238,6 +1230,16 @@ static int jingle_digit_end(struct ast_channel *ast, char digit) return 0; } +static int jingle_digit_begin(struct ast_channel *chan, char digit) +{ + return jingle_digit(chan, digit, 0); +} + +static int jingle_digit_end(struct ast_channel *ast, char digit, unsigned int duration) +{ + return jingle_digit(ast, digit, duration); +} + static int jingle_sendhtml(struct ast_channel *ast, int subclass, const char *data, int datalen) { ast_log(LOG_NOTICE, "XXX Implement jingle sendhtml XXX\n"); -- cgit v1.2.3