Can't subscribe to a bridge via ARI

Hi there,

I am busy testing the ARI interface and have created a small app which can open up a WebSocket connection to Asterisk (I’m running 13.3.2) and register a Stasis app.

I have a simple call scenario: PJSIP/Brad dials PJSIP/test and PJSIP/test answers. I can subscribe to either channel, or either PJSIP device, however if I try to subscribe to the bridge (which I should be able to do) it gives me a 422 Event source does not exist.

Dialplan:

exten => 8378,1,Dial(PJSIP/test)
same => n,Hangup()

Console output:

Connected to Asterisk 13.3.2 currently running on cptlext83 (pid = 28839)
  == WebSocket connection from '172.31.80.106:46680' for protocol '' accepted using version '13'
 Activating Stasis app 'MyApp'
    -- Executing [8378@from-internal:1] Dial("PJSIP/brad-0000006e", "PJSIP/test") in new stack
    -- Called PJSIP/test
    -- PJSIP/test-0000006f is ringing
    -- PJSIP/test-0000006f answered PJSIP/brad-0000006e
    -- Channel PJSIP/brad-0000006e joined 'simple_bridge' basic-bridge <1e0e26d3-64bd-4a51-aa86-ab29e2cb03ee>
    -- Channel PJSIP/test-0000006f joined 'simple_bridge' basic-bridge <1e0e26d3-64bd-4a51-aa86-ab29e2cb03ee>
cptlext83*CLI> 

Subscribe Commands:

curl -v -u asterisk:asterisk -X POST "http://cptlext83:8088/ari/applications/MyApp/subscription?eventSource=channel:1432818810.166"
* About to connect() to proxy localhost port 3128 (#0)
*   Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 3128 (#0)
* Server auth using Basic with user 'asterisk'
> POST http://cptlext83:8088/ari/applications/MyApp/subscription?eventSource=channel:1432818810.166 HTTP/1.1
> Authorization: Basic YXN0ZXJpc2s6YXN0ZXJpc2s=
> User-Agent: curl/7.29.0
> Host: cptlext83:8088
> Accept: */*
> Proxy-Connection: Keep-Alive
> 
< HTTP/1.1 200 OK
< Server: Asterisk/13.3.2
< Date: Thu, 28 May 2015 13:16:32 GMT
< Cache-Control: no-cache, no-store
< Content-type: application/json
< Content-Length: 191
< Proxy-Connection: keep-alive
< Connection: keep-alive
< 
{
  "name": "MyApp",
  "channel_ids": [
    "1432818810.166"
  ],
  "bridge_ids": [],
  "endpoint_ids": [
    "PJSIP/brad",
    "PJSIP/test",
  ],
  "device_names": []
* Connection #0 to host localhost left intact

My Stasis app subscribes to the PJSIP endpoints on startup. If I try and subscribe to the bridge however I get the following:

curl -v -u asterisk:asterisk -X POST "http://cptlext83:8088/ari/applications/MyApp/subscription?eventSource=bridge:1e0e26d3-64bd-4a51-aa86-ab29e2cb03ee"
* About to connect() to proxy localhost port 3128 (#0)
*   Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 3128 (#0)
* Server auth using Basic with user 'asterisk'
> POST http://cptlext83.za.mhgad.com:8088/ari/applications/MyApp/subscription?eventSource=bridge:1e0e26d3-64bd-4a51-aa86-ab29e2cb03ee HTTP/1.1
> Authorization: Basic YXN0ZXJpc2s6YXN0ZXJpc2s=
> User-Agent: curl/7.29.0
> Host: cptlext83:8088
> Accept: */*
> Proxy-Connection: Keep-Alive
> 
< HTTP/1.1 422 Unprocessable Entity
< Server: Asterisk/13.3.2
< Date: Thu, 28 May 2015 13:19:55 GMT
< Cache-Control: no-cache, no-store
< Content-type: application/json
< Content-Length: 46
< Proxy-Connection: keep-alive
< Connection: keep-alive
< 
{
  "message": "Event source does not exist"
* Connection #0 to host localhost left intact

I am just looking to listen to events that are happening on the PJSIP endpoints as well as any events that occur on the bridge (such as the call being put on hold). Am I missing something here?

Thanks in advance!

ARI does not currently allow subscription to any bridges that have not been created within it. In the future this may change as the interface evolves to provide an overall view of the system, but it’s not there yet.

Thanks for the quick reply, I just figured that out myself now as well.