[Home]

Summary:ASTERISK-16241: problem with SIP during reboot
Reporter:Maciej Krajewski (jamicque)Labels:
Date Opened:2010-06-14 10:38:52Date Closed:2013-01-21 07:05:28.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Resources/res_config_pgsql
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) asteriskbad.txt
( 1) asteriskok.txt
( 2) asteriskvvc.txt
( 3) full
( 4) full2
( 5) log.txt
( 6) postgres.txt
( 7) sip_ps.sql
Description:I've noticed that after rebooting Asterisk machine it sometimes has problems with standing up. Asterisk runs fine, but it does not show any peers any registration fails. Such situation happens every 2 or 3 reboots (on every machine I have).
I use configs and realtime via pgsql.

Here is my modules.conf

[modules]
noload=>chan_woomera.so
autoload=yes
load => pbx_config.so
load => res_config_pgsql.so
load => res_realtime.so
noload => pbx_gtkconsole.so
load => res_musiconhold.so
noload => pbx_dundi.so
noload => res_speech.so
noload => app_speech_utils.so
noload => pbx_ael.so
noload => chan_oss.so
noload => chan_skinny.so
noload => chan_phone.so
noload => chan_mgcp.so
noload => chan_iax2.so
noload => res_ael_share.so
noload => res_phoneprov.so
noload => res_smdi.so
noload => chan_alsa.so
noload => res_config_ldap.so
noload => app_minivm.so
load => res_timing_dahdi.so
noload => res_timing_pthread.so
load => chan_sip.so

sip show registry shows:
sip show registry
Host                           dnsmgr Username       Refresh State                Reg.Time
sip.freeconet.pl:5060          N      boniek420          120 Unregistered
1 SIP registrations.

I've noticed that there is no option to restart asterisk via CLI

CLI> r
realtime  rtcp      rtp

core show threads
0xb6887b90 netconsole           started at [ 1309] asterisk.c listener()
0xb68c3b90 handle_tcptls_connection started at [  276] tcptls.c ast_tcptls_server_root()
0xb68ffb90 lock_broker          started at [  490] func_lock.c load_module()
0xb6a60b90 do_monitor           started at [22590] chan_sip.c restart_monitor()
0xb6a9cb90 scan_thread          started at [  524] pbx_spool.c load_module()
0xb6ad8b90 do_monitor           started at [ 9755] chan_dahdi.c restart_monitor()
0xb6b14b90 tps_processing_function started at [  451] taskprocessor.c ast_taskprocessor_get()
0xb6b77b90 mb_poll_thread       started at [10453] app_voicemail.c start_poll_thread()
0xb6bb3b90 tps_processing_function started at [  451] taskprocessor.c ast_taskprocessor_get()
0xb6befb90 do_monitor           started at [ 4607] chan_unistim.c restart_monitor()
0xb7884b90 do_parking_thread    started at [ 4674] features.c ast_features_init()
0xb78c0b90 tps_processing_function started at [  451] taskprocessor.c ast_taskprocessor_get()
0xb78fcb90 do_devstate_changes  started at [  725] devicestate.c ast_device_state_engine_init()
0xb7938b90 desc->accept_fn      started at [  482] tcptls.c ast_tcptls_server_start()
0xb797ab90 inotify_daemon       started at [  295] stdtime/localtime.c add_notify()
0xb79d7b90 logger_thread        started at [ 1014] logger.c init_logger()
0xb7a13b90 listener             started at [ 1369] asterisk.c ast_makesocket()
0xb7a4fb90 tps_processing_function started at [  451] taskprocessor.c ast_taskprocessor_get()
18 threads listed.


after killing the asterisk process and running it again, every thing is ok.

full debug of asterisk start is in attachment




Comments:By: Leif Madsen (lmadsen) 2010-06-14 11:01:55

The command you are looking for is 'core restart now'

By: Leif Madsen (lmadsen) 2010-06-14 11:03:32

The reason your peers are not loading up though is because it isn't getting any information from your database (no rows are returned)

You should try the preload => res_config_pgsql in your modules.conf.

The usage of load => lines after the autoload=yes is totally unnecessary.

