[asterisk-users] [External] Is there a list of Channel ARI requests that are allowed when the call is not handed off to the Stasis application

Dan Cropp dan at amtelco.com
Tue Jan 31 11:59:53 CST 2023


Thank you Joshua!

Retrieving the Application details is a great solution for this.  I completely forgot about that support.

On a reconnect…
Code and start monitoring for StasisStart events for new channel can control.
Also can perform a GET with it’s own Application for the details.
Then, it can use that information for the bridge ids and channel ids that it’s responsible for.


From: asterisk-users <asterisk-users-bounces at lists.digium.com> On Behalf Of Joshua C. Colp
Sent: Monday, January 30, 2023 5:42 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion <asterisk-users at lists.digium.com>
Subject: Re: [External] [asterisk-users] Is there a list of Channel ARI requests that are allowed when the call is not handed off to the Stasis application

On Mon, Jan 30, 2023 at 7:30 PM Dan Cropp <dan at amtelco.com<mailto:dan at amtelco.com>> wrote:
We have used AMI for many years and I’m in the process of migrating to ARI.

My understanding is the call should be handed off to Stasis for the ARI application to control it.

I was playing around with things and discovered the ARI hangup (DELETE /channels/{channelId}) allowed me to hangup calls even when no StasisStart is received.
I tried some other requests and they did not seem to work.  This is what I expected to happen for the hangup.
Are there other commands that are allowed on channels when the call is not in the Stasis app?  (Obviously creating a channel and externalMedia will work because they create new channels).

There's not really a list, some just work due to the internal way they work in Asterisk.


Also, to be fault tolerant, I noticed a call handed off to Stasis app will remain in the Stasis app, even if the ARI/WebSocket connection drops (power outage, etc).  When establishing the ARI/WebSocket connection, the first thing I am planning to do is GET a list of the channels.  This returns all of the channels in the system and not just the channels that are in this Stasis apps control.  I plan to go through the list and identify the channels dialplan data.  Look for app_name of Stasis and the app_data (comma-delimited).
If app_name = “Stasis” and app_data’s first section of the comma-delimited parse portion matches the Stasis app name this instance is used, I take control of this channel.
I am planning this additional check because I noticed the Stasis power outage scenario resulted in channels stuck in the Stasis app.  If I don’t take control of these channels, it’s possible to eventually have hundreds/thousands of channels.  For SIP calls, the other end eventually hangs up.  However, this isn’t the case with Local channels.  Particularly when both ends are locally controlled by Stasis.

Does this sound like I am on the right track for migrating from AMI to Stasis, ARI/Websocket support?

You may be able to get the application details[1][2] which would tell you what the application is subscribed to, which would include the channels.

[1] https://wiki.asterisk.org/wiki/display/AST/Asterisk+20+Applications+REST+API#Asterisk20ApplicationsRESTAPI-get
[2] https://wiki.asterisk.org/wiki/display/AST/Asterisk+20+REST+Data+Models#Asterisk20RESTDataModels-Application

--
Joshua C. Colp
Asterisk Project Lead
Sangoma Technologies
Check us out at www.sangoma.com<http://www.sangoma.com> and www.asterisk.org<http://www.asterisk.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20230131/afdcf223/attachment.html>


More information about the asterisk-users mailing list