[OpenSIPS-Users] How to prevent error when using invalid index on s.select

Bogdan-Andrei Iancu bogdan at voice-system.ro
Tue Apr 13 12:18:07 CEST 2010


Hi Brett,

the following script :
    $var(s)="1,2,3,4";
    $var(i)= 4;
    xlog("----------$(var(s){s.select,$var(i),,})\n");
    xlog("----------\n");
    $var(x) = $(var(s){s.select,$var(i),,});

does not produce the error you mentioned...

maybe you have something different ?

Regards,
Bogdan

Brett Nemeroff wrote:
> Hello List,
> I'm using s.select to iterate over a list of values. I don't know how
> big the list is so I'm going to hit the end and it's going to error
> out..
>
> OpenSIPs produces an ERROR on this and I'd like to suppress this
> error. I've typically seen this performed in an eval or perhaps by
> knowing ahead of time how big the array is (which I don't know).
>
> So is there a right way to do this to not get the error?
>
> Here's what I'm getting:
> Apr 12 20:16:37 domU-XX-XX-XX-XX-XX-XX /usr/local/sbin/opensips[2611]:
> ERROR:core:eval_elem: invalid string operands
> Apr 12 20:16:37 domU-XX-XX-XX-XX-XX-XX /usr/local/sbin/opensips[2611]:
> ERROR:core:do_assign: no value in right expression
> Apr 12 20:16:37 domU-XX-XX-XX-XX-XX-XX /usr/local/sbin/opensips[2611]:
> ERROR:core:do_assign: error at line: 514
>
> Thanks,
> Brett
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>   


-- 
Bogdan-Andrei Iancu
www.voice-system.ro




More information about the Users mailing list