The way continue is used there doesn’t make sense given what i’ve been told here.
Line 117
$this->phpariObject->channels()->channel_continue($this->stasisChannelID, “demo”, “s”, 1);
Yes, this does make sense. The channel is being sent to context demo
, extension s
, priority 1
. So long as that exists in extensions.conf
, the channel will execute. If that doesn’t exist, the channel will have been sent to an invalid extension, and normal dialplan logic will trigger (such as trying to find the invalid extension handler, hanging up the channel, etc.)
$this->phpariObject->channels()->channel_continue($this->stasisChannelID, “from-internal”, 2345, 1);
Causes this.
Is 2345@from-internal
a valid extension?
To answer some of your other questions:
-
All of the ARI commands are documented here: Home - Asterisk Documentation
-
The command to get channel variables - aptly named
getChannelVar
- is here: Home - Asterisk Documentation
This, much like every other channel variable accessor API in Asterisk, allows you to get both channel variables (such as${EXTEN}
) as well as the return of dialplan functions. -
There is in depth documentation on ARI (Home - Asterisk Documentation) and channel manipulation (Home - Asterisk Documentation) on the wiki as well.
-
There are examples of manipulating channels on GitHub: GitHub - asterisk/ari-examples: ARI examples in Python and JavaScript.
-
And, finally, there is an automated test that covers the functionality that you’re attempting to perform (
originate_and_continue
): http://git.asterisk.org/gitweb/?p=asterisk/testsuite.git;a=tree;f=tests/rest_api/channels/originate_then_continue;h=800691ceef9dee88c2e4f2e86c9b78e92f2bd080;hb=HEAD
In the end, you are going to have one of the following problems:
-
Your dialplan is wrong, and you are attempting to send the channel to a context/extension/priority that doesn’t exist.
-
Your invocation of the
continue
command is wrong, and you’re passing it incorrect data.
Without your full dialplan and code, however, it’s hard to say which of the two is the problem.