You’re not actually passing %3A as the user/password separator in the api_key are you? You should specify the : literally. The debug message from http.c should look like…
HTTP Request URI is /ari/events?app=IwSip&subscribeAll=true&api_key=asterisk:******
Im hand rolling my own web socket connection in Dart using their IOWebSocketChannel class.
Whats interesting is in the asterisk logs:
[2024-08-02 14:09:32] DEBUG[13709]: http.c:1415 handle_uri: HTTP Request URI is /ari/events?app=IwSip&subscribeAll=true&api_key=asterisk:asterisk
[2024-08-02 14:09:32] DEBUG[13709]: http.c:1470 handle_uri: match request [ari/events] with handler [httpstatus] len 10
[2024-08-02 14:09:32] DEBUG[13709]: http.c:1470 handle_uri: match request [ari/events] with handler [ws] len 2
[2024-08-02 14:09:32] DEBUG[13709]: http.c:1492 handle_uri: Requested URI [ari/events] has no handler
The first log shows its receiving /ari/events, i wanna say that from that im sending over the correct url?
The log make is look like the /ari handler isn’t loaded. Are you sure there are no errors in ari.conf preventing it from loading? Do a http show status. It should show…
HTTP Server Status:
Prefix:
Server: Asterisk/18.16.0
Server Enabled and Bound to 0.0.0.0:8088
HTTPS Server Enabled and Bound to 0.0.0.0:8089
Enabled URI's:
/httpstatus => Asterisk HTTP General Status
<maybe some other stuff>
/ari/... => Asterisk RESTful API
/ws => Asterisk HTTP WebSocket
I did show status and ari wasn’t there.
the module was running thought from ‘module show like ari’
Went to the config files and they some how had been reset… with enable=no
Edited the ari config files, fwconsole restart
http show status showed that ari is up and running.
Restarted my code and the ‘could not upgrade to websocket error’ is now gone so i assume its successful. Really not sure what happened there
Would you be able to just confirm to me that listening to the ARI events, you’re able to monitor calls being made and extract the caller and callee extension numbers?
Or can this only be done with the AMI?
Just restarted my code again and the websocket cannot connect again: ‘was not upgraded to websocket’
When it did connect i had the json messages coming through, is there some sort of connection throttling on the server that won’t upgrade a socket if too many connection requests come through?
just did http show status and ari is now gone again and the ari config files have been reset, it seems to be turning itself off automatically
That may be FreePBX doing that. Is there an ari_custom.conf file or something you can edit or is there a FreePBX setting to turn ARI on or off? I don’t have an FPBX system handy to look at.
edit…
ari_additional_custom.conf for additional users
ari_general_custom.conf for general settings
Ah yep, theres FreePBX UI settings i was overlooking. Ticked them, made a new user for me.
Has connected over 10 times now without fail and can parse all the events coming through. Thank you!