ARI continuing back to dial plan after stasis complete

Hi Guys from reading and testing i discovered there is/was a bug where if you tried to continue back to your dial plan from stasis, the channel would simply hang up.

https://issues.asterisk.org/jira/browse/ASTERISK-24043

The version of asterisk i have appeared to still have this issue, so i applied the patch and recompiled. The issue didn’t go away so i’m thinking i may be sending the wrong params with the continue command.

I’ve set up a simple dial plan and stasis just for testing with the php ari.

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

----STASIS

$this->phpariObject->channels()->channel_continue($this->stasisChannelID, “test_dial_status”, “n”, 1);

The stasis starts and works fine but when it runs ‘channel_continue’ the channel hangs up where as what i’d want is for it to continue onto running ‘exten => _X.,n,Goto(from-internal,${EXTEN},1)’

You’re telling it to continue at n@test_dial_status, priority 1.

That doesn’t exist in your dialplan. _X. matches on a any digit (0-9), followed by 0 or more characters.

See: https://wiki.asterisk.org/wiki/display/AST/Pattern+Matching

1 Like

Ok so going by the documentation where i have “n” should be an extension. I have tried every possible way i can think of but it still just hangs up. On my stasis output it says it receives a ‘ChannelHangupRequest’. The only way to stop that happening is to remove the continue call.

I have been stuck on this problem for weeks. I’m running asterisk 13.11.2. This issue was addressed and fixed 2 years ago on an as early as 12.6.0. I am really at a point of frustration. I don’t understand why this is happening, i even applied the patch and it still wont work.

What is the actual console output and is it possible that something else in your script is hanging it up too?

Here is the console output that i get

== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
– Executing [2345@test_dial_status:1] NoOp(“SIP/1234-00000006”, “Start stasis”) in new stack
– Executing [2345@test_dial_status:2] Stasis(“SIP/1234-00000006”, “hello-world”) in new stack
> 0xb6504f80 – Probation passed - setting RTP source address to 192.168.10.139:63914
– Executing [_X.@test_dial_status:3] Goto(“SIP/1234-00000006”, “from-internal,_X.,1”) in new stack
– Goto (from-internal,_X.,1)
– Executing [_X.@from-internal:1] ResetCDR(“SIP/1234-00000006”, “”) in new stack
– Executing [_X.@from-internal:2] NoCDR(“SIP/1234-00000006”, “”) in new stack
– Executing [h@from-internal:1] Macro(“SIP/1234-00000006”, “hangupcall”) in new stack
– Executing [s@macro-hangupcall:1] GotoIf(“SIP/1234-00000006”, “1?theend”) in new stack
– Goto (macro-hangupcall,s,3)
– Executing [s@macro-hangupcall:3] ExecIf(“SIP/1234-00000006”, “0?Set(CDR(recordingfile)=)”) in new stack
– Executing [s@macro-hangupcall:4] Hangup(“SIP/1234-00000006”, “”) in new stack
== Spawn extension (macro-hangupcall, s, 4) exited non-zero on ‘SIP/1234-00000006’ in macro ‘hangupcall’
== Spawn extension (from-internal, h, 1) exited non-zero on ‘SIP/1234-00000006’

Are you sure your dialplan is correct? Can you provide it? It appears as though it did indeed work, but the dialplan sent it to a place that ultimately hung up.

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

The dial plan is very basic for testing, but it may be incorrect as this is the first one i’ve setup.

And from-internal? Did you remove the extension or modify the console output? The extension is showing as “_X.”

Console output not modified. I must be doing something wrong with

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

I removed the stasis call and just tried to go to from-internal it still hangs up

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

output

== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
– Executing [2345@test_dial_status:1] NoOp(“SIP/1234-0000000c”, “Start stasis”) in new stack
– Executing [2345@test_dial_status:2] Stasis(“SIP/1234-0000000c”, “hello-world”) in new stack
> 0xb63146f8 – Probation passed - setting RTP source address to 192.168.10.139:63914
– Executing [_X.@test_dial_status:3] Goto(“SIP/1234-0000000c”, “from-internal,_X.,1”) in new stack
– Goto (from-internal,_X.,1)
– Executing [_X.@from-internal:1] ResetCDR(“SIP/1234-0000000c”, “”) in new stack
– Executing [_X.@from-internal:2] NoCDR(“SIP/1234-0000000c”, “”) in new stack
– Executing [h@from-internal:1] Macro(“SIP/1234-0000000c”, “hangupcall”) in new stack
– Executing [s@macro-hangupcall:1] GotoIf(“SIP/1234-0000000c”, “1?theend”) in new stack
– Goto (macro-hangupcall,s,3)
– Executing [s@macro-hangupcall:3] ExecIf(“SIP/1234-0000000c”, “0?Set(CDR(recordingfile)=)”) in new stack
– Executing [s@macro-hangupcall:4] Hangup(“SIP/1234-0000000c”, “”) in new stack
== Spawn extension (macro-hangupcall, s, 4) exited non-zero on ‘SIP/1234-0000000c’ in macro ‘hangupcall’
== Spawn extension (from-internal, h, 1) exited non-zero on ‘SIP/1234-0000000c’

Did you reload the dialplan?

I did using freepbx but i see now in the output it didnt take effect. I will do it again using cli

Sorry going to re edit this, not my day today…

So i reloaded the dial plan as

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

And the call worked. So running stasis is changing something causing the hang up.

Here is the output of when the call works using

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

It keeps coming back to the issue where as soon as a dial plan runs a stasis the channel hangs up on stasis completion.

== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
– Executing [2345@test_dial_status:1] Goto(“SIP/1234-00000004”, “from-internal,2345,1”) in new stack
– Goto (from-internal,2345,1)
– Executing [2345@from-internal:1] Set(“SIP/1234-00000004”, “__RINGTIMER=15”) in new stack
– Executing [2345@from-internal:2] Macro(“SIP/1234-00000004”, “exten-vm,novm,2345,0,0,0”) in new stack
– Executing [s@macro-exten-vm:1] Macro(“SIP/1234-00000004”, “user-callerid,”) in new stack
– Executing [s@macro-user-callerid:1] Set(“SIP/1234-00000004”, “TOUCH_MONITOR=1478820939.4”) in new stack
– Executing [s@macro-user-callerid:2] Set(“SIP/1234-00000004”, “AMPUSER=1234”) in new stack
– Executing [s@macro-user-callerid:3] GotoIf(“SIP/1234-00000004”, “0?report”) in new stack
– Executing [s@macro-user-callerid:4] ExecIf(“SIP/1234-00000004”, “1?Set(REALCALLERIDNUM=1234)”) in new stack
– Executing [s@macro-user-callerid:5] Set(“SIP/1234-00000004”, “AMPUSER=1234”) in new stack
– Executing [s@macro-user-callerid:6] GotoIf(“SIP/1234-00000004”, “0?limit”) in new stack
– Executing [s@macro-user-callerid:7] Set(“SIP/1234-00000004”, “AMPUSERCIDNAME=Test User 1”) in new stack
– Executing [s@macro-user-callerid:8] GotoIf(“SIP/1234-00000004”, “0?report”) in new stack
– Executing [s@macro-user-callerid:9] Set(“SIP/1234-00000004”, “AMPUSERCID=1234”) in new stack
– Executing [s@macro-user-callerid:10] Set(“SIP/1234-00000004”, “__DIAL_OPTIONS=Ttr”) in new stack
– Executing [s@macro-user-callerid:11] Set(“SIP/1234-00000004”, “CALLERID(all)=“Test User 1” <1234>”) in new stack
– Executing [s@macro-user-callerid:12] GotoIf(“SIP/1234-00000004”, “0?limit”) in new stack
– Executing [s@macro-user-callerid:13] ExecIf(“SIP/1234-00000004”, “0?Set(GROUP(concurrency_limit)=1234)”) in new stack
– Executing [s@macro-user-callerid:14] GotoIf(“SIP/1234-00000004”, “0?continue”) in new stack
– Executing [s@macro-user-callerid:15] Set(“SIP/1234-00000004”, “__TTL=64”) in new stack
– Executing [s@macro-user-callerid:16] GotoIf(“SIP/1234-00000004”, “1?continue”) in new stack
– Goto (macro-user-callerid,s,27)
– Executing [s@macro-user-callerid:27] Set(“SIP/1234-00000004”, “CALLERID(number)=1234”) in new stack
– Executing [s@macro-user-callerid:28] Set(“SIP/1234-00000004”, “CALLERID(name)=Test User 1”) in new stack
– Executing [s@macro-user-callerid:29] Set(“SIP/1234-00000004”, “CDR(cnum)=1234”) in new stack
– Executing [s@macro-user-callerid:30] Set(“SIP/1234-00000004”, “CDR(cnam)=Test User 1”) in new stack
– Executing [s@macro-user-callerid:31] Set(“SIP/1234-00000004”, “CHANNEL(language)=en”) in new stack
– Executing [s@macro-exten-vm:2] Set(“SIP/1234-00000004”, “RingGroupMethod=none”) in new stack
– Executing [s@macro-exten-vm:3] Set(“SIP/1234-00000004”, “__EXTTOCALL=2345”) in new stack
– Executing [s@macro-exten-vm:4] Set(“SIP/1234-00000004”, “__PICKUPMARK=2345”) in new stack
– Executing [s@macro-exten-vm:5] Set(“SIP/1234-00000004”, “RT=”) in new stack
– Executing [s@macro-exten-vm:6] Gosub(“SIP/1234-00000004”, “sub-record-check,s,1(exten,2345,dontcare)”) in new stack
– Executing [s@sub-record-check:1] GotoIf(“SIP/1234-00000004”, “0?initialized”) in new stack
– Executing [s@sub-record-check:2] Set(“SIP/1234-00000004”, “__REC_STATUS=INITIALIZED”) in new stack
– Executing [s@sub-record-check:3] Set(“SIP/1234-00000004”, “NOW=1478820940”) in new stack
– Executing [s@sub-record-check:4] Set(“SIP/1234-00000004”, “__DAY=11”) in new stack
– Executing [s@sub-record-check:5] Set(“SIP/1234-00000004”, “__MONTH=11”) in new stack
– Executing [s@sub-record-check:6] Set(“SIP/1234-00000004”, “__YEAR=2016”) in new stack
– Executing [s@sub-record-check:7] Set(“SIP/1234-00000004”, “__TIMESTR=20161111-103540”) in new stack
– Executing [s@sub-record-check:8] Set(“SIP/1234-00000004”, “__FROMEXTEN=1234”) in new stack
– Executing [s@sub-record-check:9] Set(“SIP/1234-00000004”, “__MON_FMT=wav”) in new stack
– Executing [s@sub-record-check:10] NoOp(“SIP/1234-00000004”, “Recordings initialized”) in new stack
– Executing [s@sub-record-check:11] ExecIf(“SIP/1234-00000004”, “0?Set(ARG3=dontcare)”) in new stack
– Executing [s@sub-record-check:12] Set(“SIP/1234-00000004”, “REC_POLICY_MODE_SAVE=”) in new stack
– Executing [s@sub-record-check:13] ExecIf(“SIP/1234-00000004”, “0?Set(REC_STATUS=NO)”) in new stack
– Executing [s@sub-record-check:14] GotoIf(“SIP/1234-00000004”, “5?checkaction”) in new stack
– Goto (sub-record-check,s,17)
– Executing [s@sub-record-check:17] GotoIf(“SIP/1234-00000004”, “1?sub-record-check,exten,1”) in new stack
– Goto (sub-record-check,exten,1)
– Executing [exten@sub-record-check:1] NoOp(“SIP/1234-00000004”, “Exten Recording Check between 1234 and 2345”) in new stack
– Executing [exten@sub-record-check:2] Set(“SIP/1234-00000004”, “CALLTYPE=internal”) in new stack
– Executing [exten@sub-record-check:3] ExecIf(“SIP/1234-00000004”, “0?Set(CALLTYPE=)”) in new stack
– Executing [exten@sub-record-check:4] Set(“SIP/1234-00000004”, “CALLEE=dontcare”) in new stack
– Executing [exten@sub-record-check:5] ExecIf(“SIP/1234-00000004”, “0?Set(CALLEE=dontcare)”) in new stack
– Executing [exten@sub-record-check:6] GotoIf(“SIP/1234-00000004”, “0?callee”) in new stack
– Executing [exten@sub-record-check:7] GotoIf(“SIP/1234-00000004”, “1?caller”) in new stack
– Goto (sub-record-check,exten,13)
– Executing [exten@sub-record-check:13] Set(“SIP/1234-00000004”, “RECMODE=dontcare”) in new stack
– Executing [exten@sub-record-check:14] ExecIf(“SIP/1234-00000004”, “0?Set(RECMODE=dontcare)”) in new stack
– Executing [exten@sub-record-check:15] ExecIf(“SIP/1234-00000004”, “1?Set(RECMODE=dontcare)”) in new stack
– Executing [exten@sub-record-check:16] Gosub(“SIP/1234-00000004”, “recordcheck,1(dontcare,internal,2345)”) in new stack
– Executing [recordcheck@sub-record-check:1] NoOp(“SIP/1234-00000004”, “Starting recording check against dontcare”) in new stack
– Executing [recordcheck@sub-record-check:2] Goto(“SIP/1234-00000004”, “dontcare”) in new stack
– Goto (sub-record-check,recordcheck,3)
– Executing [recordcheck@sub-record-check:3] Return(“SIP/1234-00000004”, “”) in new stack
– Executing [exten@sub-record-check:17] Return(“SIP/1234-00000004”, “”) in new stack
– Executing [s@macro-exten-vm:7] GotoIf(“SIP/1234-00000004”, “1?macrodial”) in new stack
– Goto (macro-exten-vm,s,13)
– Executing [s@macro-exten-vm:13] GosubIf(“SIP/1234-00000004”, “0?clrheader,1()”) in new stack
– Executing [s@macro-exten-vm:14] Macro(“SIP/1234-00000004”, “dial-one,Ttr,2345”) in new stack
– Executing [s@macro-dial-one:1] Set(“SIP/1234-00000004”, “DEXTEN=2345”) in new stack
– Executing [s@macro-dial-one:2] Set(“SIP/1234-00000004”, “DIALSTATUS_CW=”) in new stack
– Executing [s@macro-dial-one:3] GosubIf(“SIP/1234-00000004”, “0?screen,1()”) in new stack
– Executing [s@macro-dial-one:4] GosubIf(“SIP/1234-00000004”, “0?cf,1()”) in new stack
– Executing [s@macro-dial-one:5] GotoIf(“SIP/1234-00000004”, “1?skip1”) in new stack
– Goto (macro-dial-one,s,8)
– Executing [s@macro-dial-one:8] GotoIf(“SIP/1234-00000004”, “0?nodial”) in new stack
– Executing [s@macro-dial-one:9] GotoIf(“SIP/1234-00000004”, “0?continue”) in new stack
– Executing [s@macro-dial-one:10] Set(“SIP/1234-00000004”, “EXTHASCW=ENABLED”) in new stack
– Executing [s@macro-dial-one:11] GotoIf(“SIP/1234-00000004”, “0?next1:cwinusebusy”) in new stack
– Goto (macro-dial-one,s,23)
– Executing [s@macro-dial-one:23] GotoIf(“SIP/1234-00000004”, “0?next3:continue”) in new stack
– Goto (macro-dial-one,s,25)
– Executing [s@macro-dial-one:25] GotoIf(“SIP/1234-00000004”, “0?nodial”) in new stack
– Executing [s@macro-dial-one:26] GosubIf(“SIP/1234-00000004”, “1?dstring,1():dlocal,1()”) in new stack
– Executing [dstring@macro-dial-one:1] Set(“SIP/1234-00000004”, “DSTRING=”) in new stack
– Executing [dstring@macro-dial-one:2] Set(“SIP/1234-00000004”, “DEVICES=2345”) in new stack
– Executing [dstring@macro-dial-one:3] ExecIf(“SIP/1234-00000004”, “0?Return()”) in new stack
– Executing [dstring@macro-dial-one:4] ExecIf(“SIP/1234-00000004”, “0?Set(DEVICES=345)”) in new stack
– Executing [dstring@macro-dial-one:5] Set(“SIP/1234-00000004”, “LOOPCNT=1”) in new stack
– Executing [dstring@macro-dial-one:6] Set(“SIP/1234-00000004”, “ITER=1”) in new stack
– Executing [dstring@macro-dial-one:7] Set(“SIP/1234-00000004”, “THISDIAL=SIP/2345”) in new stack
– Executing [dstring@macro-dial-one:8] GosubIf(“SIP/1234-00000004”, “1?zap2dahdi,1()”) in new stack
– Executing [zap2dahdi@macro-dial-one:1] ExecIf(“SIP/1234-00000004”, “0?Return()”) in new stack
– Executing [zap2dahdi@macro-dial-one:2] Set(“SIP/1234-00000004”, “NEWDIAL=”) in new stack
– Executing [zap2dahdi@macro-dial-one:3] Set(“SIP/1234-00000004”, “LOOPCNT2=1”) in new stack
– Executing [zap2dahdi@macro-dial-one:4] Set(“SIP/1234-00000004”, “ITER2=1”) in new stack
– Executing [zap2dahdi@macro-dial-one:5] Set(“SIP/1234-00000004”, “THISPART2=SIP/2345”) in new stack
– Executing [zap2dahdi@macro-dial-one:6] ExecIf(“SIP/1234-00000004”, “0?Set(THISPART2=DAHDI/2345)”) in new stack
– Executing [zap2dahdi@macro-dial-one:7] Set(“SIP/1234-00000004”, “NEWDIAL=SIP/2345&”) in new stack
– Executing [zap2dahdi@macro-dial-one:8] Set(“SIP/1234-00000004”, “ITER2=2”) in new stack
– Executing [zap2dahdi@macro-dial-one:9] GotoIf(“SIP/1234-00000004”, “0?begin2”) in new stack
– Executing [zap2dahdi@macro-dial-one:10] Set(“SIP/1234-00000004”, “THISDIAL=SIP/2345”) in new stack
– Executing [zap2dahdi@macro-dial-one:11] Return(“SIP/1234-00000004”, “”) in new stack
– Executing [dstring@macro-dial-one:9] GotoIf(“SIP/1234-00000004”, “1?docheck”) in new stack
– Goto (macro-dial-one,dstring,12)
– Executing [dstring@macro-dial-one:12] GotoIf(“SIP/1234-00000004”, “0?skipset”) in new stack
– Executing [dstring@macro-dial-one:13] Set(“SIP/1234-00000004”, “DSTRING=SIP/2345&”) in new stack
– Executing [dstring@macro-dial-one:14] Set(“SIP/1234-00000004”, “ITER=2”) in new stack
– Executing [dstring@macro-dial-one:15] GotoIf(“SIP/1234-00000004”, “0?begin”) in new stack
– Executing [dstring@macro-dial-one:16] ExecIf(“SIP/1234-00000004”, “0?Return()”) in new stack
– Executing [dstring@macro-dial-one:17] Set(“SIP/1234-00000004”, “DSTRING=SIP/2345”) in new stack
– Executing [dstring@macro-dial-one:18] Return(“SIP/1234-00000004”, “”) in new stack
– Executing [s@macro-dial-one:27] GotoIf(“SIP/1234-00000004”, “0?nodial”) in new stack
– Executing [s@macro-dial-one:28] GotoIf(“SIP/1234-00000004”, “0?skiptrace”) in new stack
– Executing [s@macro-dial-one:29] GosubIf(“SIP/1234-00000004”, “1?ctset,1():ctclear,1()”) in new stack
– Executing [ctset@macro-dial-one:1] Set(“SIP/1234-00000004”, “DB(CALLTRACE/2345)=1234”) in new stack
– Executing [ctset@macro-dial-one:2] Return(“SIP/1234-00000004”, “”) in new stack
– Executing [s@macro-dial-one:30] Set(“SIP/1234-00000004”, “D_OPTIONS=Ttr”) in new stack
– Executing [s@macro-dial-one:31] NoOp(“SIP/1234-00000004”, "Blind Transfer: , Attended Transfer: , User: 1234, Alert Info: ") in new stack
– Executing [s@macro-dial-one:32] ExecIf(“SIP/1234-00000004”, “1?Set(ALERT_INFO=)”) in new stack
– Executing [s@macro-dial-one:33] ExecIf(“SIP/1234-00000004”, “0?Set(ALERT_INFO=)”) in new stack
– Executing [s@macro-dial-one:34] ExecIf(“SIP/1234-00000004”, “0?Set(ALERT_INFO=)”) in new stack
– Executing [s@macro-dial-one:35] GosubIf(“SIP/1234-00000004”, “0?func-set-sipheader,s,1(Alert-Info,)”) in new stack
– Executing [s@macro-dial-one:36] ExecIf(“SIP/1234-00000004”, “0?Set(CHANNEL(musicclass)=)”) in new stack
– Executing [s@macro-dial-one:37] GosubIf(“SIP/1234-00000004”, “0?qwait,1()”) in new stack
– Executing [s@macro-dial-one:38] Set(“SIP/1234-00000004”, “__CWIGNORE=”) in new stack
– Executing [s@macro-dial-one:39] Set(“SIP/1234-00000004”, “__KEEPCID=TRUE”) in new stack
– Executing [s@macro-dial-one:40] GotoIf(“SIP/1234-00000004”, “0?usegoto,1”) in new stack
– Executing [s@macro-dial-one:41] GotoIf(“SIP/1234-00000004”, “0?godial”) in new stack
– Executing [s@macro-dial-one:42] Gosub(“SIP/1234-00000004”, “sub-presencestate-display,s,1(2345)”) in new stack
– Executing [s@sub-presencestate-display:1] Goto(“SIP/1234-00000004”, “state-not_set,1”) in new stack
– Goto (sub-presencestate-display,state-not_set,1)
– Executing [state-not_set@sub-presencestate-display:1] Set(“SIP/1234-00000004”, “PRESENCESTATE_DISPLAY=”) in new stack
– Executing [state-not_set@sub-presencestate-display:2] Return(“SIP/1234-00000004”, “”) in new stack
– Executing [s@macro-dial-one:43] Set(“SIP/1234-00000004”, “CONNECTEDLINE(name,i)=Test User 2”) in new stack
– Executing [s@macro-dial-one:44] Set(“SIP/1234-00000004”, “CONNECTEDLINE(num)=2345”) in new stack
– Executing [s@macro-dial-one:45] Set(“SIP/1234-00000004”, “D_OPTIONS=TtrI”) in new stack
– Executing [s@macro-dial-one:46] Macro(“SIP/1234-00000004”, “dialout-one-predial-hook,”) in new stack
– Executing [s@macro-dialout-one-predial-hook:1] MacroExit(“SIP/1234-00000004”, “”) in new stack
– Executing [s@macro-dial-one:47] Dial(“SIP/1234-00000004”, “SIP/2345,TtrIb(func-apply-sipheaders^s^1)”) in new stack
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
– SIP/2345-00000005 Internal Gosub(func-apply-sipheaders,s,1) start
– Executing [s@func-apply-sipheaders:1] NoOp(“SIP/2345-00000005”, “Applying SIP Headers to channel”) in new stack
– Executing [s@func-apply-sipheaders:2] Set(“SIP/2345-00000005”, “SIPHEADERKEYS=”) in new stack
– Executing [s@func-apply-sipheaders:3] While(“SIP/2345-00000005”, “0”) in new stack
– Jumping to priority 7
– Executing [s@func-apply-sipheaders:8] Return(“SIP/2345-00000005”, “”) in new stack
== Spawn extension (from-internal, 2345, 1) exited non-zero on ‘SIP/2345-00000005’
– SIP/2345-00000005 Internal Gosub(func-apply-sipheaders,s,1) complete GOSUB_RETVAL=
– Called SIP/2345
– Connected line update to SIP/1234-00000004 prevented.
– SIP/2345-00000005 is ringing

