Endpoints status not changing after server restart

Hello, I configured Asterisk 20.2.0 (Mysql + Realtime), configured pjsip, however, after rebooting the server (sudo reboot), pjsip list endpoints shows that the status of the points is Unavailable

if I enter core reload via CLI> core reload the status changes to Not in use as it should

how fix this?

still a question where the timer on the Unavailable/Not Use status in Endpoints is regulated? I noticed that the status of SIP Phones is not updated as fast as I would like (Program MicroSIP checking fast and show correct status)

You’d need to be specific with configuration and how long you wait. For example, are they endpoints that have registered? Do they have contacts?

And which timer are you referring to? There is the timer for sending SIP OPTIONS to test availability, which is configurable on the AOR.

Does this happen without realtime? And why are you using realtime?

I just read a book on setting up Asterisk (Asterisk Cookbook - Leif Madsen and Russell Bryant) and made a test server and realtime was used there
AORs Endpoints Contacts all work i can call to internal clients

after reboot server

then i do

ServAsterisk*CLI> core reload
... log reload

You’re not giving the output of the same commands in each situation. An endpoint is unavailable if there are no reachable contacts.

and status change

if i again reboot server i have status Unavailable again

i wait few hours but status not change self
he change only if core reload
101_4CCC6AB65BAD - microSIP client 3.21.3 version

PS Sorry, new users can only put one embedded media item in a post.

i change in AORs settings
minimum_expiration - 30
maximum_expiration - 60
qualify_frequency - 2000
but this not help

Asterisk*CLI> pjsip show endpoints

Endpoint:  101_4CCC6AB65BAD                                     Unavailable   0 of inf
     InAuth:  101_4CCC6AB65BAD/101_4CCC6AB65BAD
        Aor:  101_4CCC6AB65BAD                                   1
      Contact:  101_4CCC6AB65BAD/sip:101_4CCC6AB65BAD@10.1 733b436706 NonQual         nan
  Transport:  transport-udp             udp      0      0  0.0.0.0:5060

Are there any log messages indicating issues when Asterisk starts? Does this happen without realtime?

how to see the right log in Asterisk?

to check without Realtime, I will need time to transfer the data to config files

Commonly it would be in the /var/log/asterisk/full file if enabled, or /var/log/asterisk/messages. It’s dependent on configuration within logger.conf

there is evidence that there was no connection to the database

[Apr  5 16:59:06] WARNING[740] res_odbc.c: res_odbc: Error SQLConnect=-1 errno=2002 [unixODBC][MySQL][ODBC 8.0(a) Driver]Can't connect to local MySQL server through socket '/var/lib/m
[Apr  5 16:59:06] ERROR[740] res_config_odbc.c: No database handle available with the name of 'asterisk' (check res_odbc.conf)
[Apr  5 16:59:06] WARNING[740] res_odbc.c: res_odbc: Error SQLConnect=-1 errno=2002 [unixODBC][MySQL][ODBC 8.0(a) Driver]Can't connect to local MySQL server through socket '/var/lib/m
[Apr  5 16:59:06] ERROR[740] res_config_odbc.c: No database handle available with the name of 'asterisk' (check res_odbc.conf)

and when I manually run a kernel reload the database is already running
this suggests that Asterisk starts up faster than mysqld and hence the problem,

how can I delay the launch in systemctl for Asterisk?

hm before my database had the name mysql, but now mysqld (after the update) where does the database startup check in Asterisk take place? to change the service name there

Solution: Added option to start asterix after database start

After=network.target mysqld.service

in asterisk.service - now work correct

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