Asterisk ARI creates an outgoing call

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

  • POST / ari / channels to create channel 1 for local extension
  • POST / ari / bridges to create a bridge
  • POST / ari / bridges / {bridge-id} / addChannel with channel 1
  • POST / ari / channels to create channel 2
  • POST / ari / bridges / {bridge-id} / addChannel with channel 2

I have a web site connection waiting for the correct events (like up channel state) to appear before calling POST.

The problem I am facing is that this works using the extension numbers for channel 1 and channel 2, but when using the external number for channel 2, I get an Allocation Failure error.

Any ideas where I am wrong ...

+4


source to share


2 answers


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



Digitum makes the Python ari module very unusable and you can play with my module (now not implemented events) at https://github.com/vit1251/ari2 .

+1


source


I create my ARI calls like this: http: // {ARIUser}: {ARIPass} @ localhost: 8088 / ari / channel? Endpoint = SIP / {extension to call from} & extension = {number / extension to call} & context = from-internal and priority = 1 & callerıd = {callerıd}



0


source







All Articles