By: Maciej Krajewski (jamicque) 2010-06-14 12:41:06

[modules]
noload=>chan_woomera.so
preload => res_config_pgsql.so
autoload=yes
preload => func_strings.so
noload => pbx_dundi.so
noload => res_speech.so
noload => app_speech_utils.so
noload => pbx_ael.so
noload => chan_oss.so
noload => chan_skinny.so
noload => chan_phone.so
noload => chan_mgcp.so
noload => chan_iax2.so
noload => res_ael_share.so
noload => res_phoneprov.so
noload => res_smdi.so
noload => chan_alsa.so
noload => res_config_ldap.so
noload => app_minivm.so
load => res_timing_dahdi.so
noload => res_timing_pthread.so
load => chan_sip.so

and in attachment (full2) is the full log.

By: Maciej Krajewski (jamicque) 2010-06-14 14:38:05

should I deliver any more info?

By: Maciej Krajewski (jamicque) 2010-06-15 04:14:22

I've hashed the line in extconfig.conf concerning the sip.conf configuration from database, however it hasn't helped.
On every 3 reboots the problem occurs.

By: Maciej Krajewski (jamicque) 2010-06-15 04:29:12

Ok, I have asterisk -vvvc logs, from such situation.
(asteriskvvc.txt)

By: Leif Madsen (lmadsen) 2010-06-15 11:43:11

It still looks like you have instability in the modules you've compiled. For example res_indications.so can't load because it's not compiled with the same compile time options as the version you're loading. This could indicate other issues with the modules you have in /usr/lib/asterisk/modules/

