[Serusers] Route forward on condition

peterb cabalitomb at shaw.ca
Mon Sep 5 07:54:05 CEST 2005


I am not sure where I am failing on the expressions.  What I am trying to do
is if the source

Ip is correct along with the methods I want to send it to a possible of two
places 

one is to a pstn if it is not for the pstn maybe they are trying to reach a
user that is registered 

with the local domain.

 

It works on the pstn. On the local domain even if the src_ip is wrong it
still forwards the request as 

long as it sees the prefix 555555.  I want the src_ip to be correct also on
the request.

 

-------- snippet --------

 

if (src_ip==xxx.xxx.xxx.xxx & method=="INVITE" || method=="ACK" ||
method=="BYE") {

                     

                     if (uri=~"^sip:55555[0-9]{11}@") {  

                     strip(5);

                     setflag(1);

                     record_route();

                     rewritehost("xxx.xxx.xxx.xxx"); #pstn

                     };

               

                     if ( (uri=~"^sip:55555[0-9]{7}@") |
(uri=~"^sip:55555[0-9]{10}@") ) { 

                     strip(5);

                     record_route();

                     route(2); # local users

                     break;

                     };                   

                   }

------------ snippet end ----------------------

 

Would also like to be able to relay FWD requests 

 

Any thoughts ?

 

Thanks

 

Mr. B

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20050905/a58f5c2e/attachment.htm>


More information about the sr-users mailing list