# Endpoints status not changing after server restart

**URL:** <https://community.asterisk.org/t/endpoints-status-not-changing-after-server-restart/96430>\
**Category:** Asterisk SIP\
**Created:** [April 5, 2023, 10:05am UTC](https://community.asterisk.org/t/endpoints-status-not-changing-after-server-restart/96430 "2023-04-05T10:05:26Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Delari](https://avatars.discourse-cdn.com/v4/letter/d/2acd7d/32.png) [@Delari](https://community.asterisk.org/u/Delari)\
**Post date:** [April 5, 2023, 10:05am UTC](https://community.asterisk.org/t/endpoints-status-not-changing-after-server-restart/96430/1 "2023-04-05T10:05:26Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![jcolp](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/jcolp/32/8848_2.png) [@jcolp](https://community.asterisk.org/u/jcolp)\
**Post date:** [April 5, 2023, 10:21am UTC](https://community.asterisk.org/t/endpoints-status-not-changing-after-server-restart/96430/2 "2023-04-05T10:21:40Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Delari](https://avatars.discourse-cdn.com/v4/letter/d/2acd7d/32.png) [@Delari](https://community.asterisk.org/u/Delari)\
**Post date:** [April 5, 2023, 11:28am UTC](https://community.asterisk.org/t/endpoints-status-not-changing-after-server-restart/96430/3 "2023-04-05T11:28:44Z")

</div>

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

 ![shot1](https://global.discourse-cdn.com/asterisk/original/2X/3/3efe8dd40002ed59e0c3277c8b8697cbad25779e.png)

then i do

```auto
ServAsterisk*CLI> core reload
... log reload

```

---

<div class="post-metadata">

**Author:** ![jcolp](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/jcolp/32/8848_2.png) [@jcolp](https://community.asterisk.org/u/jcolp)\
**Post date:** [April 5, 2023, 11:31am UTC](https://community.asterisk.org/t/endpoints-status-not-changing-after-server-restart/96430/4 "2023-04-05T11:31:33Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Delari](https://avatars.discourse-cdn.com/v4/letter/d/2acd7d/32.png) [@Delari](https://community.asterisk.org/u/Delari)\
**Post date:** [April 5, 2023, 11:42am UTC](https://community.asterisk.org/t/endpoints-status-not-changing-after-server-restart/96430/6 "2023-04-05T11:42:26Z")

</div>

and status change

 ![shot2](https://global.discourse-cdn.com/asterisk/original/2X/8/80ee6923f632de5c381b49856824efb00c92189c.png)

---

<div class="post-metadata">

**Author:** ![Delari](https://avatars.discourse-cdn.com/v4/letter/d/2acd7d/32.png) [@Delari](https://community.asterisk.org/u/Delari)\
**Post date:** [April 5, 2023, 11:43am UTC](https://community.asterisk.org/t/endpoints-status-not-changing-after-server-restart/96430/7 "2023-04-05T11:43:21Z")

</div>

if i again reboot server i have status Unavailable again

 ![shot3](https://global.discourse-cdn.com/asterisk/original/2X/2/2deb6e39d78c9e1073e981502eb993cd84a8c273.png)

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

```auto
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

```

---

<div class="post-metadata">

**Author:** ![jcolp](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/jcolp/32/8848_2.png) [@jcolp](https://community.asterisk.org/u/jcolp)\
**Post date:** [April 5, 2023, 11:55am UTC](https://community.asterisk.org/t/endpoints-status-not-changing-after-server-restart/96430/8 "2023-04-05T11:55:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Delari](https://avatars.discourse-cdn.com/v4/letter/d/2acd7d/32.png) [@Delari](https://community.asterisk.org/u/Delari)\
**Post date:** [April 5, 2023, 11:57am UTC](https://community.asterisk.org/t/endpoints-status-not-changing-after-server-restart/96430/9 "2023-04-05T11:57:00Z")

</div>

how to see the right log in Asterisk?

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

---

<div class="post-metadata">

**Author:** ![jcolp](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/jcolp/32/8848_2.png) [@jcolp](https://community.asterisk.org/u/jcolp)\
**Post date:** [April 5, 2023, 11:57am UTC](https://community.asterisk.org/t/endpoints-status-not-changing-after-server-restart/96430/10 "2023-04-05T11:57:37Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Delari](https://avatars.discourse-cdn.com/v4/letter/d/2acd7d/32.png) [@Delari](https://community.asterisk.org/u/Delari)\
**Post date:** [April 5, 2023, 12:04pm UTC](https://community.asterisk.org/t/endpoints-status-not-changing-after-server-restart/96430/11 "2023-04-05T12:04:41Z")

</div>

there is evidence that there was no connection to the database

```auto
[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?

---

<div class="post-metadata">

**Author:** ![Delari](https://avatars.discourse-cdn.com/v4/letter/d/2acd7d/32.png) [@Delari](https://community.asterisk.org/u/Delari)\
**Post date:** [April 5, 2023, 12:19pm UTC](https://community.asterisk.org/t/endpoints-status-not-changing-after-server-restart/96430/12 "2023-04-05T12:19:26Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Delari](https://avatars.discourse-cdn.com/v4/letter/d/2acd7d/32.png) [@Delari](https://community.asterisk.org/u/Delari)\
**Post date:** [April 5, 2023, 6:26pm UTC](https://community.asterisk.org/t/endpoints-status-not-changing-after-server-restart/96430/13 "2023-04-05T18:26:15Z")

</div>

Solution: Added option to start asterix after database start

> After=network.target mysqld.service

in asterisk.service - now work correct

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/asterisk/original/2X/4/475d0c889911cfb84ac4881ad6df8b523e3f9105.png) [@system](https://community.asterisk.org/u/system)\
**Post date:** [May 5, 2023, 6:27pm UTC](https://community.asterisk.org/t/endpoints-status-not-changing-after-server-restart/96430/14 "2023-05-05T18:27:12Z")

</div>

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