5

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...

grahambrown11
  • 51
  • 1
  • 1
  • 5

2 Answers2

3

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}
  • Thank u, it worked for me. caller is 1110 and called is 1120. `curl -v -u user:password -X POST "http://192.168.141.235:8088/ari/channels?endpoint=PJSIP/1110&extension=1120&context=from-internal&priority=1&callerId=1110"` – zichen.L Dec 20 '19 at 23:05
  • This works for internal calls extension to extension any idea how to make an outbound call to a cell phone? – DevTurtle Aug 20 '21 at 21:47
1

When you create channel with ARI to address "/ari/channels" you MUST define "extension" or "application" parameters (read more https://wiki.asterisk.org/wiki/display/AST/Asterisk+12+Channels+REST+API#Asterisk12ChannelsRESTAPI-originate).

Digitum make very unusable Python ari module and you may play with my module (now not implemented events) on https://github.com/vit1251/ari2.

Vitold S.
  • 402
  • 4
  • 13