Is It Possible To Use Stasis To Control Both Legs Of A Local Channel Created Using ARI?

Home » Asterisk Users » Is It Possible To Use Stasis To Control Both Legs Of A Local Channel Created Using ARI?
Asterisk Users 2 Comments

I understand how to control the first local channel, but an having trouble getting the second local channel to enter stasis.

I setup have the following extensions.conf to handle 1000 (basically had it setup so if first stasis not there try second, but believe second channel never processes the dial plan so even if second line was hello-world2 it would not matter.

[mycontext]
exten => 1000,1,NoOp()
same => n,Stasis(hello-world)
same => n,GotoIf($[${STASISSTATUS}=FAILED]?IS_hello_world2:stasis_done)
same => n(IS_hello_world2),Stasis(hello-world2)
same => n(stasis_done),Hangup()
For testing, I am using curl

curl -v -u asterisk:asterisk -X POST http://asterisk:asterisk@localhost:8088/ari/channels/create?endpoint=local/1000@mycontext &app=hello-world2&context=mycontext&channelId=mycallerid.1&otherChannelId=mycallerid.2&formats=ulaw

I see the primary call on my hello-world2 stasis, but I never see anything for the second leg of the local channel. I have an AMI connection and see both channels there, but the send local channel seems to not process the dial plan. Can someone tell me if this is possible and if so what am I doing wrong?

Here is the AMI for the two local channel Event: Newchannel Privilege: call,all Channel: Local/1000@mycontext-0000000b;1
ChannelState: 0
ChannelStateDesc: Down CallerIDNum:
CallerIDName:
ConnectedLineNum:
ConnectedLineName:
Language: en AccountCode:
Context: mycontext Exten: 1000
Priority: 1
Uniqueid: mycallerid.1
Linkedid: mycallerid.1

Event: Newchannel Privilege: call,all Channel: Local/1000@mycontext-0000000b;2
ChannelState: 4
ChannelStateDesc: Ring CallerIDNum:
CallerIDName:
ConnectedLineNum:
ConnectedLineName:
Language: en AccountCode:
Context: mycontext Exten: 1000
Priority: 1
Uniqueid: mycallerid.2
Linkedid: mycallerid.1

< { "type": "ChannelDialplan", "timestamp": "2020-08-06T11:37:50.531-0500", "dialplan_app": "Stasis", "dialplan_app_data": "hello-world2", "channel": { "id": "mycallerid.1", "name": "Local/1000@mycontext-0000000b;1", "state": "Down", "caller": { "name": "", "number": "" }, "connected": { "name": "", "number": "" }, "accountcode": "", "dialplan": { "context": "mycontext", "exten": "1000", "priority": 1, "app_name": "Stasis", "app_data": "hello-world2" }, "creationtime": "2020-08-06T11:37:50.531-0500", "language": "en" }, "asterisk_id": "00:15:5d:8e:01:38", "application": "hello-world2" } < { "variable": "STASISSTATUS", "value": "", "type": "ChannelVarset", "timestamp": "2020-08-06T11:37:50.531-0500", "channel": { "id": "mycallerid.1", "name": "Local/1000@mycontext-0000000b;1", "state": "Down", "caller": { "name": "", "number": "" }, "connected": { "name": "", "number": "" }, "accountcode": "", "dialplan": { "context": "mycontext", "exten": "1000", "priority": 1, "app_name": "Stasis", "app_data": "hello-world2" }, "creationtime": "2020-08-06T11:37:50.531-0500", "language": "en" }, "asterisk_id": "00:15:5d:8e:01:38", "application": "hello-world2" } < { "type": "StasisStart", "timestamp": "2020-08-06T11:37:50.531-0500", "args": [], "channel": { "id": "mycallerid.1", "name": "Local/1000@mycontext-0000000b;1", "state": "Down", "caller": { "name": "", "number": "" }, "connected": { "name": "", "number": "" }, "accountcode": "", "dialplan": { "context": "mycontext", "exten": "1000", "priority": 1, "app_name": "Stasis", "app_data": "hello-world2" }, "creationtime": "2020-08-06T11:37:50.531-0500", "language": "en" }, "asterisk_id": "00:15:5d:8e:01:38", "application": "hello-world2" } Here are the AMI Event: Newchannel Privilege: call,all Channel: Local/1000@mycontext-0000000b;1 ChannelState: 0 ChannelStateDesc: Down CallerIDNum:
CallerIDName:
ConnectedLineNum:
ConnectedLineName:
Language: en AccountCode:
Context: mycontext Exten: 1000
Priority: 1
Uniqueid: mycallerid.1
Linkedid: mycallerid.1

Event: Newchannel Privilege: call,all Channel: Local/1000@mycontext-00000007;2
ChannelState: 4
ChannelStateDesc: Ring CallerIDNum:
CallerIDName:
ConnectedLineNum:
ConnectedLineName:
Language: en AccountCode:
Context: mycontext Exten: 1000
Priority: 1
Uniqueid: mycallerid.2
Linkedid: mycallerid.1

Dan

2 thoughts on - Is It Possible To Use Stasis To Control Both Legs Of A Local Channel Created Using ARI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