On Asterisk 22,I followed the instructions on the following site to configure the static app for the WebSocket server, but when I run the command ari show apps, the registered app does not appear.
Is there something missing in the settings?
The following actions were implemented:
*The name of the Statis app is temporarily referred to as “AAA”.
Create a dial plan in extensions.conf and configure it to call ARI using Statis(AAA)
Create a connection definition [connect_aaa] in websocket_client.conf for the target WebSocket Server, including its RUL, username, etc.
Add Asterisk ARI user definitions and ARI Outbound settings to ari.conf (specify ARI app name “AAA” in the apps attribute)
Launch Asterisk and execute ari show apps to verify “AAA” is displayed → Nothing is displayed
Additionally, the WebSocket client is functioning as expected.
After starting Asterisk, sending the request ‘ws://{Asterisk host}:{Asterisk port}/ari/events?app=AAA’ from the WebSocket client displays the message “Create app AAA” in the Asterisk console. Running ‘ari show apps’ in the Asterisk CLI also displays “AAA”, and a request was sent to the WebSocket client via Statis(AAA).
To my understanding, I thought that defining ARI Outbound settings in ari.conf would create an ARI app. Am I misunderstanding something?
What I wanted to do was register the Statis app in Asterisk and call it from the dial plan.
To verify this, I tested both the implementation method on the WebSocket client and the implementation method on the WebSocket server.
After adding an ARI user to ari.conf in the WebSocket Client, connecting to Asterisk via the REST API /ari/events?app=AAA from the WebSocket Client successfully registered the Statis app as expected.
→ The log message “Create Statis app ‘AAA’” appeared in Asterisk. Executing Statis(AAA) in the dial plan confirmed that the WebSocket client received the request from Asterisk.
Similarly, to register the Statis app with Asterisk for the WebSocket server, I added the ARI user registration and ARI Outbound settings to ari.conf, and defined the connection settings to the WebSocket server in websocket_client.conf.
As you pointed out, running the ari show apps command at Asterisk startup displays nothing. However, if I execute Statis() in the dial plan, will the Statis app defined by the Outbound settings added to ari.conf via the ari show apps command then appear?
I don’t have the environment available right now, so I’ll check it later.
Thank you for your response.
Yes it will. Here’s an example where phne 1171 is calling extension 1117 which calls Stasis(test_outbound_connection) …
*CLI> ari show apps
Application Name
=========================
*CLI>
*** Phone 1171 calls extension 1117...
== Using SIP RTP Audio TOS bits 184
== Using SIP RTP Audio CoS mark 5
-- Executing [1117@default:1] NoOp("PJSIP/1171-00000000", "Local 1117 1171") in new stack
-- Executing [1117@default:2] Stasis("PJSIP/1171-00000000", "test_outbound_connection,incoming") in new stack
Creating Stasis app 'test_outbound_connection:PJSIP/1171-00000000'
-- Channel PJSIP/1171-00000000 joined 'simple_bridge' stasis-bridge <3aa1938e-1c41-46be-8de2-cda15635cfc3>
*CLI> ari show apps
Application Name
=========================
test_outbound_connection:PJSIP/1171-00000000
*CLI>
*** Phone 1171 hangs up...
-- Channel PJSIP/1171-00000000 left 'simple_bridge' stasis-bridge <3aa1938e-1c41-46be-8de2-cda15635cfc3>
Deactivating Stasis app 'test_outbound_connection:PJSIP/1171-00000000'
Shutting down application 'test_outbound_connection:PJSIP/1171-00000000'
Destroying Stasis app test_outbound_connection:PJSIP/1171-00000000
*CLI> ari show apps
Application Name
=========================
*CLI>