Review Board 1.7.16


SIP 484 handling fix and new Incomplete app control frame

Review Request #1416 - Created Sept. 6, 2011 and submitted

Matt Jordan
1.8
ASTERISK-17288
Reviewers
asterisk-dev
dvossel, rmudgett
Asterisk
ASTERISK-17288 was filed against chan_sip.  When a response code of "484 Address Incomplete" was received by the dialplan, the channel was being hung up with a hangup cause of 111, as opposed to the RFC recommended 28.  Upon resolving this, the previously implemented logic for Incomplete extension dialing was triggered (implemented under ASTERISK-11768).  For SIP phones, this had a somewhat unexpected result: upon receiving the 484 response back from the dialed device, the dialplan would send no information back to the device that dialed the numbers, and, after a period of time, would timeout (transferring to either the 't' or 'i' extension, depending on the dialplan).

While this was the intended effect of the pbx Incomplete logic, it was not desired by the issue reporter.  What's more, for SIP phones, since no information was being forwarded back to the dialing device that the number that they dialed was incomplete, the device did not know to dial more numbers.

After discussion on asterisk-dev with Kevin and the issue reporter, the following decisions were made:
1. app_dial by default should not attempt to place a call into Incomplete - functionality should be triggered by explicit dialplan usage
2. Incomplete application should notify channels that they are in Incomplete status using a control frame. That allows channel tech to automatically hangup if no more digits are possible.

A new control frame AST_CONTROL_INCOMPLETE was added and is sent to the channel in the Incomplete application.  Otherwise, the Incomplete application logic was left unchanged.

Handling the control frame differs on the channel technology.  With respect to SIP, an Incomplete implies immediately sending the 484 Address Incomplete response to the dialing device and performing a soft hangup, as a new INVITE sequence is required.  If the device wants to retry, then the device will resend the URI with whatever appended digits it determines is needed to try for the next extension.

For other channel technologies, it depends on their implementation and their support for overlapped dialing.  DAHDI (and sig_pri) and mISDN have support for overlapped dialing - for those cases, receiving an AST_CONTROL_INCOMPLETE means either doing nothing if overlapped dialing is supported (and if the channel is in a state that it can receive additional digits), or hanging up if overlapped dialing is not supported.  In the case of a hangup, the approach was taken to emulate AST_CONTROL_CONGESTION.

For channels that do not support overlapped dialing, they treat a control frame of AST_CONTROL_INCOMPLETE as if it were AST_CONTROL_CONGESTION.
Two new Asterisk test suites were written to test the behavior for SIP (review on https://reviewboard.asterisk.org/r/1417/ ).  These two tests check that Asterisk handles the SIP 484 Address Incomplete both when the response is returned and the Incomplete application is not used, and when the Incomplete application is used.

Additional testing will be needed for other channel types.  DAHDI will be tested in conjunction with this review; other channels whose support are extended will require testing by the Asterisk community.
Review request changed
Updated (Sept. 8, 2011, 9:12 a.m.)
These changes are correct; the last diff didn't correctly show changes between this and 1.8
Ship it!
Posted (Sept. 8, 2011, 4:11 p.m.)
I don't see anything else to really point out.

https://reviewboard.asterisk.org/ runs on a server provided by Digium, Inc. and uses bandwidth donated to the open source Asterisk community by API Digital Communications in Huntsville, AL USA.
Please report problems with this site to asteriskteam@digium.com.