[OpenSER-Users] How to compare $si with $dr

Klaus Darilion klaus.mailinglists at pernau.at
Tue Oct 30 16:47:32 CET 2007


Richard Bennett schrieb:
> Hi,
> I am trying to compare the values of 'IP source address' ($si) and   
> 'Domain in SIP Request's URI' ($rd) to see if they match in Openser 1.1.
> Probably I have missed the relevant documentation, I checked  
> http://www.openser.org/dokuwiki/doku.php/pseudovariables:1.1.x and  
> http://www.openser.org/dokuwiki/doku.php/core-cookbook:1.1.x .
> 
> Basically I'd like to do this:
> 
> if($si == $rd){
> 	#do something
> }

This does not work in 1.1, only in 1.2. In 1.1 you have to copy the 
values into AVPs and use avp_check().

Also the WIKI has lots of information:
http://www.openser.org/dokuwiki/doku.php/examples:caller-callee-behind-same-nat

regards
klaus



> 
> but that gives a syntax error.
> I also tried this:
> if(src_ip==$rd){
> }
> 
> but it seems the pseudo variable isn't being expanded before the  
> evaluation, as I don't get a match even though debugging shows $si and $rd  
> to be the same.
> 
> Also, is there anyway to pass a pseudo variable to rewritehost() or an  
> equivalent function?
> 
> Thanks for any pointers,
> 
> Richard
> 
> _______________________________________________
> Users mailing list
> Users at lists.openser.org
> http://lists.openser.org/cgi-bin/mailman/listinfo/users




More information about the Users mailing list