[SR-Users] Need help in rewriting the Request URI

Ajay Sabat Ajay.Sabat at panasonic.aero
Thu Feb 7 04:08:06 CET 2013


Hi,

I use Kamailio for basic call setup with one exception where it has to route call to another server by seeing the domain name in the Request URI.
If the Request uri in the received INVITE message looks like "sip12345 at video-conf", then it should route the INVITE request to the video-conf server by resolving the domain name. I changed the config file kamailio.cfg as given below.

route[SIPOUT] {
                if (!uri==myself)
                {
                                append_hf("P-hint: outbound\r\n");
# AKS: call routing
                                if (uri=~".*@video-conf")
                                {
                                                rewritehost("video-conf");
                                }
# AKS
                                route(RELAY);
                }
}

It resolves the domain name and routes the INVITE message to the resolved IP address. However it uses the domain name in the Request line and To header and I need to replace domain with the resolved IP address in the Request URI and To header.
Now Request URI and To header look like "INVITE sip:12345 at video-conf" and "To: <sip:12345:video-conf>" respectively and I need them as "INVITE sip:12345 at video-conf" and "To: <sip:12345:video-conf>".

I don't have any knowledge in tweaking  kamailio. I tried some tricks like the following by going through documents and  pervious emails in the forum. But it didn't work. Some of them have spoken about avp and pseudo variables. But I am getting confused as I have just begun using Kamailio and it is vast.
# $ru = "sip:" + $rU + "@" + to_ip;

I will appreciate if you could help me or guide me in right direction.

Thanks,
Ajay


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20130207/45a27a9a/attachment.htm>


More information about the sr-users mailing list