entone

entone

ExARI: An Elixir Library for interfacing with Asterisk the Open Source Communications Software using ARI

ExARI

https://github.com/CityBaseInc/ex_ari

An Elixir library for interfacing with Asterisk using the ARI protocol.

Be sure to check out the example application GitHub - CityBaseInc/ex_ari_example: Example application showing real world usage of the ex_ari library to control an Asterisks server · GitHub

The ARI protocol is a robust interface for controlling Asterisk and reacting to Asterisk events. It has been thoroughly tested with Asterisk versions 15 and 16.

ARI stands for Asterisk REST Interface. Through the REST interface it is possible to control just about every aspect of an Asterisk server. ARI also provides a Websocket interface for consuming events from the Asterisk Server. This library has full support for both the REST and Websocket protocols.

If you’re not to familiar with Asterisk, there’s an example repo that will get you up and running with a custom Asterisk IVR in a few minutes, GitHub - CityBaseInc/ex_ari_example: Example application showing real world usage of the ex_ari library to control an Asterisks server · GitHub .

The documentation is pretty thorough, but it definitely helps to understand Asterisk and ARI.

Check the docs here, ARI — ARI v0.1.2

and on hex.pm ex_ari | Hex

Brought to you by CityBase

Most Liked

trarbr

trarbr

I haven’t even looked at the code yet but I know I am going to love this :heart:

trarbr

trarbr

So I wanted to try the ex_ari_example out last night, but I had some trouble with the Asterisk part. I haven’t played with Asterisk before so I’m not really sure what’s going wrong.

  1. The docker run ... command uses --net host, which doesn’t work on Mac unfortunately. So I ran it like this instead: docker run -p 8088:8088 -p 8089:8089 -p 5062:5062/tcp -p 5062:5062/udp -p 10000-10099:10000-10099/udp --name asterisk -v $PWD/asterisk_local_config/pjsip.conf:/etc/asterisk/pjsip.conf ex-ari-asterisk (I googled around a bit and guessed at the ports). After this, I could start the project with iex -S mix and it connected!
  2. However, I was unable to connect to Asterisk with Zoiper. On the accounts page it says Request Timeout (code: 408) and there is nothing in the Asterisk logs.
  3. I then tried running the Asterisk container inside an Ubuntu virtual machine, using --net host, and running it on a bridged network (VM had IP 192.168.33.10). I changed all the references to 127.0.0.1 to 192.168.33.10 in dev.env, so the Elixir project works fine. But Zoiper gives me a new error now. Instead of Request Timeout (code: 408) error, I now get Unauthorized (code: 401) and I see this in the Asterisk logs:
[Feb 14 07:29:30] NOTICE[37]: res_pjsip/pjsip_distributor.c:676 log_failed_request: Request 'REGISTER' from '<sip:ex_ari@192.168.33.10>' failed for '192.168.33.1:5063' (callid: _R51m7KNwSEepDSdZ6NrSA..) - No matching endpoint found
[Feb 14 07:29:30] NOTICE[37]: res_pjsip/pjsip_distributor.c:676 log_failed_request: Request 'REGISTER' from '<sip:ex_ari@192.168.33.10>' failed for '192.168.33.1:5063' (callid: _R51m7KNwSEepDSdZ6NrSA..) - Failed to authenticate
<--- Transmitting SIP response (505 bytes) to UDP:192.168.33.1:5063 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.33.1:5063;rport=5063;received=192.168.33.1;branch=z9hG4bK-524287-1---339444ffe79eb675
Call-ID: _R51m7KNwSEepDSdZ6NrSA..
From: <sip:ex_ari@192.168.33.10>;tag=5292835a
To: <sip:ex_ari@192.168.33.10>;tag=z9hG4bK-524287-1---339444ffe79eb675
CSeq: 2 REGISTER
WWW-Authenticate: Digest realm="ex_ari",nonce="1581665370/39d4d6299126e965bb54cf6033f8eca3",opaque="389d044662fe0ad8",algorithm=md5,qop="auth"
Server: Asterisk PBX 16.3.0
Content-Length:  0

I wonder if I am using the wrong username/password?

lawik

lawik

Nerves Core Team

Super curious about this stuff. I don’t have the time anytime soon to dive into Asterisk but damn if I don’t want to :slight_smile:

Considering the Erlang/OTP telecommunications heritage, are there previous solutions to work with Asterisk around, do you know?

Cool that you are doing and releasing this!

Where Next?

Popular in Announcing Top

mspanc
I am pleased to announce an initial release of the Membrane Framework - an Elixir-based framework with special focus on processing multim...
New
martinthenth
Hello everybody :wave: Recently, some of my colleagues talked about database ids and uuids and their problems, and I remembered the pain...
New
josevalim
Hi everyone, We would like to announce that Plataformatec is working on a new MySQL driver called MyXQL. Our goal is to eventually integ...
New
Crowdhailer
I have been updating a library that allows you to pipe between functions that use the erlang result tuple convention. Assuming you have ...
New
blatyo
The best overview for how things are tied together is this presentation. Modules and functions are pretty well documented at this point, ...
New
MRdotB
I needed to reuse React components from my Chrome extension in my Phoenix/LiveView backend. I noticed that for Svelte/Vue, there are live...
New
RobertDober
Earmark is a pure-Elixir Markdown converter. It is intended to be used as a library (just call Earmark.as_html), but can also be used as...
239 12645 134
New
Flo0807
Hello everyone! I am excited to share our heart project Backpex with you. After building several Phoenix applications, we realized that...
New
zoltanszogyenyi
Hey everyone :waving_hand: Excited to join this forum - I am one of the founders and current project maintainers of a popular and open-s...
New
kevinlang
Hey all, We have made an Ecto3 Adapter for SQLite3, ecto_sqlite3! We have successfully on-boarded the full suite of integration tests (...
New

Other popular topics Top

baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID&lt;0.412.0&gt; terminating ** (Postgrex.Error) FATAL...
New
nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
Qqwy
Update: How to use the Blogs &amp; Podcasts section You can post links to your blog posts or podcasts either in one of the Official Blog...
3271 127089 1222
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New
sergio
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
New

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement