diff options
author | Russell Bryant <russell@russellbryant.com> | 2007-01-19 18:06:03 +0000 |
---|---|---|
committer | Russell Bryant <russell@russellbryant.com> | 2007-01-19 18:06:03 +0000 |
commit | dcca8f345fa55b146fe6b0930df18b226809cc70 (patch) | |
tree | 6fb863ed2b3e4abdc44db77e4e5cce3bed75c618 /include/asterisk | |
parent | 9d509eaf76a950825a1cd473d8c752cfa6b0c5a7 (diff) |
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
Diffstat (limited to 'include/asterisk')
-rw-r--r-- | include/asterisk/channel.h | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/include/asterisk/channel.h b/include/asterisk/channel.h index 60b68feb2..e9695940b 100644 --- a/include/asterisk/channel.h +++ b/include/asterisk/channel.h @@ -242,7 +242,7 @@ struct ast_channel_tech { int (* const send_digit_begin)(struct ast_channel *chan, char digit); /*! \brief Stop sending a literal DTMF digit */ - int (* const send_digit_end)(struct ast_channel *chan, char digit); + int (* const send_digit_end)(struct ast_channel *chan, char digit, unsigned int duration); /*! \brief Call a given phone number (address, etc), but don't take longer than timeout seconds to do so. */ @@ -479,7 +479,8 @@ struct ast_channel { struct ast_jb jb; /*!< The jitterbuffer state */ char emulate_dtmf_digit; /*!< Digit being emulated */ - unsigned int emulate_dtmf_samples; /*!< Number of samples left to emulate DTMF for */ + unsigned int emulate_dtmf_duration; /*!< Number of ms left to emulate DTMF for */ + struct timeval dtmf_begin_tv; /*!< The time that an in process digit began */ /*! \brief Data stores on the channel */ AST_LIST_HEAD_NOLOCK(datastores, ast_datastore) datastores; @@ -498,34 +499,37 @@ enum { /*! \brief ast_channel flags */ enum { /*! Queue incoming dtmf, to be released when this flag is turned off */ - AST_FLAG_DEFER_DTMF = (1 << 1), + AST_FLAG_DEFER_DTMF = (1 << 1), /*! write should be interrupt generator */ - AST_FLAG_WRITE_INT = (1 << 2), + AST_FLAG_WRITE_INT = (1 << 2), /*! a thread is blocking on this channel */ - AST_FLAG_BLOCKING = (1 << 3), + AST_FLAG_BLOCKING = (1 << 3), /*! This is a zombie channel */ - AST_FLAG_ZOMBIE = (1 << 4), + AST_FLAG_ZOMBIE = (1 << 4), /*! There is an exception pending */ - AST_FLAG_EXCEPTION = (1 << 5), + AST_FLAG_EXCEPTION = (1 << 5), /*! Listening to moh XXX anthm promises me this will disappear XXX */ - AST_FLAG_MOH = (1 << 6), + AST_FLAG_MOH = (1 << 6), /*! This channel is spying on another channel */ - AST_FLAG_SPYING = (1 << 7), + AST_FLAG_SPYING = (1 << 7), /*! This channel is in a native bridge */ - AST_FLAG_NBRIDGE = (1 << 8), + AST_FLAG_NBRIDGE = (1 << 8), /*! the channel is in an auto-incrementing dialplan processor, * so when ->priority is set, it will get incremented before * finding the next priority to run */ - AST_FLAG_IN_AUTOLOOP = (1 << 9), + AST_FLAG_IN_AUTOLOOP = (1 << 9), /*! This is an outgoing call */ - AST_FLAG_OUTGOING = (1 << 10), + AST_FLAG_OUTGOING = (1 << 10), /*! This channel is being whispered on */ - AST_FLAG_WHISPER = (1 << 11), + AST_FLAG_WHISPER = (1 << 11), /*! A DTMF_BEGIN frame has been read from this channel, but not yet an END */ - AST_FLAG_IN_DTMF = (1 << 12), + AST_FLAG_IN_DTMF = (1 << 12), /*! A DTMF_END was received when not IN_DTMF, so the length of the digit is * currently being emulated */ - AST_FLAG_EMULATE_DTMF = (1 << 13), + AST_FLAG_EMULATE_DTMF = (1 << 13), + /*! This is set to tell the channel not to generate DTMF begin frames, and + * to instead only generate END frames. */ + AST_FLAG_END_DTMF_ONLY = (1 << 14), }; /*! \brief ast_bridge_config flags */ @@ -934,14 +938,16 @@ int ast_senddigit(struct ast_channel *chan, char digit); * \return Returns 0 on success, -1 on failure */ int ast_senddigit_begin(struct ast_channel *chan, char digit); + /*! \brief Send a DTMF digit to a channel * Send a DTMF digit to a channel. * \param chan channel to act upon * \param digit the DTMF digit to send, encoded in ASCII + * \param duration the duration of the digit ending in ms * \return Returns 0 on success, -1 on failure */ -int ast_senddigit_end(struct ast_channel *chan, char digit); +int ast_senddigit_end(struct ast_channel *chan, char digit, unsigned int duration); /*! \brief Receives a text string from a channel * Read a string of text from a channel |