diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-12-12 13:44:08 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-12-12 13:44:08 +0000 |
commit | 5c91a27236b54f4f3d48f1fa1c1ef45b68cb575b (patch) | |
tree | 2d913265b5a2451ed74505c286caeddfeeabe868 /include/asterisk | |
parent | b781c365ac728d64567834b5cf5d43a8e7727074 (diff) |
Resolve issues that could cause DTMF to be processed out of order.
These changes come from team/russell/issue_12658
1) Change autoservice to put digits on the head of the channel's frame readq
instead of the tail. If there were frames on the readq that autoservice
had not yet read, the previous code would have resulted in out of order
processing. This required a new API call to queue a frame to the head
of the queue instead of the tail.
2) Change up the processing of DTMF in ast_read(). Some of the problems
were the result of having two sources of pending DTMF frames. There
was the dtmfq and the more generic readq. Both were used for pending
DTMF in various scenarios. Simplifying things to only use the frame
readq avoids some of the problems.
3) Fix a bug where a DTMF END frame could get passed through when it
shouldn't have. If code set END_DTMF_ONLY in the middle of digit emulation,
and a digit arrived before emulation was complete, digits would get
processed out of order.
(closes issue #12658)
Reported by: dimas
Tested by: russell, file
Review: http://reviewboard.digium.com/r/85/
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@163448 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include/asterisk')
-rw-r--r-- | include/asterisk/channel.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/include/asterisk/channel.h b/include/asterisk/channel.h index a550101ea..aa1ee2d07 100644 --- a/include/asterisk/channel.h +++ b/include/asterisk/channel.h @@ -398,7 +398,7 @@ struct ast_channel { enum ast_channel_state _state; /*!< State of line -- Don't write directly, use ast_setstate */ int rings; /*!< Number of rings so far */ struct ast_callerid cid; /*!< Caller ID, name, presentation etc */ - char dtmfq[AST_MAX_EXTENSION]; /*!< Any/all queued DTMF characters */ + char unused_old_dtmfq[AST_MAX_EXTENSION]; /*!< The DTMFQ is deprecated. All frames should go to the readq. */ struct ast_frame dtmff; /*!< DTMF frame */ char context[AST_MAX_CONTEXT]; /*!< Dialplan: Current extension context */ @@ -632,6 +632,20 @@ struct ast_channel *ast_channel_alloc(int needqueue, int state, const char *cid_ /*! \brief Queue an outgoing frame */ int ast_queue_frame(struct ast_channel *chan, struct ast_frame *f); +/*! + * \brief Queue an outgoing frame to the head of the frame queue + * + * \param chan the channel to queue the frame on + * \param f the frame to queue. Note that this frame will be duplicated by + * this function. It is the responsibility of the caller to handle + * freeing the memory associated with the frame being passed if + * necessary. + * + * \retval 0 success + * \retval non-zero failure + */ +int ast_queue_frame_head(struct ast_channel *chan, struct ast_frame *f); + /*! \brief Queue a hangup frame */ int ast_queue_hangup(struct ast_channel *chan); |