Asterisk ARI create outbound call

别等时光非礼了梦想. 提交于 2019-12-07 09:53:37

问题


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


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




回答2:


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}


来源:https://stackoverflow.com/questions/27041401/asterisk-ari-create-outbound-call

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!