Hello,

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:

        # accept calls from foo.com
        if ( is_method("INVITE")  )
        {
                rewritehost ("sipproxy.foo2.com");
                rewriteport ("");
        }

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.

However $rd can not be used in openser.cfg as follows:

if ( is_method("INVITE") && $rd="foo.com" )

Documentation suggests to use core keywords like:

            if(is_method("INVITE") && from_uri=~".*@foo.com")

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.

So my kind of overlapping questions are:

How can I use pseudo-variables in openser.cfg to test for a certain value?
How can I see (debug) the contents of a core keyword?
Which keyword should I be using to solve this issue?
Has anyone solved a similar issue in the past and if so can you please give some details?

Thanks,
Bas.