Review Board 1.7.16


Asterisk: stasis: set a channel variable on websocket disconnect error

Review Request #4519 - Created March 22, 2015 and submitted

Ashley Sanders
branches/13
ASTERISK-24802
Reviewers
asterisk-dev
Asterisk
When an error occurs while writing to a web socket, the web socket is disconnected and the event is logged. A side-effect of this, however, is that any application on the other side waiting for a response from Stasis is left hanging indefinitely (as there is no mechanism presently available for notifying interested parties about web socket error states in Stasis).

To remedy this scenario, this patch introduces a new channel variable: STASISSTATUS.

The possible values for STASISSTATUS are:
SUCCESS         - The channel has exited Stasis without any failures
FAILED          - Something caused Stasis to croak. Some (not all) possible reasons for this: 
                    - The app registry is not instantiated; 
                    - The app requested is not registered; 
                    - The app requested is not active; 
                    - Stasis couldn't send a start message

 ***Note*** This is just the patch to the Asterisk source. The testsuite review is coming soon to a reviewboard near you (well, this reviewboard.)

And, here it is! https://reviewboard.asterisk.org/r/4520
The testing done for this issue can be found at: https://reviewboard.asterisk.org/r/4520/

The test in Testsuite exercises three scenarios to elicit updates to the STASISSTATUS channel variable:
1) The 'Babs' scenario: tests the situation where a channel is originated under normal conditions and then the channel is hungup. For this case, the test verifies that Stasis 
   correctly assigns SUCCESS to STASISSTATUS.
2) The 'Bugs' scenario: tests the situation where a call is originated requesting an app that was never registered in Stasis to verify the 'FAILED' state is correctly applied.
3) The 'Buster' scenario: tests the situation where an app that was registered in Stasis when call A was originated (and while call A is still active) but is no longer 
   registered when call B is originated. Determines if the 'FAILED' state is correctly applied.
Review request changed
Updated (March 31, 2015, 6:23 p.m.)
  • changed from pending to submitted
Committed in revision 433861

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.