[SR-Users] Problem with 'break' in a 'Switch' body
Edson - Lists
4lists at gmail.com
Thu May 28 20:32:15 CEST 2009
Sorry... I forgot to mention that:
Kamailio 1.5.1-notls SVN 2:5858
Just retested on the real script and it gives me "syntax error" on each
line that had the break statement...
Edson.
Daniel-Constantin Mierla escreveu:
> Hello,
>
> are you using latest sr from git of http://sip-router.org?
>
> I just tested something similar and it starts.
>
> Cheers,
> Daniel
>
>
> On 05/28/2009 09:01 PM, Edson - Lists wrote:
>> Hi, Guys...
>>
>> I use a 'switch' block to drive decisions after a failed 'lookup' (on
>> router-block). In theory all Ok, but....
>>
>> In the body of this switch, if I use a 'break' inside an 'if' it gives
>> me error, saying that it's not allowed.
>>
>> See below the code.
>>
>> What am I doing wrong?
>>
>> Edson.
>>
>> ========================================================
>> route[1] {
>> if (!lookup("location") {
>> switch ($retcode) {
>> case -1:
>> case -3:
>> if ('situation A') {
>> t_on_failure("1");
>> break;
>> } else {
>> if ('condition b') {
>> if ('condition b.1') {
>> t_on_failure("2");
>> break;
>> };
>> };
>> };
>> exit;
>> case -2:
>> sl_send_reply("500", "Internal lookup error");
>> exit;
>> }
>> }
>> if (!t_relay()) {
>> sl_reply_error();
>> }
>> exit;
>> }
>>
>> _______________________________________________
>> sr-users mailing list
>> sr-users at lists.sip-router.org
>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>>
>
More information about the sr-users
mailing list