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

Jamin W. Collins jcollins at asgardsrealm.net
Wed May 21 23:14:01 CEST 2003


I'm at a bit of a loss, I've got a number of SER proxies in use and all
are working quite well with one exception.

I've configured the proxies to sit between SIP handsets and a SIP
capable PBX.  All phones register with the proxy at their location and
the PBX makes all requests for phones to the proxy.  This normally works
well.  However, for the phones to be able to place outbound calls, I
configured the SER proxy to pass all location lookup failures on to the
PBX.  The PBX then (seeing the request from a registered location) will
place the call out.  All of this works fine.


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") {

         log(1, "Request from first server.");
         sl_reply_error();         

      } else {
      
         rewritehost("1.2.3.4");
         log (1, "Sending request to the first server.");
         t_on_negative("1");       
         t_relay();                
      };
   
      break;
   }; 

-- 
Jamin W. Collins

This is the typical unix way of doing things: you string together lots
of very specific tools to accomplish larger tasks. -- Vineet Kumar




More information about the sr-users mailing list