Restart asterisk 18.9

I have a situation when restart asterisk process. he delay 10-15 minutes for initialization (pjsip)

in console we have a many lines like this:

[Feb 8 08:04:52] NOTICE[14778] res_pjsip/pjsip_transport_management.c: Shutting down transport ‘TCP to 187.50.41.42:50763’ since no request was received in 6 seconds

This machine have 5k endpoints,

it looks like it is checking each endpoint before going up the process

Where are the endpoints configured?

in file pjsip.conf

example:

[0704]
type = auth
realm=xhand
username = 0704
password = ********

[0704]
type = endpoint
context=geral
moh_suggest=default
contact_user=0704
callerid=0704
;;;;;redirect_method=uri_pjsip
disallow=all

allow=g729

allow=alaw
allow=ulaw

language=pt_BR

subscribe_context=hint
allow_subscribe=yes
auth=0704
outbound_auth=0704
aors=0704
direct_media=no
inband_progress=yes
voicemail_extension=6240
rtp_timeout=300

dtmf_mode=rfc4733
100rel=no
rtp_symmetric=yes
force_rport=yes
rewrite_contact=yes
webrtc=yes
;use_avpf=yes
;media_encryption=dtls
;dtls_verify=fingerprint
;dtls_setup=actpass
ice_support=yes
;media_use_received_transport=yes
;rtcp_mux=yes
set_var=CHANNEL(parkinglot)=parkinglot_VC

I’m not aware of anything specifically to slow that down besides normal config parsing and loading, but 5000 endpoints isn’t exactly something everyone does. It’s entirely possible that there is a bottleneck somewhere.

if i restart the server, asterisk goes up in 30 seconds.
it’s as if on restart the endpoints were still logged in and he checked them all before going up

It doesn’t “check them all” in a synchronous way, but it will set up OPTIONS sending and such at startup if contacts are present.

is there a way for me to clear all this “cache” of contacts?

It’s contained within the astdb, which is a sqlite3 database. I don’t have any instructions for clearing it out. It’s also possible that this is not the problem at all, since it’s all just guessing.

This maybe work?

  1. Stop asterisk
  2. delete /var/lib/asterisk/astdb.sqlite3 - asterisk would recreate database ?

Asterisk will create the database if it is not present. Anything stored in astdb will be lost, of course.

I tried delete astdb and dona work too, Its only works if I restart machine

yes Asterisk will only recreate when it start

That’s when Asterisk restarts. There is no need to restart the machine.

It’s contained within the astdb, which is a sqlite3 database. I don’t have any instructions for clearing it out.

AstDB allows you to query it using regular SQL.

Look into the “database query” command in Asterisk. You can do something like DELETE FROM astdb WHERE key LIKE ‘registar/contact/%’ to remove out cached info from AstDB. You might need to play with it a bit to get it right.

if I restart asterisk, he delay a 30 minutes for complete start.

If I restart machine, the asterisk delay a 3 a 4 minutes for complete start.

[Feb 15 17:07:43] DEBUG [10996]: res_pjsip/pjsip_transport_events.c : 157 transport_state_callback : Reliable transport ‘tcps0x7f5e90917ed8’ state:SHUTDOWN

[Feb 15 17:07:43] DEBUG [10896]: res_pjsip/pjsip_transport_events.c : 157 transport_state_callback : Reliable transport ‘tcps0x7f5e90917ed8’ state:DESTROY

[Feb 15 17:07:43] DEBUG [16424]: devicestate.c : 361 _ast_device_state : No provider found, checking channel drivers for PJSIP - 0758

[Feb 15 17:07:43] DEBUG [16424]: devicestate.c : 361 _ast_device_state : No provider found, checking channel drivers for PJSIP - 5716

[Feb 15 17:07:43] DEBUG [16424]: devicestate.c : 361 _ast_device_state : No provider found, checking channel drivers for PJSIP - 5717

[Feb 15 17:07:43] DEBUG [16424]: devicestate.c : 361 _ast_device_state : No provider found, checking channel drivers for PJSIP - 5714

[Feb 15 17:07:43] DEBUG [16424]: devicestate.c : 361 _ast_device_state : No provider found, checking channel drivers for PJSIP - 5715

[Feb 15 17:07:43] DEBUG [16424]: devicestate.c : 361 _ast_device_state : No provider found, checking channel drivers for PJSIP - 5712

[Feb 15 17:07:43] DEBUG [16424]: devicestate.c : 361 _ast_device_state : No provider found, checking channel drivers for PJSIP - 5713

[Feb 15 17:07:43] DEBUG [16424]: devicestate.c : 361 _ast_device_state : No provider found, checking channel drivers for PJSIP - 2605

[Feb 15 17:07:43] DEBUG [16424]: devicestate.c : 361 _ast_device_state : No provider found, checking channel drivers for PJSIP - 5710

[Feb 15 17:07:43] DEBUG [16424]: devicestate.c : 361 _ast_device_state : No provider found, checking channel drivers for PJSIP - 5711

[Feb 15 17:07:43] DEBUG [16424]: devicestate.c : 361 _ast_device_state : No provider found, checking channel drivers for PJSIP - 2607

[Feb 15 17:07:43] DEBUG [16424]: devicestate.c : 361 _ast_device_state : No provider found, checking channel drivers for PJSIP - 2606

[Feb 15 17:07:43] DEBUG [16424]: devicestate.c : 361 _ast_device_state : No provider found, checking channel drivers for PJSIP - 2609

[Feb 15 17:07:43] DEBUG [16424]: devicestate.c : 361 _ast_device_state : No provider found, checking channel drivers for PJSIP - 2608

[Feb 15 17:07:43] DEBUG [16424]: devicestate.c : 361 _ast_device_state : No provider found, checking channel drivers for PJSIP - 5718

[Feb 15 17:07:43] DEBUG [16424]: devicestate.c : 361 _ast_device_state : No provider found, checking channel drivers for PJSIP - 5719

[Feb 15 17:07:43] DEBUG [16424]: devicestate.c : 361 _ast_device_state : No provider found, checking channel drivers for PJSIP - 0788

[Feb 15 17:07:43] DEBUG [16424]: devicestate.c : 361 _ast_device_state : No provider found, checking channel drivers for PJSIP - 0789

[Feb 15 17:07:43] DEBUG [16424]: devicestate.c : 361 _ast_device_state : No provider found, checking channel drivers for PJSIP - 2337

[Feb 15 17:07:43] DEBUG [16424]: devicestate.c : 361 _ast_device_state : No provider found, checking channel drivers for PJSIP - 2336

[Feb 15 17:07:43] DEBUG [16424]: devicestate.c : 361 _ast_device_state : No provider found, checking channel drivers for PJSIP - 2335

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