ARI continuing back to dial plan after stasis complete

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:

  1. All of the ARI commands are documented here: Home - Asterisk Documentation

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

  3. There is in depth documentation on ARI (Home - Asterisk Documentation) and channel manipulation (Home - Asterisk Documentation) on the wiki as well.

  4. There are examples of manipulating channels on GitHub: GitHub - asterisk/ari-examples: ARI examples in Python and JavaScript.

  5. 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:

  1. Your dialplan is wrong, and you are attempting to send the channel to a context/extension/priority that doesn’t exist.

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

Thanks. There’s some examples there i hadn’t yet found and will be useful when move on into the project.

This is the dial plan i have.

[test_dial_status]
exten => _X.,1,NoOp(Start stasis)
exten => _X.,n,Stasis(hello-world)
exten => _X.,n,Goto(from-internal,${EXTEN},1)

.

Is 2345@from-internal a valid extension?

I think it should be as dial plan below works and 1234 and 2345 can call each other. But perhaps not, actually i hope not as that would tell me the problem and i can finally move on with my life…

[test_dial_status]
exten => _X.,1,Goto(from-internal,${EXTEN},1)

.

$this->phpariObject->channels()->channel_continue($this->stasisChannelID, “demo”, “s”, 1);

I think where i get confused with this is i thought a literal extension number needs to be passed. As you said when i was trying it with “_X” it would look for an extension starting with _X. I’m guessing “s” must have a special meaning and isn’t treated the same way.

This looked promising but there only appears to be a channel_originate file which calls the ‘channels’ command on the ari. Is there somewhere where there’s a working example of using ‘continue’ along with its dial plan?

Still no luck. If there is a working example out there i’d love to find it. Every which way i try it still wont return back to the dial plan.

Am i to assume that no one on here has used this and got it working?

I know a few people here who are using it, just not with PHP. I’ve also used it in the past. The test mentioned does do a continue (it’s in the test-config.yaml file) so I’m uncertain of what you meant by your comment about it.

What is your CURRENT dialplan, code, and console output?

The last data you provided had you doing a continue to demo - but you didn’t mention if the demo dialplan was still there or what the console looked like.