Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[asterisk-users] Is it possible to use Stasis to control both legs of a Local channel created using ARI?


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users
View previous topic :: View next topic  
Author Message
dan at amtelco.com
Guest





PostPosted: Thu Aug 06, 2020 11:53 am    Post subject: [asterisk-users] Is it possible to use Stasis to control bot Reply with quote

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: <unknown>
CallerIDName: <unknown>
ConnectedLineNum: <unknown>
ConnectedLineName: <unknown>
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: <unknown>
CallerIDName: <unknown>
ConnectedLineNum: <unknown>
ConnectedLineName: <unknown>
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: <unknown>
CallerIDName: <unknown>
ConnectedLineNum: <unknown>
ConnectedLineName: <unknown>
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: <unknown>
CallerIDName: <unknown>
ConnectedLineNum: <unknown>
ConnectedLineName: <unknown>
Language: en
AccountCode:
Context: mycontext
Exten: 1000
Priority: 1
Uniqueid: mycallerid.2
Linkedid: mycallerid.1

Dan
Back to top
jcolp at sangoma.com
Guest





PostPosted: Thu Aug 06, 2020 12:06 pm    Post subject: [asterisk-users] Is it possible to use Stasis to control bot Reply with quote

On Thu, Aug 6, 2020 at 1:52 PM Dan Cropp <dan@amtelco.com (dan@amtelco.com)> wrote:

Quote:

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.



What does the console show is actually happening with the channel? 



--
Joshua C. Colp
Asterisk Technical Lead
Sangoma Technologies
Check us out at www.sangoma.com and www.asterisk.org
Back to top
dan at amtelco.com
Guest





PostPosted: Thu Aug 06, 2020 12:13 pm    Post subject: [asterisk-users] Is it possible to use Stasis to control bot Reply with quote

Hi Joshua,

Thanks for responding.

Please disregard, I just figured out the using the originate approach solved my problem.

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

Have a good day!
Dan


From: asterisk-users <asterisk-users-bounces@lists.digium.com> On Behalf Of Joshua C. Colp
Sent: Thursday, August 6, 2020 12:05 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion <asterisk-users@lists.digium.com>
Subject: Re: [asterisk-users] Is it possible to use Stasis to control both legs of a Local channel created using ARI?


On Thu, Aug 6, 2020 at 1:52 PM Dan Cropp <dan@amtelco.com (dan@amtelco.com)> wrote:
Quote:

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.




What does the console show is actually happening with the channel?




--
Joshua C. Colp

Asterisk Technical Lead

Sangoma Technologies

Check us out at www.sangoma.com and www.asterisk.org
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services