Hi to everybody,
I am new using Asterisk, and I have a problem to establish a call beetwen peers (extensions). I am not sure if I am perform the steps properly and in order. I need to create the channel without use originate, because I need to take the control of each id and action.
1. mydomain/ari/channels/create?api_key=user:pass (POST)
with :
endpoint : PJSIP/ext1
extension : ext2
channelId: canal1
app: hello-world
2. mydomain/ari/channels/create?api_key=user:pass (POST)
with :
endpoint : PJSIP/ext2
extension : ext1
channelId: canal2
app: hello-world
3. mydomain/ari/bridges?api_key=user:pass (POST)
with :
bridgeId: mybridge
4. mydomain/ari/bridges/mybridge/addChannel?api_key=user:pass (POST)
channel: canal1, canal2
and finally:
mydomain/ari/channels/canal1/dial?api_key=user:pass (POST)
caller :canal2
I am sure that I am doing any thing wrong.
What is the result? ext2 receives the call, but when I pick up the phone, ext1 is not receiving the ring tone. If I use the REST to get the info of the channels I get:
[
{
“id”: “canal2”,
“name”: “PJSIP/ext1-00000066”,
“state”: “Down”,
“caller”: {
“name”: “name1”,
“number”: “ext1”
},
“connected”: {
“name”: “”,
“number”: “”
},
“accountcode”: “”,
“dialplan”: {
“context”: “from-internal”,
“exten”: “s”,
“priority”: 1
},
“creationtime”: “2019-03-12T13:21:41.283+0100”,
“language”: “es”
},
{
“id”: “canal1”,
“name”: “PJSIP/ext2-00000067”,
“state”: “Up”,
“caller”: {
“name”: “name2”,
“number”: “ext2”
},
“connected”: {
“name”: “”,
“number”: “”
},
“accountcode”: “”,
“dialplan”: {
“context”: “from-internal”,
“exten”: “s”,
“priority”: 1
},
“creationtime”: “2019-03-12T13:21:50.431+0100”,
“language”: “es”
}
]
Only canal1 is Up.
Does anyone know that I can be doing wrong?
Thanks in advance.