<div dir="ltr"><pre>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
```<br><br>-- 
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: <a class="moz-txt-link-freetext" href="http://bit.ly/gsbabil-pgp-key">http://bit.ly/gsbabil-pgp-key</a><br></pre></div><br><div class="gmail_quote">On Tue, Mar 17, 2015 at 11:06 AM Babil (Golam Sarwar) <<a href="mailto:gsbabil@gmail.com">gsbabil@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">There's a mismatched curly-brace issue in your configuration.<br>
<br>
Brace at line 2 matches with brace at line 18. Nothing matches with the<br>
closing curly-brace at line 19. I think we are missing a curly-brace at<br>
line 15.<br>
<br>
My two-cents to the OpenSIPS team would be consider verbose curly-braces<br>
for the configuration script. Python/C like tab-based indenting might<br>
seem to improve readability and keep the code concise, but it introduces<br>
these unintended errors.<br>
<br>
<br>
```<br>
  1 if (is_method("REGISTER"))<br>
  2 {<br>
  3 # authenticate the REGISTER requests (uncomment to enable auth)<br>
  4 ##if (!www_authorize("", "subscriber"))<br>
  5 ##{<br>
  6 ## www_challenge("", "0");<br>
  7 ## exit;<br>
  8 ##}<br>
  9 ##<br>
 10 ##if (!db_check_to())<br>
 11 ##{<br>
 12 ## sl_send_reply("403","Forbidden auth ID");<br>
 13 ## exit;<br>
 14 ##}<br>
 15 if (!save("location"))<br>
 16 sl_reply_error();<br>
 17 exit;<br>
 18 }<br>
 19 }<br>
 20<br>
