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