asterisk / ari-py

Library for accessing the Asterisk REST Interface
Other
151 stars 106 forks source link

404 Not Found #29

Closed jeremywhittington closed 3 years ago

jeremywhittington commented 5 years ago

I'm sure I just havent properly configured asterisk but for some reason I am not able to call any of the API's.

Testing the examples on the documentation all return 404. The resources.json url returns a 404.

wscat -c "ws://127.0.0.1:8088/ari/events?api_key=asterisk:asterisk&app=hello-world"

error: Unexpected server response: 404

I followed the instructions at this website for enabling ari. https://wiki.asterisk.org/wiki/display/AST/Getting+Started+with+ARI#GettingStartedwithARI-ConfiguringAsterisk

  1. Enabled http.conf and binding
  2. Enabled ari.conf and created a user
  3. Setup a dialplan
  4. Restarted asterisk

I do get responses on port 8088 but none of the URL's I try to hit work.

davidshepherd7 commented 5 years ago

Hi, I just managed to solve a similar issue: it turned out that asterisk wasn't loading the ari module. I had to modify modules.conf to fix this. Something like:

require => res_http_websocket.so ; HTTP WebSocket Support, needed for res_ari_events
require => res_ari.so ; Asterisk RESTful Interface
require => res_ari_applications
require => res_ari_asterisk.so
require => res_ari_bridges
require => res_ari_channels.so
require => res_ari_device_states.so ; RESTful API module - Device state resources
require => res_ari_endpoints.so
require => res_ari_events.so
require => res_ari_model.so ; ARI Model validators
require => res_ari_playbacks.so
require => res_ari_recordings.so
require => res_ari_sounds
require => res_stasis.so ; Stasis application support
require => app_stasis.so ; Stasis dialplan application
require => res_stasis_answer.so
require => res_stasis_device_state.so ; Stasis application device state support
require => res_stasis_playback.so ; Stasis application playback support
require => res_stasis_recording.so ; Stasis application recording support
require => res_stasis_snoop.so ; Stasis application snoop support
Yagna24 commented 2 years ago

Hi @jeremywhittington , where's the ari.conf file located? can you mention the directory name, after running npm install wscat.

Pezhvak commented 2 months ago

@Yagna24 it's under /etc/asterisk/ari.conf if you don't have it you should make it, this is the bare minimum you need:

[general]
enabled = yes
pretty = yes
allowed_origins = *

[asterisk]
type = user
read_only = no
password = asterisk