Hi,
i’m trying to enable and use ARI on freePBX in NethServer.
My goal is to get a web page that can display the asterisk info and make calls.
I’ve installed Asterisk REST Interface Users module and i’ve enabled, in “Settings -> Advanced Settings” the “Asterisk Builtin mini-HTTP server” and “Asterisk REST Interface”.
In “Asterisk Rest Interface Users” i’ve created a user whit write permission.
The problem is that i receive always a 404 error.
In CLI i’ve this output: cdc*CLI> ari show status ARI Status: Enabled: Yes Output format: pretty Auth realm: Asterisk REST Interface Allowed Origins: * User count: 2
cdc*CLI> http show status HTTP Server Status: Prefix: Server: Asterisk/13.17.2 Server Enabled and Bound to 0.0.0.0:8088
Enabled URI’s: /httpstatus => Asterisk HTTP General Status /static/… => Asterisk HTTP Static Delivery /ari/… => Asterisk RESTful API /ws => Asterisk HTTP WebSocket
after entered username and password i obtain the following response:
{
“message” : “Resource not found”
}
and the following log in console:
[2018-06-27 15:28:20] DEBUG[22381]: http.c:1954 httpd_helper_thread: HTTP opening session. Top level
[2018-06-27 15:28:20] DEBUG[22381]: http.c:1430 handle_uri: HTTP Request URI is /ari/asterisk/info
[2018-06-27 15:28:20] DEBUG[22381]: http.c:1485 handle_uri: match request [ari/asterisk/info] with handler [httpstatus] len 10
[2018-06-27 15:28:20] DEBUG[22381]: http.c:1485 handle_uri: match request [ari/asterisk/info] with handler [static] len 6
[2018-06-27 15:28:20] DEBUG[22381]: http.c:1485 handle_uri: match request [ari/asterisk/info] with handler [ari] len 3
[2018-06-27 15:28:20] DEBUG[22381]: http.c:1501 handle_uri: Match made with [ari]
[2018-06-27 15:28:20] DEBUG[22381]: http.c:565 ast_http_send: HTTP keeping session open. status_code:404
i get:
* About to connect() to servername.xyz port 8088 (#0)
* Trying ipaddress…
* Connected to servername.xyz (ipaddress) port 8088 (#0)
* Server auth using Basic with user ‘username’
> GET /ari/asterisk/info HTTP/1.1
> Authorization: Basic YXJpcmVwbHl1c2VyOnJlcGx5
> User-Agent: curl/7.29.0
> Host: servername.xyz:8088
> Accept: /
>
< HTTP/1.1 404 Not Found
< Server: Asterisk/13.17.2
< Date: Wed, 27 Jun 2018 13:34:51 GMT
< Cache-Control: no-cache, no-store
< Content-type: application/json
< Content-Length: 37
<
{
“message”: “Resource not found”
* Connection #0 to host servername.xyz left intact
There are someone that have tryied something similar?
I remember that you have to call your application from the dialplan using Stasis() function, and that’s the reason why we tried to use ARI but we went back to AMI (for an enterprise application) https://wiki.asterisk.org/wiki/display/AST/Getting+Started+with+ARI# <- look at the extension.conf example
Damn… it doesn’t sounds good.
I think that i switch to AMI because i need a simple web page that show presence and send/receive calls (it’s only dimostrative).
Did you realize something like that for your enterprise application with AMI?
cdc*CLI> module show like ari
Module Description Use Count Status Support Level
res_ari.so Asterisk RESTful Interface 0 Running core
res_ari_applications.so RESTful API module - Stasis application 0 Not Running core
res_ari_asterisk.so RESTful API module - Asterisk resources 0 Not Running core
res_ari_bridges.so RESTful API module - Bridge resources 0 Not Running core
res_ari_channels.so RESTful API module - Channel resources 0 Not Running core
res_ari_device_states.so RESTful API module - Device state resour 0 Not Running core
res_ari_endpoints.so RESTful API module - Endpoint resources 0 Not Running core
res_ari_events.so RESTful API module - WebSocket resource 0 Not Running core
res_ari_model.so ARI Model validators 0 Running core
res_ari_playbacks.so RESTful API module - Playback control re 0 Not Running core
res_ari_recordings.so RESTful API module - Recording resources 0 Not Running core
res_ari_sounds.so RESTful API module - Sound resources 0 Not Running core
12 modules loaded