Working with Asterisk ARI

I thought I would start a clean thread as struggling to get this working

I have two extensions registered to two different phones.

1001 on one phone
1004 on the other phone

They can dial between each other.

I want calls to log in stasis ARI.

On both extensions, I change the context to from-internal-test

In extensions_custom.conf I enter the below dial plan:
[from-internal-test]
exten => _1XXX,1,NoOp()
same => n,Answer()
same => n,Stasis(hello-world)
same => n,Hangup()

So, I have node.js and wscat installed and connected using an ARI and logging into the wscat command prompt as below (when I dial from 1001 to 1004):

My problem now is that when I dial 1004, the phone displays ā€œtalkingā€ and it doesnt actually dial 1004ā€¦

In the logs, I see the call does not even get to 1004:

I want 1004 to ring when dialled from 1001 AND also log into the stasis ARI. At this minute I cannot get both to work.

I change the extension context back to from-internal and it rings but events do not fire into the ARI.
I change it to from-internal-test and I cannot get the other phone (1004) to dial. Really struggling with this and any help would be appreciated.

Thanks in advance and sorry for the repost.

Maybe you want a dialplan hook: Hooking for fun and income

In theory should the below work?

[from-internal-custom]
exten => _XXXX,1,NoOp()
same => n,Answer()
same => n,Stasis(hello-world)
same => n,Hangup()
exten => s,n,MacroExit

From my understanding, it would pass the call to the stasis application hello-world, and then continue the dial plan and dial.

Still when dialling extenion 1004 it says ā€œtalkingā€ on the phone and asterisk logs below:

What does your Stasis application do? If youā€™re just connecting wscat then it would be behaving as expected. ARI gives you a ā€œStasisStartā€ event and then itā€™s up to you to do the rest. It doesnā€™t automatically dial anything, or connect them together, or any of that. Itā€™s up to you to use ARI to do that.

But according to https://wiki.asterisk.org/wiki/display/AST/Getting+Started+with+ARI, I should add the custom config for any extension to fire the details to stasisā€¦ and it does not

I can either get calls working between the two or information being fired to my wscat command but not both

According to your first image a call was directed into Stasis as expected. Nothing else happened because you donā€™t have an ARI application that does anything with the call.

What exactly are you trying to accomplish through the use of ARI?

So I want the details to pass into the stasis application and also pass the call to the extension i dialled.

e.g.
ext 1001 rings ext 1004
the call is passed into the stasis application and displays the details
AND actually rings 1004.

What I am trying to accomplish) ā€“

The application, make phone calls (Inbound and Outbound) using CTI functionality.

Inbound : if there is any inbound call, popups the customer related information based on the incoming phone number, in the Client application.

Outbound : When TSO (telesales operator), clicks on call option in Client, CTI application will place call to the customer.

So in order for me to achieve this, I need logs in stasis but also need my phone to ring.

Hope this is clear?

Then you have to write an ARI application to do such things. ARI will not automatically know what you want to do and do it. You have to use the defined API and the primitives to write an application.

It is not doing what you want because you havenā€™t written the logic to do such a thing.

1 Like

Okay, thank you :frowning: sorry it took so long

I thought it would need to put in my dial plan not into the ARI application which is what was confusing me.

So now I need to get my developer to write something to tell it to dial the handset.

He just wants his application to be told of the call right? Not actually answer it and sutff. Canā€™t he just send the call back to from-internal

something like this?

[from-internal-custom]
exten => _XXXX,1,NoOp(Entering [from-internal-custom] to log call in Stasis)
exten => s,n,Stasis(hello-world)
exten => s,n,Goto(from-internal,${EXTEN},1)
1 Like

The Stasis application still has to do work to send it to continue in the dialplan, along with anything else it should do. Specifically defining how things will precisely work and what is required is needed for something like this, before deciding what the implementation itself will look like.

1 Like

Hi,

Inbound I just want the application to be told of the call, so I will give your context a go and see if it works - thanks

Outbound, the idea is to get the CRM to dial using the ARI I have provided the developers - this I guess will be the tricky but, but less ā€˜FreePBXā€™ work and more getting the ARI to work with the PBXā€¦

I will test the inbound theory and see if it follows onto the endpoint after hitting stasisā€¦

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