[asterisk-bugs] [Asterisk 0010690]: sip peer with missing close bracket causes all subsequent sip peers not to load

Asterisk Bug Tracker noreply at bugs.digium.com
Fri Sep 12 18:20:34 CDT 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=10690 
====================================================================== 
Reported By:                dtyoo
Assigned To:                Corydon76
====================================================================== 
Project:                    Asterisk
Issue ID:                   10690
Category:                   Channels/chan_sip/General
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     ready for testing
Asterisk Version:           1.6.0-beta9 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             2007-09-10 17:34 CDT
Last Modified:              2008-09-12 18:20 CDT
====================================================================== 
Summary:                    sip peer with missing close bracket causes all
subsequent sip peers not to load
Description: 
We have found that if you leave the trailing square bracket off a given sip
peer name in sip.conf, then you reload chan_sip.so, all peers that would be
loaded after the broken peer do not load.  It looks like the config parser
understands what is wrong as I see the following in the messages file:

config.c: parse error: no closing ']', line 25 of xxxx.sip.conf

But then all the rest of your sip peers disappear.  Obviously the error is
the lack of a closing brace.  But I would think that the impact of this
config error could be minimized if just this sip peer were tossed, and the
next sip peer were loaded normally.  With frequent manual editing of a
large sip.conf this is bound to happen sometime.  This has happened to us a
couple times, each time causing a fairly substantial outage for us as
several thousand sip peers disappear.
====================================================================== 

---------------------------------------------------------------------- 
 (0092455) svnbot (reporter) - 2008-09-12 18:20
 http://bugs.digium.com/view.php?id=10690#c92455 
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 142992

U   trunk/apps/app_alarmreceiver.c
U   trunk/apps/app_amd.c
U   trunk/apps/app_directory.c
U   trunk/apps/app_festival.c
U   trunk/apps/app_followme.c
U   trunk/apps/app_meetme.c
U   trunk/apps/app_minivm.c
U   trunk/apps/app_osplookup.c
U   trunk/apps/app_playback.c
U   trunk/apps/app_queue.c
U   trunk/apps/app_rpt.c
U   trunk/apps/app_voicemail.c
U   trunk/channels/chan_agent.c
U   trunk/channels/chan_alsa.c
U   trunk/channels/chan_console.c
U   trunk/channels/chan_dahdi.c
U   trunk/channels/chan_gtalk.c
U   trunk/channels/chan_h323.c
U   trunk/channels/chan_iax2.c
U   trunk/channels/chan_jingle.c
U   trunk/channels/chan_mgcp.c
U   trunk/channels/chan_oss.c
U   trunk/channels/chan_phone.c
U   trunk/channels/chan_sip.c
U   trunk/channels/chan_skinny.c
U   trunk/channels/chan_unistim.c
U   trunk/codecs/codec_adpcm.c
U   trunk/codecs/codec_alaw.c
U   trunk/codecs/codec_dahdi.c
U   trunk/codecs/codec_g722.c
U   trunk/codecs/codec_g726.c
U   trunk/codecs/codec_gsm.c
U   trunk/codecs/codec_lpc10.c
U   trunk/codecs/codec_speex.c
U   trunk/codecs/codec_ulaw.c
U   trunk/funcs/func_config.c
U   trunk/funcs/func_odbc.c
U   trunk/include/asterisk/config.h
U   trunk/main/asterisk.c
U   trunk/main/cdr.c
U   trunk/main/config.c
U   trunk/main/dnsmgr.c
U   trunk/main/dsp.c
U   trunk/main/enum.c
U   trunk/main/features.c
U   trunk/main/http.c
U   trunk/main/loader.c
U   trunk/main/manager.c
U   trunk/main/rtp.c
U   trunk/main/udptl.c
U   trunk/res/res_adsi.c
U   trunk/res/res_config_ldap.c
U   trunk/res/res_config_pgsql.c
U   trunk/res/res_config_sqlite.c
U   trunk/res/res_http_post.c
U   trunk/res/res_indications.c
U   trunk/res/res_jabber.c
U   trunk/res/res_musiconhold.c
U   trunk/res/res_odbc.c
U   trunk/res/res_phoneprov.c
U   trunk/res/res_smdi.c
U   trunk/res/res_snmp.c

------------------------------------------------------------------------
r142992 | tilghman | 2008-09-12 18:20:32 -0500 (Fri, 12 Sep 2008) | 27
lines

Create a new config file status, CONFIG_STATUS_FILEINVALID for
differentiating
when a file is invalid from when a file is missing.  This is most
important when
we have two configuration files.  Consider the following example:

Old system:
sip.conf     users.conf     Old result               New result
========     ==========     ==========               ==========
Missing      Missing        SIP doesn't load         SIP doesn't load
Missing      OK             SIP doesn't load         SIP doesn't load
Missing      Invalid        SIP doesn't load         SIP doesn't load
OK           Missing        SIP loads                SIP loads
OK           OK             SIP loads                SIP loads
OK           Invalid        SIP loads incompletely   SIP doesn't load
Invalid      Missing        SIP doesn't load         SIP doesn't load
Invalid      OK             SIP doesn't load         SIP doesn't load
Invalid      Invalid        SIP doesn't load         SIP doesn't load

So in the case when users.conf doesn't load because there's a typo that
disrupts the syntax, we may only partially load users, instead of failing
with
an error, which may cause some calls not to get processed.  Worse yet, the
old
system would do this with no indication that anything was even wrong.

(closes issue http://bugs.digium.com/view.php?id=10690)
 Reported by: dtyoo
 Patches: 
       20080716__bug10690.diff.txt uploaded by Corydon76 (license 14)

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=142992 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2008-09-12 18:20 svnbot         Checkin                                      
2008-09-12 18:20 svnbot         Note Added: 0092455                          
======================================================================




More information about the asterisk-bugs mailing list