[OpenSIPS-Users] 500 Server error in REGISTER message

Babil (Golam Sarwar) gsbabil at gmail.com
Tue Mar 17 19:08:27 CET 2015


There's a mismatched curly-brace issue in your configuration.

Brace at line 2 matches with brace at line 18. Nothing matches with the
closing curly-brace at line 19. I think we are missing a curly-brace at
line 15.

My two-cents to the OpenSIPS team would be consider verbose curly-braces
for the configuration script. Python/C like tab-based indenting might
seem to improve readability and keep the code concise, but it introduces
these unintended errors.


```
  1 if (is_method("REGISTER"))
  2 {
  3 # authenticate the REGISTER requests (uncomment to enable auth)
  4 ##if (!www_authorize("", "subscriber"))
  5 ##{
  6 ## www_challenge("", "0");
  7 ## exit;
  8 ##}
  9 ##
 10 ##if (!db_check_to())
 11 ##{
 12 ## sl_send_reply("403","Forbidden auth ID");
 13 ## exit;
 14 ##}
 15 if (!save("location"))
 16 sl_reply_error();
 17 exit;
 18 }
 19 }
 20
```

On 3/17/15 10:52 AM, Satish Patel wrote:
> I got those code from Book Building Telephony System with OpenSIPS 1.6
> 
> Here is the code from book
> 
> if (is_method("REGISTER"))
> {
> # authenticate the REGISTER requests (uncomment to enable auth)
> ##if (!www_authorize("", "subscriber"))
> ##{
> ## www_challenge("", "0");
> ## exit;
> ##}
> ##
> ##if (!db_check_to())
> ##{
> ## sl_send_reply("403","Forbidden auth ID");
> ## exit;
> ##}
> if (!save("location"))
> sl_reply_error();
> exit;
> }
> }
> 
> 
> 
> On Tue, Mar 17, 2015 at 1:48 PM, Satish Patel <satish.txt at gmail.com
> <mailto:satish.txt at gmail.com>> wrote:
> 
>     Eric,
> 
>     I found what was the issue, I sent you REGISTER method snippet
>     before, if you look at it, If remove/comment out "sl_reply_error();"
>      line in following code, it stopped sending 500 Error. Very
>     interesting..  Do you think i need to put that in "curly braces" { } ?  
> 
>      if (!save("location"))
>                             xlog("L_ERR", "Saving contact failed - M=$rm
>     RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");
>                             sl_reply_error();
> 
>                     exit;
>             }
> 
> 
>     On Tue, Mar 17, 2015 at 1:27 PM, Satish Patel <satish.txt at gmail.com
>     <mailto:satish.txt at gmail.com>> wrote:
> 
>         Even after disabled "siptrace" it is happening. no luck :(
> 
>         On Tue, Mar 17, 2015 at 1:20 PM, Eric Tamme <eric at uphreak.com
>         <mailto:eric at uphreak.com>> wrote:
> 
>             Turn of your sip tracing and see if the issue occurs.  Its
>             running some sl_callbacks (which i assume are realated to
>             siptrace).
> 
> 
> 
>             On 03/17/2015 11:19 AM, Satish Patel wrote:
>>             I haven't done anything related "stateless".  also in my
>>             config, i haven't manually specify that 500 error anywhere
>>             where i can doubt.  I don't know from where it is coming.
>>             must be internally from opensips. 
>>
>>             On Tue, Mar 17, 2015 at 1:14 PM, Eric Tamme
>>             <eric at uphreak.com <mailto:eric at uphreak.com>> wrote:
>>
>>                 Ah - nm, i see it in an sl callback
>>
>>                 Mar 17 22:19:01 sip2 /usr/local/opensips-2-head/sbin/opensips[31285]: DBG:sl:sl_reply_error: error text is Server error occurred (1/SL)
>>
>>                 ... so are you doing anything statless in your config?  This looks like it might be siptrace related.
>>
>>
>>
>>                 On 03/17/2015 11:11 AM, Eric Tamme wrote:
>>>                 I do not see the 500 from opensips in this log.
>>>
>>>                 On 03/17/2015 11:07 AM, Satish Patel wrote:
>>>>                 Here is the debug 4 logs  http://pastebin.com/CdPxFrNp
>>>>
>>>>                 173.48.111.111  - UA 
>>>>                 188.79.242.164  - OpenSIPs
>>>>
>>>>                 On Tue, Mar 17, 2015 at 12:45 PM, Eric Tamme
>>>>                 <eric at uphreak.com <mailto:eric at uphreak.com>> wrote:
>>>>
>>>>                     This is a ladder diagram, not a sip trace.  A
>>>>                     ladder diagram is not useful in this case.
>>>>
>>>>                     Turn your debug up to 4, capture the log of the
>>>>                     register/500 happening and submit a link to the
>>>>                     pastebin.  DO NOT paste the contents into an email.
>>>>
>>>>
>>>>                     _______________________________________________
>>>>                     Users mailing list
>>>>                     Users at lists.opensips.org
>>>>                     <mailto:Users at lists.opensips.org>
>>>>                     http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>>
>>>>
>>>>
>>>>
>>>>                 _______________________________________________
>>>>                 Users mailing list
>>>>                 Users at lists.opensips.org <mailto:Users at lists.opensips.org>
>>>>                 http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>
>>>
>>>
>>>                 _______________________________________________
>>>                 Users mailing list
>>>                 Users at lists.opensips.org <mailto:Users at lists.opensips.org>
>>>                 http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>>
>>                 _______________________________________________
>>                 Users mailing list
>>                 Users at lists.opensips.org <mailto:Users at lists.opensips.org>
>>                 http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>>
>>
>>
>>             _______________________________________________
>>             Users mailing list
>>             Users at lists.opensips.org <mailto:Users at lists.opensips.org>
>>             http://lists.opensips.org/cgi-bin/mailman/listinfo/users
> 
> 
>             _______________________________________________
>             Users mailing list
>             Users at lists.opensips.org <mailto:Users at lists.opensips.org>
>             http://lists.opensips.org/cgi-bin/mailman/listinfo/users
> 
> 
> 
> 
> 
> 
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
> 

-- 
Regards,
Babil (Golam Sarwar)
Skype: gsbabil
Phone: +1-470-222-4511 (SMS and voice-mail only)

PGP Key Fingerprint : D3A1 EED0 5BA0 72D3 A011 75CB 8EA6 7D99 F433 E92D
PGP Key Download URL: http://bit.ly/gsbabil-pgp-key
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0xF433E92D.asc
Type: application/pgp-keys
Size: 56372 bytes
Desc: not available
URL: <http://lists.opensips.org/pipermail/users/attachments/20150317/dc7e8f48/attachment-0001.key>


More information about the Users mailing list