<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif;" dir="ltr">
<p></p>
<div>Hi All,<br>
<br>
I am using pjsip client and kamailiio,both running on different servers.I want to replace the uri on which pjsip is running with the uri on which kamailio is running in contact header.<br>
I put some logs on route[REGISTRAR] and able to see the $route_uri as kamailio server uri(<span>$avp(s:fs</span>) and 
<span>$hdr(Contact)</span> as pjsip server uri <span>($avp(s:contact</span>).But I am not able to replace the uri with avp_subst() function.<br>
<br>
Can anybody help me how to replace the uri or with any any other function.<br>
<br>
Below I have put the snippet of config file.<br>
<br>
<br>
# Handle SIP registrations<span></span><br>
route[REGISTRAR] {<br>
        if (!is_method("REGISTER")) return;<br>
<br>
        if(isflagset(FLT_NATS)) {<br>
                setbflag(FLB_NATB);<br>
#!ifdef WITH_NATSIPPING<br>
                # do SIP NAT pinging<br>
                setbflag(FLB_NATSIPPING);<br>
#!endif<br>
        }<br>
        xlog("Narayan: before sending contact\n");        <br>
        $avp(s:contact) = $hdr(Contact);<br>
        $avp(s:fs) = $route_uri;<br>
        xlog("Narayan: Forced socket is $avp(s:fs)\n");<br>
        xlog("Narayan: contact header is $avp(s:contact)\n");<br>
        avp_subst("$avp(s:contact)/avp(s:contac)/g", "/(.*)@(.*)/$route_uri/");<br>
        #avp_pushto("$ru/domain","$fd");<br>
        #rewritehostport("185.122.206.62:5060");<br>
        t_on_reply("MANAGE_REPLY");<br>
        t_relay();<br>
        #if (!save("location")) {<br>
        #       sl_reply_error();<br>
        #}<br>
        exit;<br>
}<br>
<br>
<br>
Any suggestion will be highly appreciated.<br>
<br>
<br>
Thanks,<br>
Narayan<br>
</div>
<br>
<p></p>
</div>
</body>
</html>