[Home]

Summary:ASTERISK-28985: ari: Sends channel event to multiple applications when connecting multiple over same socket
Reporter:Marcelo Garay (mgaray@quantumlogix.com)Labels:
Date Opened:2020-07-09 05:40:08Date Closed:2020-07-09 10:30:22
Priority:MinorRegression?
Status:Closed/CompleteComponents:Resources/res_ari_events
Versions:17.5.1 Frequency of
Occurrence
Constant
Related
Issues:
Environment:Linux (centos 7.8.2003) + External custom applications interacting with Asterisk via ARI. PJSIP, and ARI with Automatic Context Creation (no dialplan).Attachments:( 0) arilog.txt
Description:As described on this forum post: https://community.asterisk.org/t/ari-channel-events-subscription/84865

Expected behavior: When multiple ARI applications subscribe to ARI events using "subscribeAll=false", only the application that originates a channel should receive channel related events (Dial, ChannelDestroyed, etc.).

Observed behavior: ARI generates channel related events for multiple applications, not just the one that originated the channel.


Comments:By: Asterisk Team (asteriskteam) 2020-07-09 05:40:09.080-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. Please note that log messages and other files should not be sent to the Sangoma Asterisk Team unless explicitly asked for. All files should be placed on this issue in a sanitized fashion as needed.

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].

Please note that once your issue enters an open state it has been accepted. As Asterisk is an open source project there is no guarantee or timeframe on when your issue will be looked into. If you need expedient resolution you will need to find and pay a suitable developer. Asking for an update on your issue will not yield any progress on it and will not result in a response. All updates are posted to the issue when they occur.

By: Marcelo Garay (mgaray@quantumlogix.com) 2020-07-09 05:41:08.861-0500

ARI LOG

By: Joshua C. Colp (jcolp) 2020-07-09 06:14:32.291-0500

Please attach an example application that exhibits the problem along with configuration to execute it.

By: Marcelo Garay (mgaray@quantumlogix.com) 2020-07-09 06:53:26.443-0500

I can provide a .NET CORE sample application written in VB.NET. Would that help?

Also, does Sangoma have a test server with an endpoint and ARI configured I can use for the sample?

By: Joshua C. Colp (jcolp) 2020-07-09 06:56:08.641-0500

We do not. It just needs to be an application that can be executed by a developer on Linux which exhibits the problem. This reduces the work the developer has to do, and ensures there is reduced back and forth when the issue is looked into - be it by Sangoma or a community member.

By: Marcelo Garay (mgaray@quantumlogix.com) 2020-07-09 07:31:44.336-0500

All I can do is provide a .NET Core Visual Studio solution can can be compiled and run on Linux, but I'm not sure that would help in this case.

By: Joshua C. Colp (jcolp) 2020-07-09 07:43:14.324-0500

How about specific ARI requests that exhibit the problem? For example I've done the following:

1. I connected a Websocket client to ARI using "ws://127.0.0.1:8088/ari/events?app=CallControl,CallQueueing,CallDialing&subscribeAll=false"
2. I originated a call using "http://127.0.0.1:8088/ari/channels?endpoint=Local/test1@users&app=CallDialing"

The resulting ARI events were all for the CallDialing application and events were not duplicated.

By: Marcelo Garay (mgaray@quantumlogix.com) 2020-07-09 10:10:53.579-0500

OK, found the source of the problem. In my application, I'm subscribing CallControl to receive presence events like this:
https://hostname/ari/applications/CallControl/subscription?eventSource=endpoint:PJSIP/number,deviceState:PJSIP/number
You should be able to test it by including that step as #2 on your example.

If I comment out this part of my code then the events don't duplicate. Am I doing something wrong?




By: Joshua C. Colp (jcolp) 2020-07-09 10:25:28.829-0500

That's expected behavior. By subscribing to an endpoint you are receiving all events related to said endpoint, including for channels created for it.

By: Marcelo Garay (mgaray@quantumlogix.com) 2020-07-09 10:29:23.064-0500

I assumed that would be the channel subscription. I was hoping to get ContactStatusChange from the endpoint. My bad, sorry for wasting your time. I'll try to close this issue now.

By: Marcelo Garay (mgaray@quantumlogix.com) 2020-07-09 10:30:22.564-0500

Sorry, I misunderstood the documentation.