<!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=~&quot;.<A HREF="mailto:*@foo.com">*@foo.com</A>&quot;)</FONT>

<FONT COLOR="#000000">With development version you can have:</FONT>

<FONT COLOR="#000000">if(avp_check(&quot;$rd&quot;, &quot;eq/foo.com/i&quot;))</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">&gt; Hello,</FONT>
<FONT COLOR="#000000">&gt;</FONT>
<FONT COLOR="#000000">&gt; I would like to test for the domain name in a sip request to decide if </FONT>
<FONT COLOR="#000000">&gt; an invite is accepted or not. I have the following lines in my </FONT>
<FONT COLOR="#000000">&gt; openser.cfg file to cater for DNS SRV forwarding:</FONT>
<FONT COLOR="#000000">&gt;</FONT>
<FONT COLOR="#000000">&gt;         # accept calls from foo.com</FONT>
<FONT COLOR="#000000">&gt;         if ( is_method(&quot;INVITE&quot;)  )</FONT>
<FONT COLOR="#000000">&gt;         {</FONT>
<FONT COLOR="#000000">&gt;                 rewritehost (&quot;sipproxy.foo2.com&quot;);</FONT>
<FONT COLOR="#000000">&gt;                 rewriteport (&quot;&quot;);</FONT>
<FONT COLOR="#000000">&gt;         }</FONT>
<FONT COLOR="#000000">&gt;</FONT>
<FONT COLOR="#000000">&gt; This works well, but I would like to tighten security by only allowing </FONT>
<FONT COLOR="#000000">&gt; invites forwarded by foo.com. When debugging using xlog calls, the </FONT>
<FONT COLOR="#000000">&gt; pseudo-variable I am after is : $rd.</FONT>
<FONT COLOR="#000000">&gt;</FONT>
<FONT COLOR="#000000">&gt; However $rd can not be used in openser.cfg as follows:</FONT>
<FONT COLOR="#000000">&gt;</FONT>
<FONT COLOR="#000000">&gt; if ( is_method(&quot;INVITE&quot;) &amp;&amp; $rd=&quot;foo.com&quot; )</FONT>
<FONT COLOR="#000000">&gt;</FONT>
<FONT COLOR="#000000">&gt; Documentation suggests to use core keywords like:</FONT>
<FONT COLOR="#000000">&gt;</FONT>
<FONT COLOR="#000000">&gt;             if(is_method(&quot;INVITE&quot;) &amp;&amp; from_uri=~&quot;.<A HREF="mailto:*@foo.com">*@foo.com</A>&quot;)</FONT>
<FONT COLOR="#000000">&gt;</FONT>
<FONT COLOR="#000000">&gt; This does not work for my situation and I don't know how I can see the </FONT>
<FONT COLOR="#000000">&gt; value of 'from_uri', as it can't be expanded into xlog calls.</FONT>
<FONT COLOR="#000000">&gt;</FONT>
<FONT COLOR="#000000">&gt; So my kind of overlapping questions are:</FONT>
<FONT COLOR="#000000">&gt;</FONT>
<FONT COLOR="#000000">&gt; How can I use pseudo-variables in openser.cfg to test for a certain value?</FONT>
<FONT COLOR="#000000">&gt; How can I see (debug) the contents of a core keyword?</FONT>
<FONT COLOR="#000000">&gt; Which keyword should I be using to solve this issue?</FONT>
<FONT COLOR="#000000">&gt; Has anyone solved a similar issue in the past and if so can you please </FONT>
<FONT COLOR="#000000">&gt; give some details?</FONT>
<FONT COLOR="#000000">&gt;</FONT>
<FONT COLOR="#000000">&gt; Thanks,</FONT>
<FONT COLOR="#000000">&gt; Bas.</FONT>
<FONT COLOR="#000000">&gt;</FONT>
<FONT COLOR="#000000">&gt; ------------------------------------------------------------------------</FONT>
<FONT COLOR="#000000">&gt;</FONT>
<FONT COLOR="#000000">&gt; _______________________________________________</FONT>
<FONT COLOR="#000000">&gt; Users mailing list</FONT>
<FONT COLOR="#000000">&gt; <A HREF="mailto:Users@openser.org">Users@openser.org</A></FONT>
<FONT COLOR="#000000">&gt; <A HREF="http://openser.org/cgi-bin/mailman/listinfo/users">http://openser.org/cgi-bin/mailman/listinfo/users</A></FONT>
<FONT COLOR="#000000">&gt;   </FONT>
</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>