Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Asterisk ARI create outbound call

Tags:

rest

asterisk

I'm trying to initiate calls using the ARI API, the process I followed was

  1. POST /ari/channels to create channel 1 to the local extension
  2. POST /ari/bridges to create a bridge
  3. POST /ari/bridges/{bridge-id}/addChannel with channel 1
  4. POST /ari/channels to create channel 2
  5. POST /ari/bridges/{bridge-id}/addChannel with channel 2

I have a websocket connection waiting for the correct events (like channel status up) before calling the POSTs.

The problem I'm having is this works using internal extension numbers for channel 1 and channel 2, but when using an external number for channel 2 I get the error - "Allocation failed".

Any ideas where I'm going wrong...

like image 581
grahambrown11 Avatar asked Oct 20 '22 22:10

grahambrown11


1 Answers

Im creating my calls via ARI like this:

http://{ARIUser}:{ARIPass}@localhost:8088/ari/channels?endpoint=SIP/{exten to call from}&extension={number/exten to call}&context=from-internal&priority=1&callerId={callerID}
like image 161
Yitzchok Dancziger Avatar answered Oct 29 '22 21:10

Yitzchok Dancziger