chan_iax2: Block unnecessary control frames to/from the wire.

Establishing an IAX2 call between Asterisk v1.4 and v1.8 (or later)
results in an unexpected call disconnect.  The problem happens because
newer values in the enum ast_control_frame_type are not consistent between
the branch versions of Asterisk.

For example:
1) v1.4 calls v1.8 (or later) using IAX2

2) v1.8 answers and sends a connected line update control frame.  (on v1.8
AST_CONTROL_CONNECTED_LINE = 22)

3) v1.4 receives the control frame as an end-of-q (on v1.4
AST_CONTROL_END_OF_Q = 22)

4) v1.4 disconnects the call once the receive queue becomes empty.

Several things are done by this patch to fix the problem and attempt to
prevent it from happening again in the future:

* Added a warning at the definition of enum ast_control_frame_type about
how to add new control frame values.

* Made block sending and receiving control frames that have no reason to
go over the wire.

* Extended the connectedline iax.conf parameter to also include the
redirecting information updates.

* Updated the connectedline iax.conf parameter documentation to include a
notice that the parameter must be "no" when the peer is an Asterisk v1.4
instance.

(closes issue AST-1302)

Review: https://reviewboard.asterisk.org/r/3174/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@407678 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Richard Mudgett
2014-02-07 17:16:42 +00:00
parent 8878f38742
commit 6e6a7f2af0
3 changed files with 171 additions and 22 deletions

View File

@@ -304,6 +304,18 @@ extern struct ast_frame ast_null_frame;
/*! Reserved bit - do not use */
#define AST_FORMAT_RESERVED (1ULL << 63)
/*!
* \brief Internal control frame subtype field values.
*
* \warning
* IAX2 sends these values out over the wire. To prevent future
* incompatibilities, pick the next value in the enum from whatever
* is on the current trunk. If you lose the merge race you need to
* fix the previous branches to match what is on trunk. In addition
* you need to change chan_iax2 to explicitly allow the control
* frame over the wire if it makes sense for the frame to be passed
* to another Asterisk instance.
*/
enum ast_control_frame_type {
AST_CONTROL_HANGUP = 1, /*!< Other end has hungup */
AST_CONTROL_RING = 2, /*!< Local ring */
@@ -335,7 +347,21 @@ enum ast_control_frame_type {
AST_CONTROL_AOC = 28, /*!< Advice of Charge with encoded generic AOC payload */
AST_CONTROL_END_OF_Q = 29, /*!< Indicate that this position was the end of the channel queue for a softhangup. */
AST_CONTROL_INCOMPLETE = 30, /*!< Indication that the extension dialed is incomplete */
AST_CONTROL_UPDATE_RTP_PEER = 31, /*!< Interrupt the bridge and have it update the peer */
AST_CONTROL_UPDATE_RTP_PEER = 32, /*!< Interrupt the bridge and have it update the peer */
/*
* WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
*
* IAX2 sends these values out over the wire. To prevent future
* incompatibilities, pick the next value in the enum from whatever
* is on the current trunk. If you lose the merge race you need to
* fix the previous branches to match what is on trunk. In addition
* you need to change chan_iax2 to explicitly allow the control
* frame over the wire if it makes sense for the frame to be passed
* to another Asterisk instance.
*
* WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
*/
};
enum ast_frame_read_action {