I suggest you rm -f /usr/lib/asterisk/modules/* and then run 'make distclean' in your Asterisk source followed by a ./configure && make install to make sure everything is clean.

Again, your modules.conf file is weird:

[modules]
autoload=yes
preload => res_config_pgsql.so
preload => func_strings.so
noload => chan_woomera.so
noload => pbx_dundi.so
noload => res_speech.so
noload => app_speech_utils.so
noload => pbx_ael.so
noload => chan_oss.so
noload => chan_skinny.so
noload => chan_phone.so
noload => chan_mgcp.so
noload => chan_iax2.so
noload => res_ael_share.so
noload => res_phoneprov.so
noload => res_smdi.so
noload => chan_alsa.so
noload => res_config_ldap.so
noload => app_minivm.so
noload => res_timing_pthread.so

Probably better ^^^

Are you running any non-vanilla patches with Asterisk? You can't report bugs if you've patched your Asterisk system here.

By: Maciej Krajewski (jamicque) 2010-06-16 03:56:10

Hi,
these files in modules where the remainings of asterisk 1.6.1.x. I've removed everything and did as you wrote, I've also corrected modules.conf.
At the beginning every ting was ok.

But I've managed to reproduce the problem and find the cause of such behaviour.
It happens when during asterisk startup UAs wants to register (in my case it was about 400 UA (ordered to register from other asterisk)).

Sometimes asterisk runs ok, sometimes SIP hangs.

log.txt is the newest log

By: Maciej Krajewski (jamicque) 2010-06-16 03:57:16

And no, I don't use any patches.

By: Paul Belanger (pabelanger) 2010-06-16 08:06:19

Where does your database reside?  Could you also upload the structure of your 'sip_ps' table.

Here are the relevant warnings from your log file.
---
[Jun 16 10:49:15] WARNING[10100]: res_config_pgsql.c:1185 require_pgsql: Table sip_ps requires a column 'name' of size '10', but no such column exists.
[Jun 16 10:49:15] WARNING[10100]: res_config_pgsql.c:1185 require_pgsql: Table sip_ps requires a column 'ipaddr' of size '15', but no such column exists.
[Jun 16 10:49:15] WARNING[10100]: res_config_pgsql.c:1185 require_pgsql: Table sip_ps requires a column 'port' of size '5', but no such column exists.
[Jun 16 10:49:15] WARNING[10100]: res_config_pgsql.c:1185 require_pgsql: Table sip_ps requires a column 'regseconds' of size '11', but no such column exists.
[Jun 16 10:49:15] WARNING[10100]: res_config_pgsql.c:1185 require_pgsql: Table sip_ps requires a column 'defaultuser' of size '10', but no such column exists.
[Jun 16 10:49:15] WARNING[10100]: res_config_pgsql.c:1185 require_pgsql: Table sip_ps requires a column 'fullcontact' of size '35', but no such column exists.
[Jun 16 10:49:15] WARNING[10100]: res_config_pgsql.c:1185 require_pgsql: Table sip_ps requires a column 'regserver' of size '20', but no such column exists.
[Jun 16 10:49:15] WARNING[10100]: res_config_pgsql.c:1185 require_pgsql: Table sip_ps requires a column 'useragent' of size '20', but no such column exists.
[Jun 16 10:49:15] WARNING[10100]: res_config_pgsql.c:1185 require_pgsql: Table sip_ps requires a column 'lastms' of size '11', but no such column exists.

By: Maciej Krajewski (jamicque) 2010-06-16 08:31:30

I've uploaded the sip_ps.sql (create table of sip_ps).

asteriskok.txt - file when everything start just fine
asteriskbad.txt - file when asterisk fails
postgres.txt - every operation on postgres when asterisk fails.

I've noticed that turning rtupdate off, makes it harder to reproduce this error.

By: Maciej Krajewski (jamicque) 2010-06-18 06:15:07

is there any more info I should deliver?

By: Maciej Krajewski (jamicque) 2010-06-19 16:11:49

ping :)

By: Evandro C├ęsar Arruda (ecarruda) 2010-06-20 09:47:58

I'm having problem with sip reload or asterisk restart when i use Pgsql module, i'm trying to found a problem to create a patch.

jamicque to solve my problem temporarily i reconfigured the pgsql to use ident in local socket, i stopped to use tcp connection, it solved to me.

By: Maciej Krajewski (jamicque) 2010-06-22 04:02:19

didn't really help.
preloading chan_sip.so make it a little harder to occur, but still it is quite easy to reporoduce this error and I think that this is quite a big bug.

By: Maciej Krajewski (jamicque) 2010-06-22 09:49:21

I've niced that it only happens with res_pgsql with odbc every thing is ok.
Sometimes asterisk hangs during the star loading pbx_config.so (when using pgsql with many registers)

[2010-06-22 16:47:08] NOTICE[17887]: loader.c:1042 load_modules: 1 modules will be loaded.
[2010-06-22 16:47:08] NOTICE[17887]: config.c:1963 ast_config_engine_register: Registered Config Engine pgsql
.[2010-06-22 16:47:08] NOTICE[17887]: cdr.c:1474 do_reload: CDR simple logging enabled.
[2010-06-22 16:47:08] NOTICE[17887]: loader.c:1042 load_modules: 151 modules will be loaded.
................................[2010-06-22 16:47:08] ERROR[17887]: chan_misdn.c:5391 load_module: Unable to initialize mISDN
.........SIP channel loading...
...........................................[2010-06-22 16:47:08] WARNING[17887]: translate.c:641 __ast_register_translator: plc_samples 160 format f

.....................[2010-06-22 16:47:08] NOTICE[17887]: config.c:1963 ast_config_engine_register: Registered Config Engine curl
............

By: Paul Belanger (pabelanger) 2010-06-30 08:51:30

Do you mind trying the patch in issue ASTERISK-16297

By: Maciej Krajewski (jamicque) 2010-07-01 03:57:59

It didn't help.

By: Matt Jordan (mjordan) 2013-01-15 11:32:45.675-0600

Please note that {{res_config_pgsql}} is an extended support module, and as such, development efforts for it come from the open source community. Response times may reflect that.

Also: there's at least one other issue opened out there that illustrated a locking problem {{res_config_pgsql}} has (ASTERISK-19767). You are likely running into the same problem on a reload.

By: Maciej Krajewski (jamicque) 2013-01-15 11:37:00.912-0600

Hi have switched to res_odbc - there everything works fine...

By: Matt Jordan (mjordan) 2013-01-21 07:05:28.812-0600

Since you're using {{res_odbc}} and this appears to be a duplicate of ASTERISK-19767, I'm going to close this issue out as a duplicate of ASTERISK-19767.