<!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>
# accept calls from foo.com<BR>
if ( is_method("INVITE") )<BR>
{<BR>
rewritehost ("sipproxy.foo2.com");<BR>
rewriteport ("");<BR>
}<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("INVITE") && $rd="foo.com" )<BR>
<BR>
Documentation suggests to use core keywords like:<BR>
<BR>
if(is_method("INVITE") && from_uri=~".*@foo.com")<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>