Asterisk AMI module is frozen

We are using asterisk for log time. recently we migrate from Ubuntu 14 to Debian 10. in Debian, sometimes, we encounter an unknow situation with AMI, that cause to freezing AMI connection, such as asterisk did not response to our application to AMI connection and Linux telnet connection (connection just froze without any error!!)
Even in the cli, after writing ‘manager show connected’, cli froze. This error just solve with restarting asterisk
After many considering I found there are 6 packet or byte waited in ‘Recv-Q’ of asterisk. and it seem asterisk have problem in reading those!!!
We met this error in asterisk 13.37 and 18.2.1

Here is some information:

root@PBX:~# netstat -nlpt
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        6      0 0.0.0.0:5038            0.0.0.0:*               LISTEN      1024/asterisk


root@PBX:~# netstat -nat | grep 5038
tcp        6      0 0.0.0.0:5038            0.0.0.0:*               LISTEN
tcp   1623624      0 127.0.0.1:35794         127.0.0.1:5038          ESTABLISHED
tcp      151      0 127.0.0.1:5038          127.0.0.1:57366         ESTABLISHED
tcp        0      0 127.0.0.1:57366         127.0.0.1:5038          ESTABLISHED
tcp        0      0 127.0.0.1:57384         127.0.0.1:5038          ESTABLISHED
tcp        0      0 127.0.0.1:5038          127.0.0.1:57378         ESTABLISHED
tcp      152      0 127.0.0.1:5038          127.0.0.1:55230         CLOSE_WAIT
tcp        1      0 127.0.0.1:5038          127.0.0.1:55248         CLOSE_WAIT
tcp        1      0 127.0.0.1:5038          127.0.0.1:55240         CLOSE_WAIT
tcp   1911494      0 127.0.0.1:35798         127.0.0.1:5038          ESTABLISHED
tcp        0 2619320 127.0.0.1:5038          127.0.0.1:35798         ESTABLISHED
tcp        0      0 127.0.0.1:57378         127.0.0.1:5038          ESTABLISHED
tcp        0      0 127.0.0.1:5038          127.0.0.1:55110         ESTABLISHED
tcp        0      0 127.0.0.1:55110         127.0.0.1:5038          ESTABLISHED
tcp        0 2619320 127.0.0.1:5038          127.0.0.1:35794         ESTABLISHED
tcp        0      0 127.0.0.1:5038          127.0.0.1:57384         ESTABLISHED

PBX*CLI> manager show settings
Global Settings:
----------------
  Manager (AMI):             Yes
  Web Manager (AMI/HTTP):    No
  TCP Bindaddress:           0.0.0.0:5038
  HTTP Timeout (seconds):    60
  TLS Enable:                No
  TLS Bindaddress:           Disabled
  TLS Certfile:              asterisk.pem
  TLS Privatekey:
  TLS Cipher:
  Allow multiple login:      Yes
  Display connects:          Yes
  Timestamp events:          No
  Channel vars:
  Debug:                     No


PBX*CLI> module show like manager
Module                         Description                              Use Count  Status      Support Level
cdr_manager.so                 Asterisk Manager Interface CDR Backend   0          Running              core
cel_manager.so                 Asterisk Manager Interface CEL Backend   0          Running              core
manager                        Asterisk Manager Interface               45         Running              core
res_manager_devicestate.so     Manager Device State Topic Forwarder     0          Running              core
res_manager_presencestate.so   Manager Presence State Topic Forwarder   0          Running              core
5 modules loaded


PBX*CLI> module unload manager
Unable to unload resource manager
Command 'module unload manager' failed.
[Sep 24 13:19:13] WARNING[17143]: loader.c:1251 ast_unload_resource: Soft unload failed, 'manager' has use count 45

Manager isn’t a module. You can’t unload it, it’s built in. You’d also need to be using an actually supported version of Asterisk, at which point if it can be reproduced then you could get a backtrace[1] to see where it is blocked. And there have been fixes for such things past the versions you mention.

[1] Getting a Backtrace - Asterisk Project - Asterisk Project Wiki

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.