ARI Asterisk

Good morning everyone!

I am developing a project using ARI that wants to create channels (without depending on endpoints) and add to bridges.
The idea is to simulate calls without using softphones (or paying for services).
I’m using Asterisk 16.x on CentOS 7.9 using Websocks, using ARI-Client on NodeJS.
I’m having these two problems when I try to pass channels created for bridges:
“error”: “Allocation failed” or “message”: “Channel in invalid state”
depending on the trial and script I’m using.
Create these channels regardless of endpoints and move to bridges, would it be possible?

Create a channel to where? A channel has to dial something, and an endpoint is required to be defined when dialing. A channel also has to be in an ARI application to be able to add them to a bridge.

What I’m trying to do is simulate calls in large quantities, without using softphones, so that to use many endpoints you have to pay.
So, I have a script that creates channels, but the states of those channels are always down. What I want is to pass these created channels to a bridge, where I can use a playback application or something similar to pass media on that bridge between these created channels, without needing softphones for that.

You can’t use PJSIP channels for that without dialing them and having them go to a target that answers. You could use a Local channel that goes into the dialplan and answers and Echoes, Playbacks, or just Waits.

Ultimately ARI isn’t a call signaling protocol in the way you’re trying to use it.

Using the Originate or Create + Dial function that we have in the Ari-Client library, is it possible to create these channels, dialed for them, without using a sotphone, just seeing the call being answered and processed in Asterisk’s prorpia CLI?

Not for SIP, no. A SIP call has to go somewhere. A Local channel can do as I mentioned. If it has to be SIP then you could loop it back into Asterisk, effectively doing what a Local channel is doing. Using SIPp[1] is what many people do if they want to do SIP testing too.

[1] http://sipp.sourceforge.net/

So using ARI (Nodejs library) can I create Local Channels and add them to bridges, simulating a call?
Does SIPp use Asterisk to perform these call simulations? Can I generate calls with SIPp and pass those calls through Asterisk, as if I were stressing an asterisk server?

You can create and dial Local channels and add them to bridges. One side of the Local channel would be in ARI, the other would go wherever you direct it to go in the dialplan. Your dialplan logic determines what it does.

SIPp is unrelated to Asterisk and doesn’t use it at all. It speaks SIP and simulates SIP scenarios, such as a call being placed. It is used by people to stress things (such as Asterisk) over SIP, or to reproduce issues and other things.

When I create Local Channels using the ari-client’s create.channel function, I get the image below.
So using create.bridge I could add these two channels created and run an application to simulate a call?

You need to dial it as well, or instead don’t use create and merely originate. Once answered the channel then goes into the ARI application in that case. What exactly extension 1001 in context default does also plays a part.

You can’t add both channels to the bridge unless both channels are in your ARI application. You get 1 Local channel in the bridge if you’ve told it to do so when originating or creating. The other is directed into the dialplan which could then go into the ARI application.

I think the problem is that you’re seeing “create” in the ARI interface and misunderstanding what that means. It means prepare to dial something. You ultimately need to dial it.

Could you point me to some material on how to handle Local / Channel in Dialplan? or Material in general about Local channels.

I don’t really have any material handy, but it dials in the dialplan. What you do in the dialplan is up to you, and is the foundation of call routing and usage in Asterisk.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.