Maybe its something in my stasis code?
This is whats run when stasis starts. channel_continue must still not be incorrect. I thought that i am supposed to put _X. as the extension so that it matches the pattern match in the dial plan?

        //A channel has entered the Stasis application.
        $this->stasisEvents->on('StasisStart', function ($event) {
            $this->stasisLogger->notice("Event received: StasisStart");
            $this->stasisChannelID = $event->channel->id;
            $this->phpariObject->channels()->channel_answer($this->stasisChannelID);
	$this->phpariObject->channels()->channel_continue($this->stasisChannelID,"test_dial_status", "_X.", 1);
        });

I am using the php ari but internally its just sending a continue post request to the Ari. This is straight from the Ari documentation on how to use continue.

POST /channels/{channelId}/continue
  Exit application; continue execution in the dialplan.
Path parameters
  channelId: string - Channel's id
Query parameters
  context: string - The context to continue to.
  extension: string - The extension to continue to.
  priority: int - The priority to continue to.
Error Responses
  404 - Channel not found
  409 - Channel not in a Stasis application

"_X" is not a valid extension, nor is it the same as your test Goto statement, which used the channel variable ${EXTEN}. Your ARI code is telling Asterisk to try and match an extension that begins with the literal characters “_X”, as opposed to an extension that begins with a digit and matches 0 or more additional characters. As I said in my initial reply, that’s not going to match your dialplan.

