FreePBX / issue-tracker

The unified FreePBX issue tracker.
https://www.freepbx.org
GNU General Public License v3.0
12 stars 1 forks source link

[bug]: The Asterisk REST Interface is not able to connect please check configuration in advanced settings. #500

Closed nicolasmtz closed 3 weeks ago

nicolasmtz commented 1 month ago

FreePBX Version

FreePBX 17

Issue Description

I have the same problem mentioned in the now closed Issue 132. Here are some facts and steps I've followed:

Issue happening after a fresh install with Debian 12.7 and the latest FreePBX code as of October 12, 2024 (CST). Asterisk REST Interface is enabled in Advanced Settings. No special characters in ARI username and password. HTTP Prefix is blank in Asterisk Builtin mini-HTTP server (Advanced Settings). Removed and reinstalled arimanager and asteriskinfo modules. Anything else that we can check so we can activate REST Interface?

Operating Environment

PBX Version: 17.0.19.13 PBX Distro: 12.7.8-2408-1.sng12 Asterisk Version: 21.4.3 Asterisk API: 17.0.6 Asterisk Info: 17.0.2

Relevant log output

No response

msanthosh18 commented 1 month ago

Hi @nicolasmtz We are unable to reproduce with auto generated username/password, even we created new username/passwords both are working fine .

Looks like user name or Password has unsupported characters, can you delete both of them and create new username and password then give a try

JoseGoncalves commented 1 month ago

Hi @nicolasmtz I would start by checking if Asterisk is listening on the HTTP/REST port. You can can do this executing:

sudo lsof -i -P | grep -E '^asterisk'

or

sudo ss -autpn | grep asterisk
nicolasmtz commented 1 month ago

@msanthosh18 , I've tried changing username/passwords with no results.

@JoseGoncalves , here is the outcome of both commands: root@base:~# sudo lsof -i -P | grep -E '^asterisk' asterisk 189468 asterisk 6u IPv4 13469652 0t0 TCP localhost:45958->localhost:6379 (ESTABLISHED) asterisk 189468 asterisk 14u IPv4 13472160 0t0 TCP localhost:5038 (LISTEN) asterisk 189468 asterisk 16u IPv4 13472176 0t0 UDP :51923 asterisk 189468 asterisk 17u IPv4 13472171 0t0 UDP :5060 asterisk 189468 asterisk 23u IPv4 35719032 0t0 TCP localhost:5038->localhost:57144 (ESTABLISHED) asterisk 189468 asterisk 26u IPv4 35629260 0t0 TCP localhost:5038->localhost:60632 (ESTABLISHED) asterisk 189468 asterisk 31u IPv4 13472389 0t0 TCP :1720 (LISTEN) asterisk 189468 asterisk 33u IPv4 13472393 0t0 UDP :4569 asterisk 189468 asterisk 35u IPv4 13472411 0t0 UDP :5000 asterisk 189468 asterisk 37u IPv4 13472495 0t0 UDP :4520 asterisk 189468 asterisk 43u IPv4 13473710 0t0 TCP localhost:5038->localhost:56174 (ESTABLISHED)

root@base:~# sudo ss -autpn | grep asterisk udp UNCONN 0 0 0.0.0.0:5000 0.0.0.0: users:(("asterisk",pid=189468,fd=35))
udp UNCONN 0 0 0.0.0.0:5060 0.0.0.0:
users:(("asterisk",pid=189468,fd=17))
udp UNCONN 0 0 0.0.0.0:51923 0.0.0.0: users:(("asterisk",pid=189468,fd=16))
udp UNCONN 0 0 0.0.0.0:4520 0.0.0.0:
users:(("asterisk",pid=189468,fd=37))
udp UNCONN 0 0 0.0.0.0:4569 0.0.0.0: users:(("asterisk",pid=189468,fd=33))
tcp LISTEN 0 2048 0.0.0.0:1720 0.0.0.0:
users:(("asterisk",pid=189468,fd=31))
tcp LISTEN 0 10 127.0.0.1:5038 0.0.0.0:* users:(("asterisk",pid=189468,fd=14))
tcp ESTAB 0 0 127.0.0.1:45958 127.0.0.1:6379 users:(("asterisk",pid=189468,fd=6),("safe_asterisk",pid=189466,fd=6))
tcp ESTAB 0 0 127.0.0.1:5038 127.0.0.1:60632 users:(("asterisk",pid=189468,fd=26))
tcp ESTAB 0 0 127.0.0.1:5038 127.0.0.1:56174 users:(("asterisk",pid=189468,fd=43))

Thanks for your help! Any additional ideas will be greatly appreciated

JoseGoncalves commented 1 month ago

You don't have the HTTP server running. By default, Asterisk should be listening in TCP port 8088, and it's not. Without this server running, the REST interface cannot work.

nicolasmtz commented 1 month ago

@JoseGoncalves here is what I have in Advanced Settings:

Enable the mini-HTTP Server: Yes Enable TLS for the mini-HTTP Server: Yes HTTP Bind Address: :: HTTP Bind Port: 8088 HTTP Prefix: blank

The only thing we did different was disabling IPv6. Maybe that could cause a problem?

JoseGoncalves commented 1 month ago

If you have disabled IPv6, you need to bind the HTTP server to an IPv4 address. Replace:: with 127.0.0.1 in HTTP Bind Address and that should solve your issue (after restarting asterisk).

Additionaly, if you don't want to give external access to the Asterisk REST Interface, you can disable the HTTPS server.

nicolasmtz commented 1 month ago

@JoseGoncalves , you rock! Changing :: to 127.0.0.1 solved the problem.

We can close this case!