[Home]

Summary:ASTERISK-26468: ari: Bridge events stop working after this sequence of ARI calls
Reporter:Daniele Pallastrelli (Daniele77)Labels:ARI stasis
Date Opened:2016-10-14 07:53:29Date Closed:2016-11-07 13:08:50.000-0600
Priority:MajorRegression?
Status:Closed/CompleteComponents:Core/Stasis Resources/res_ari_bridges
Versions:13.10.0 14.0.2 Frequency of
Occurrence
Constant
Related
Issues:
Environment:Debian 8.5 3.16.0-4-686-pae gcc (Debian 4.9.2-10) 4.9.2 Attachments:( 0) ASTERISK-26468.diff
( 1) debug_log_26468.txt
Description:h4. Frequency
Systematic issue.

h4. Symptoms
Bridge events stop flowing from ARI websocket after a precise sequence of ARI requests occours.

h4. Steps required to reproduce the issue

{code}
wscat -c "ws://localhost:8088/ari/events?api_key=asterisk:asterisk&app=attendant&subscribeAll=true"

curl -v -u asterisk:asterisk -X POST "http://localhost:8088/ari/applications/attendant/subscription?eventSource=channel:,endpoint:,bridge:,deviceState:"

curl -v -u asterisk:asterisk -X POST "http://localhost:8088/ari/bridges"
curl -v -u asterisk:asterisk -X POST "http://localhost:8088/ari/channels?endpoint=SIP/101&app=attendant"
curl -v -u asterisk:asterisk -X POST "http://localhost:8088/ari/bridges/b1ecceb5-0432-40e6-b8c4-04dda2246cd5/addChannel?channel=atom_asterisk-1476777778.0"

curl -v -u asterisk:asterisk -X POST "http://localhost:8088/ari/channels?endpoint=SIP/290&app=attendant"
curl -v -u asterisk:asterisk -X POST "http://localhost:8088/ari/bridges/b1ecceb5-0432-40e6-b8c4-04dda2246cd5/addChannel?channel=atom_asterisk-1476777808.1"

curl -v -u asterisk:asterisk -X DELETE "http://localhost:8088/ari/channels/atom_asterisk-1476777778.0"
curl -v -u asterisk:asterisk -X DELETE "http://localhost:8088/ari/channels/atom_asterisk-1476777808.1"
curl -v -u asterisk:asterisk -X DELETE "http://localhost:8088/ari/bridges/b1ecceb5-0432-40e6-b8c4-04dda2246cd5"

curl -v -u asterisk:asterisk -X POST "http://localhost:8088/ari/bridges"
{code}

h4. Expected Behaviour
After the last POST (creating a new bridge), I should receive a "BridgeCreated" event on the websocket (according to https://wiki.asterisk.org/wiki/display/AST/Asterisk+14+REST+Data+Models#Asterisk14RESTDataModels-BridgeCreated)

h4. Behaviour actually encountered
After the last POST (creating a new bridge), I don't receive the event "BridgeCreated" on the websocket and, in general, I don't receive bridge events anymore.
The last bridge event I get is the "BridgeDestroyed" corresponding to the last DELETE http request.
(logs attached)
Comments:By: Asterisk Team (asteriskteam) 2016-10-14 07:53:30.602-0500

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

By: Joshua C. Colp (jcolp) 2016-10-17 09:02:04.294-0500

Thank you for taking the time to report this bug and helping to make Asterisk better. Unfortunately, we cannot work on this bug because your description did not include enough information. Please read over the Asterisk Issue Guidelines [1] which discusses the information necessary for your issue to be resolved and the format that information needs to be in. We would be grateful if you would then provide a more complete description of the problem. At a minimum, we need:

1. The specific steps or actions you took that caused you to encounter the problem.
2. The behavior you expected and the location of documentation that led you to that expectation.
3. The behavior you actually encountered.

To demonstrate the issue in detail, please include Asterisk log files generated per the instructions on the wiki [2]. If applicable, please ensure that protocol-level trace debugging is enabled, e.g., 'sip set debug on' if the issue involves chan_sip, and configuration information such as dialplan and channel configuration.

Thanks!

[1] https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines

[2] https://wiki.asterisk.org/wiki/display/AST/Collecting+Debug+Information

In this case the logs would be extremely useful for initial analysis.

By: Daniele Pallastrelli (Daniele77) 2016-10-18 03:20:25.291-0500

Log file of the issue

By: Joshua C. Colp (jcolp) 2016-11-03 16:12:33.303-0500

This is a patch which should resolve this problem. Can you apply it and see if it resolves it for your cases?

By: Daniele Pallastrelli (Daniele77) 2016-11-04 06:10:34.921-0500

With the patch asterisk crashes after I add a channel to the bridge.
But honestly... the patch just adds logs and one abort: how could it possibly solve the problem? :-)

Anyway: asterisk aborts (because of the "abort()" added from the patch) when I add a channel to the bridge using the http POST.

By: Joshua C. Colp (jcolp) 2016-11-04 09:21:40.904-0500

Whoops, I did a diff not a show.

By: Joshua C. Colp (jcolp) 2016-11-04 09:22:11.611-0500

Correct patch!

By: Daniele Pallastrelli (Daniele77) 2016-11-04 09:38:24.746-0500

I confirm that the new patch solve the issue. Thanks.
Do you plan to add the fix to the git repo?

By: Joshua C. Colp (jcolp) 2016-11-04 09:42:10.168-0500

Yes, it will be going up for code review.

By: Friendly Automation (friendly-automation) 2016-11-07 13:08:53.696-0600

Change 4337 merged by zuul:
rest_api/applications/subscribe-all-bridge: Add test for bridges.

[https://gerrit.asterisk.org/4337|https://gerrit.asterisk.org/4337]

By: Friendly Automation (friendly-automation) 2016-11-07 19:48:49.923-0600

Change 4334 merged by Joshua Colp:
res_stasis: Don't unsubscribe from a NULL bridge.

[https://gerrit.asterisk.org/4334|https://gerrit.asterisk.org/4334]

By: Friendly Automation (friendly-automation) 2016-11-08 04:59:50.028-0600

Change 4336 merged by Joshua Colp:
res_stasis: Don't unsubscribe from a NULL bridge.

[https://gerrit.asterisk.org/4336|https://gerrit.asterisk.org/4336]

By: Friendly Automation (friendly-automation) 2016-11-08 05:00:32.898-0600

Change 4335 merged by Joshua Colp:
res_stasis: Don't unsubscribe from a NULL bridge.

[https://gerrit.asterisk.org/4335|https://gerrit.asterisk.org/4335]