[Users] How to test for domain in sip request in openser.cfg.

Bas Driessen bas.driessen at xobas.com
Tue Apr 4 13:36:43 CEST 2006


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. 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kamailio.org/pipermail/users/attachments/20060404/3767913e/attachment.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
Url : http://lists.kamailio.org/pipermail/users/attachments/20060404/3767913e/attachment.pgp 


More information about the Users mailing list