Asterisk ARI create outbound call

2019-05-06 19:46发布

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

标签: rest asterisk
1条回答
手持菜刀,她持情操
2楼-- · 2019-05-06 20:02

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.

查看更多
登录 后发表回答