You need to jump to an actual, valid extension. Given your dialplan, that’s going to be a number, like 5000.

1 Like

Sorry for leaving this post for so long. I had to work on other projects and i was wasting to much time on this.

So ideally i would pass ${EXTEN}? I cant find any info on whether channel variables can be accessed in a stasis app. Either way this didn’t work so i just tried hard coding the extension number and it still wont work. My test system only has two extensions 1234 and 2345. It really should just work.

This is the best sample i can find which is what i based my stasis code from.

http://www.phpari.org/documentation/basic-stasis-application-template/

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);

Calling from ext 1234 to ext 2345

$this->phpariObject->channels()->channel_continue($this->stasisChannelID, “from-internal”, 2345, 1);

Causes this.

  == Using SIP RTP TOS bits 184
  == Using SIP RTP CoS mark 5
    -- Executing [2345@test_dial_status:1] NoOp("SIP/1234-0000002d", "Start stasis") in new stack
    -- Executing [2345@test_dial_status:2] Stasis("SIP/1234-0000002d", "hello-world") in new stack
       > 0xb63019f8 -- Probation passed - setting RTP source address to 192.168.10.139:58110
[2017-01-05 15:25:03] WARNING[7712][C-0000002b]: pbx.c:4365 __ast_pbx_run: Channel 'SIP/1234-0000002d' sent to invalid extension but no invalid handler: context,exten,priority=from-internal,s,1
    -- Executing [h@from-internal:1] Macro("SIP/1234-0000002d", "hangupcall") in new stack
    -- Executing [s@macro-hangupcall:1] GotoIf("SIP/1234-0000002d", "1?theend") in new stack
    -- Goto (macro-hangupcall,s,3)
    -- Executing [s@macro-hangupcall:3] ExecIf("SIP/1234-0000002d", "0?Set(CDR(recordingfile)=)") in new stack
    -- Executing [s@macro-hangupcall:4] Hangup("SIP/1234-0000002d", "") in new stack
  == Spawn extension (macro-hangupcall, s, 4) exited non-zero on 'SIP/1234-0000002d' in macro 'hangupcall'
  == Spawn extension (from-internal, h, 1) exited non-zero on 'SIP/1234-0000002d'

This looks like where its failing.

WARNING[7712][C-0000002b]: pbx.c:4365 __ast_pbx_run: Channel ‘SIP/1234-0000002d’ sent to invalid extension but no invalid handler: context,exten,priority=from-internal,s,1