<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.10.0">
</HEAD>
<BODY>
Thanks for that Daniel,<BR>
<BR>
Just implemented and tested OK. Just out of interest, how can I check the contents of core keywords? Is there a way I can see the value in a log file using xlog for instance?<BR>
<BR>
I failed to mention that I am using version 1.0.1 on Debian Sarge.<BR>
<BR>
Thanks,<BR>
Bas.<BR>
<BR>
On Tue, 2006-04-04 at 16:41 +0300, Daniel-Constantin Mierla wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">Hello,</FONT>
<FONT COLOR="#000000">to test the domain in R-URI you can use:</FONT>
<FONT COLOR="#000000">if(uri=~".<A HREF="mailto:*@foo.com">*@foo.com</A>")</FONT>
<FONT COLOR="#000000">With development version you can have:</FONT>
<FONT COLOR="#000000">if(avp_check("$rd", "eq/foo.com/i"))</FONT>
<FONT COLOR="#000000">Using pseudo-variables direct from script is in roadmap and will be </FONT>
<FONT COLOR="#000000">added in the future.</FONT>
<FONT COLOR="#000000">Cheers,</FONT>
<FONT COLOR="#000000">Daniel</FONT>
<FONT COLOR="#000000">On 04/04/06 14:36, Bas Driessen wrote:</FONT>
<FONT COLOR="#000000">> Hello,</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> I would like to test for the domain name in a sip request to decide if </FONT>
<FONT COLOR="#000000">> an invite is accepted or not. I have the following lines in my </FONT>
<FONT COLOR="#000000">> openser.cfg file to cater for DNS SRV forwarding:</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> # accept calls from foo.com</FONT>
<FONT COLOR="#000000">> if ( is_method("INVITE") )</FONT>
<FONT COLOR="#000000">> {</FONT>
<FONT COLOR="#000000">> rewritehost ("sipproxy.foo2.com");</FONT>
<FONT COLOR="#000000">> rewriteport ("");</FONT>
<FONT COLOR="#000000">> }</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> This works well, but I would like to tighten security by only allowing </FONT>
<FONT COLOR="#000000">> invites forwarded by foo.com. When debugging using xlog calls, the </FONT>
<FONT COLOR="#000000">> pseudo-variable I am after is : $rd.</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> However $rd can not be used in openser.cfg as follows:</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> if ( is_method("INVITE") && $rd="foo.com" )</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> Documentation suggests to use core keywords like:</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> if(is_method("INVITE") && from_uri=~".<A HREF="mailto:*@foo.com">*@foo.com</A>")</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> This does not work for my situation and I don't know how I can see the </FONT>
<FONT COLOR="#000000">> value of 'from_uri', as it can't be expanded into xlog calls.</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> So my kind of overlapping questions are:</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> How can I use pseudo-variables in openser.cfg to test for a certain value?</FONT>
<FONT COLOR="#000000">> How can I see (debug) the contents of a core keyword?</FONT>
<FONT COLOR="#000000">> Which keyword should I be using to solve this issue?</FONT>
<FONT COLOR="#000000">> Has anyone solved a similar issue in the past and if so can you please </FONT>
<FONT COLOR="#000000">> give some details?</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> Thanks,</FONT>
<FONT COLOR="#000000">> Bas.</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> ------------------------------------------------------------------------</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> _______________________________________________</FONT>
<FONT COLOR="#000000">> Users mailing list</FONT>
<FONT COLOR="#000000">> <A HREF="mailto:Users@openser.org">Users@openser.org</A></FONT>
<FONT COLOR="#000000">> <A HREF="http://openser.org/cgi-bin/mailman/listinfo/users">http://openser.org/cgi-bin/mailman/listinfo/users</A></FONT>
<FONT COLOR="#000000">> </FONT>
</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>