Is There A List Of Channel ARI Requests That Are Allowed When The Call Is Not Handed Off To The Stasis Application

Home » Asterisk Users » Is There A List Of Channel ARI Requests That Are Allowed When The Call Is Not Handed Off To The Stasis Application
Asterisk Users 2 Comments

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

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?

Dan

2 thoughts on - Is There A List Of Channel ARI Requests That Are Allowed When The Call Is Not Handed Off To The Stasis Application

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

    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

  • VGhhbmsgeW91IEpvc2h1YSENCg0KUmV0cmlldmluZyB0aGUgQXBwbGljYXRpb24gZGV0YWlscyBp cy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