aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-01-19 17:49:38 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-01-19 17:49:38 +0000
commitcc3938c1989d0b9f6a907ee2d64f2f66a01b2e29 (patch)
tree3fe50ce72af12ead588e9b25a6bf636f67b0993d /include
parent397418eb0c2c20f83505c9af8d5bb8aa89cab8af (diff)
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: http://svn.digium.com/svn/asterisk/branches/1.4@51311 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include')
-rw-r--r--include/asterisk/channel.h36
1 files changed, 20 insertions, 16 deletions
diff --git a/include/asterisk/channel.h b/include/asterisk/channel.h
index 431f57144..efa06bafb 100644
--- a/include/asterisk/channel.h
+++ b/include/asterisk/channel.h
@@ -204,7 +204,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. */
@@ -427,7 +427,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;
@@ -446,34 +447,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 */
@@ -887,7 +891,7 @@ int ast_recvchar(struct ast_channel *chan, int timeout);
int ast_senddigit(struct ast_channel *chan, char digit);
int ast_senddigit_begin(struct ast_channel *chan, char digit);
-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