[Serusers] Matching of src_ip, what am I doing wrong?

Andrei Pelinescu-Onciul pelinescu-onciul at fokus.fraunhofer.de
Thu May 22 14:04:37 CEST 2003


On May 21, 2003 at 23:23, Nils Ohlmeier <nils at iptel.org> wrote:
> Hi,
> 
> On Wednesday 21 May 2003 23:14, Jamin W. Collins wrote:
> > The problem comes when one of the phones is not registered properly with
> > the SER proxy and the PBX requests it.  The request fails the location
> > lookup and is sent back to the PBX.  To correct this I've tried matching
> > the "src_ip" to see if the request is from the PBX however this doesn't
> > appear to work.  I have the following condition in the ser.cfg,
> > shouldn't this stop requests from 1.2.3.4 being sent back to 1.2.3.4?
> >
> >    if (!lookup("location")) {
> >
> >       log(1, "Location lookup failure.");
> >
> >       if (src_ip=="1.2.3.4") || (src_ip=="1.2.3.6") {
>                     ^       ^              ^       ^
> Please remove the "" around the IPs.

This is a bug. I will fix it. Anyway is faster not to use "" (using
quotes will perform a rev. dns lookup if the argument is a name and not
an ip).

> And i'm not sure if the () || () works for an if. Please try (()||()) instead 
It works (or at least it should).


Andrei




More information about the sr-users mailing list