[asterisk-users] How to get call progress events from WebSocket connected to Asterisk 12 ARI events API

Joshua Colp jcolp at digium.com
Thu Sep 12 10:07:34 CDT 2013


Jim Fathman wrote:
> Hello,

Bonjour!

> I am experimenting with Asterisk 12.0.0 alpha1.  I have a couple of SIP
> phones working.  Good.  I can retrieve data using curl to interact with
> the new Asterisk REST API (ARI).  Good.
>
> Now I want to use the new ARI events API, which requires a WebSocket
> connection.  I am using Node.js for the client, and have a stable
> connection to ARI events on the Asterisk 12 server.
>
> What I hope for is that my Node.js client will receive call related
> events in JSON format messages as call activity occurs on the Asterisk
> server.  But I don't know how to request this information via the API.
>
> Do I need to specify something in the query string used for the initial
> WebSocket connection?  Or do I need to send some kind of event
> subscription messages within the WebSocket once connected?

David Lee (ARI man supreme) is currently working on an issue [1] which 
covers support for subscribing for this information for delivery over 
the WebSocket connection in a branch [2]. I'd expect this to be 
integrated into 12 within a few weeks. I believe it should cover what 
you want to do.

[1] https://issues.asterisk.org/jira/browse/ASTERISK-22451
[2] 
http://svn.digium.com/svn/asterisk/team/dlee/ASTERISK-22451-ari-subscribe/

Cheers,

-- 
Joshua Colp
Digium, Inc. | Senior Software Developer
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at:  www.digium.com  & www.asterisk.org



More information about the asterisk-users mailing list