```<br>
<br>
On 3/17/15 10:52 AM, Satish Patel wrote:<br>
> I got those code from Book Building Telephony System with OpenSIPS 1.6<br>
><br>
> Here is the code from book<br>
><br>
> if (is_method("REGISTER"))<br>
> {<br>
> # authenticate the REGISTER requests (uncomment to enable auth)<br>
> ##if (!www_authorize("", "subscriber"))<br>
> ##{<br>
> ## www_challenge("", "0");<br>
> ## exit;<br>
> ##}<br>
> ##<br>
> ##if (!db_check_to())<br>
> ##{<br>
> ## sl_send_reply("403","Forbidden auth ID");<br>
> ## exit;<br>
> ##}<br>
> if (!save("location"))<br>
> sl_reply_error();<br>
> exit;<br>
> }<br>
> }<br>
><br>
><br>
><br>
> On Tue, Mar 17, 2015 at 1:48 PM, Satish Patel <<a href="mailto:satish.txt@gmail.com" target="_blank">satish.txt@gmail.com</a><br>
> <mailto:<a href="mailto:satish.txt@gmail.com" target="_blank">satish.txt@gmail.com</a>>> wrote:<br>
><br>
>     Eric,<br>
><br>
>     I found what was the issue, I sent you REGISTER method snippet<br>
>     before, if you look at it, If remove/comment out "sl_reply_error();"<br>
>      line in following code, it stopped sending 500 Error. Very<br>
>     interesting..  Do you think i need to put that in "curly braces" { } ?<br>
><br>
>      if (!save("location"))<br>
>                             xlog("L_ERR", "Saving contact failed - M=$rm<br>
>     RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");<br>
>                             sl_reply_error();<br>
><br>
>                     exit;<br>
>             }<br>
><br>
><br>
>     On Tue, Mar 17, 2015 at 1:27 PM, Satish Patel <<a href="mailto:satish.txt@gmail.com" target="_blank">satish.txt@gmail.com</a><br>
>     <mailto:<a href="mailto:satish.txt@gmail.com" target="_blank">satish.txt@gmail.com</a>>> wrote:<br>
><br>
>         Even after disabled "siptrace" it is happening. no luck :(<br>
><br>
>         On Tue, Mar 17, 2015 at 1:20 PM, Eric Tamme <<a href="mailto:eric@uphreak.com" target="_blank">eric@uphreak.com</a><br>
>         <mailto:<a href="mailto:eric@uphreak.com" target="_blank">eric@uphreak.com</a>>> wrote:<br>
><br>
>             Turn of your sip tracing and see if the issue occurs.  Its<br>
>             running some sl_callbacks (which i assume are realated to<br>
>             siptrace).<br>
><br>
><br>
><br>
>             On 03/17/2015 11:19 AM, Satish Patel wrote:<br>
>>             I haven't done anything related "stateless".  also in my<br>
>>             config, i haven't manually specify that 500 error anywhere<br>
>>             where i can doubt.  I don't know from where it is coming.<br>
>>             must be internally from opensips.<br>
>><br>
>>             On Tue, Mar 17, 2015 at 1:14 PM, Eric Tamme<br>
>>             <<a href="mailto:eric@uphreak.com" target="_blank">eric@uphreak.com</a> <mailto:<a href="mailto:eric@uphreak.com" target="_blank">eric@uphreak.com</a>>> wrote:<br>
>><br>
>>                 Ah - nm, i see it in an sl callback<br>
>><br>
>>                 Mar 17 22:19:01 sip2 /usr/local/opensips-2-head/<u></u>sbin/opensips[31285]: DBG:sl:sl_reply_error: error text is Server error occurred (1/SL)<br>
>><br>
>>                 ... so are you doing anything statless in your config?  This looks like it might be siptrace related.<br>
>><br>
>><br>
>><br>
>>                 On 03/17/2015 11:11 AM, Eric Tamme wrote:<br>
>>>                 I do not see the 500 from opensips in this log.<br>
>>><br>
>>>                 On 03/17/2015 11:07 AM, Satish Patel wrote:<br>
>>>>                 Here is the debug 4 logs  <a href="http://pastebin.com/CdPxFrNp" target="_blank">http://pastebin.com/CdPxFrNp</a><br>
>>>><br>
>>>>                 173.48.111.111  - UA<br>
>>>>                 188.79.242.164  - OpenSIPs<br>
>>>><br>
>>>>                 On Tue, Mar 17, 2015 at 12:45 PM, Eric Tamme<br>
>>>>                 <<a href="mailto:eric@uphreak.com" target="_blank">eric@uphreak.com</a> <mailto:<a href="mailto:eric@uphreak.com" target="_blank">eric@uphreak.com</a>>> wrote:<br>
>>>><br>
>>>>                     This is a ladder diagram, not a sip trace.  A<br>
>>>>                     ladder diagram is not useful in this case.<br>
>>>><br>
>>>>                     Turn your debug up to 4, capture the log of the<br>
>>>>                     register/500 happening and submit a link to the<br>
>>>>                     pastebin.  DO NOT paste the contents into an email.<br>
>>>><br>
>>>><br>
>>>>                     ______________________________<u></u>_________________<br>
>>>>                     Users mailing list<br>
>>>>                     <a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
>>>>                     <mailto:<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.<u></u>org</a>><br>
>>>>                     <a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-<u></u>bin/mailman/listinfo/users</a><br>
>>>><br>
>>>><br>
>>>><br>
>>>><br>
>>>>                 ______________________________<u></u>_________________<br>
>>>>                 Users mailing list<br>
>>>>                 <a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a> <mailto:<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.<u></u>org</a>><br>
>>>>                 <a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-<u></u>bin/mailman/listinfo/users</a><br>
>>><br>
>>><br>
>>><br>
>>>                 ______________________________<u></u>_________________<br>
>>>                 Users mailing list<br>
>>>                 <a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a> <mailto:<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.<u></u>org</a>><br>
>>>                 <a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-<u></u>bin/mailman/listinfo/users</a><br>
>><br>
>><br>
>>                 ______________________________<u></u>_________________<br>
>>                 Users mailing list<br>
>>                 <a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a> <mailto:<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.<u></u>org</a>><br>
>>                 <a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-<u></u>bin/mailman/listinfo/users</a><br>
>><br>
>><br>
>><br>
>><br>
>>             ______________________________<u></u>_________________<br>
>>             Users mailing list<br>
>>             <a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a> <mailto:<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.<u></u>org</a>><br>
>>             <a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-<u></u>bin/mailman/listinfo/users</a><br>
><br>
><br>
>             ______________________________<u></u>_________________<br>
>             Users mailing list<br>
>             <a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a> <mailto:<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.<u></u>org</a>><br>
>             <a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-<u></u>bin/mailman/listinfo/users</a><br>
><br>
><br>
><br>
><br>
><br>
><br>
> ______________________________<u></u>_________________<br>
> Users mailing list<br>
> <a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
> <a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-<u></u>bin/mailman/listinfo/users</a><br>
><br>
<br>
--<br>
Regards,<br>
Babil (Golam Sarwar)<br>
Skype: gsbabil<br>
Phone: +1-470-222-4511 (SMS and voice-mail only)<br>
<br>
PGP Key Fingerprint : D3A1 EED0 5BA0 72D3 A011 75CB 8EA6 7D99 F433 E92D<br>
PGP Key Download URL: <a href="http://bit.ly/gsbabil-pgp-key" target="_blank">http://bit.ly/gsbabil-pgp-key</a><br>
</blockquote></div>