"message": "Channel not in Stasis application"

Hi,
I am working on ARI API in trying to test the API in postman , but the this message occur “message”: “Channel not in Stasis application”.
My Code are given below

ari.cong
[general]
enabled = yes
pretty = yes
[asterisk]
type = user
read_only = no
password = asterisk
password_format = plain

http.conf
[general]
servername=asterisk
enabled = yes
bindaddr=asterisk mechine ip address (192.168.x.x)
;I also try below line
;bindaddr=0.0.0.0
bindport=8088

extension.conf
[from-sip-trunk]
exten => _X.,1,NoOp()
exten => _X.,n,Answer()
exten => _X.,n,Stasis(hello-world)
exten => _X.,n,Dial(PJSIP/6001,60,rtT)
exten => _X.,n,Hangup()

[test]
exten => _X.,1,Dial(PJSIP/8301111/${EXTEN},tT)
exten => _X.,n,Hangup()

and i am trying following api in postman
http://192.168.x.x:8088/ari/channels/1600000000.43/hold?api_key=asterisk:asterisk&app=hello-world

The message means what it says, you can only put a channel on hold that is in your ARI application. If you can’t do that - then it’s not in the ARI application.

so then what is ARI application?, I can’t understand what are Stasts applications and how they work. I just try how I can hold the call through ARI API. but really I don’t know what is hello-world, where it is exist .

“hello-world” is something that is written and running outside of Asterisk, but connected to it. This wiki page[1] gives background on ARI and what it is intended for.

[1] Asterisk REST Interface (ARI) - Asterisk Project - Asterisk Project Wiki

but I did not write any application name as hello-world. There are any sample applications are available in stasts and where the path(directory) of stasts application in asterisk ?,

We don’t include any examples, it’s up to you to write one in your language to do what you want using the primitives available. There is no default path for such things because it’s up to you to run the application, and place it where you want.

Sir I am following this article Getting Started with ARI - Asterisk Project - Asterisk Project Wiki
and on this article there is no hello-world application are written explicitly in any particular language . Please Help

That page uses “wscat” to connect to Asterisk as the “hello-world” application so it can receive events.

there is any other way to connect with asterisk?

what i can do according to my first message description

That’s a very vague and broad question. You should probably describe what you are attempting to do in the first place.

This is put in slightly more words in How To Ask Questions The Smart Way

At the moment you seem to be insisting on using ARI without really having an understanding of what it does. ARI may be the wrong solution (even Asterisk may be the wrong solution). You need to explain the real world objective, not the coding technique you think might achieve it.

What I Want:

  1. I dial a number 8301111 and IVR run and call land on 6001 Agent => Done Successfully
  2. now I want to perform action (play, hold, moh, record etc) on that call by using API.
    I have Done Successfully : send message from API to agent 6001 by using ARI API http://192.168.x.x:8088/ari/endpoints/PJSIP/6001/sendMessage?api_key=asterisk:asterisk&to=PJSIP&from=PJSIP&body=hi

That is not the overall goal, unless this is a student exercise. Using ARI should never be appearing in the real world requirement, as it an implementation detail.

End Goal is not just hold the call through API , but now it is phase of testing the ARI API in asterisk and postman . we are working on project

Ignoring all the implementation detail constraints, you are applying to the requirement, and trying to guess one stage back towards the real requirement, I’d suggest looking into the m option in Dial. (With your current solution, I’m not convinced the channel would ever get an AST_CONTROL_UNHOLD.)

Also you need to be more clear about what you mean by hold. The default meaning of hold in Asterisk is Re-INVITE medial back in, in if necessary, then play music on hold as sendrecv media. I think chan_pjsip has some options to vary this.

The real requirement includes why you need to put on hold.

As to the specific APIs, you should be asking the person who specified their use. They really ought to have some understanding of how they are used before they specify them, in order to know whether it is appropriate to specify them.

i am trying to do something like this

  1. I dial a number 8301111 and IVR run and call land on 6001 Agent that was Done Successfully
  2. now I want to perform action (play, hold, moh, record etc) on that call that is basically between 8301111 and 6001 by using API.
    But
    I have Done Successfully : send message to agent 6001 by using ARI API http://192.168.x.x:8088/ari/endpoints/PJSIP/6001/sendMessage?api_key=asterisk:asterisk&to=PJSIP&from=PJSIP&body=hi

You appear to want third party control, which is something that would indicate the use of AMI.

When the company I worked for did something like this, they used parking to achieve the hold, and had a priority queue for getting the caller back to the agent. ARI didn’t exist at that time. With hindsight, I might have redirected the call to an application playing music on hold.

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