Hello,
I still think you are using some terminology that doesn't map on a the
right SIP specs terms, because a REGISTER should not have a Route
header. Can you paste here such REGISTER request so we see exactly what
you refer to?
Cheers,
Daniel
On 14.04.17 14:54, Narayan P wrote:
Hi Daniel,
Thanks for your response.
I mean to say,
In my register request the route header i.e. route_uri is <sip:185.122.205.178> and
contact header is 3333(a)172.22.13.41.
I want my contact header to be 3333(a)185.122.205.178.
So how can I replace the contact header's only domain part with route_uri.the user
part of the contact header remains same.
Thanks,
Narayan
________________________________________
From: Narayan P
Sent: Thursday, April 13, 2017 11:13 AM
To: sr-users(a)lists.sip-router.org
Subject: Re: Not able to replace route_uri in contact header uri
Hi ,
Can anybody help me how to replace the domain part of $route-uri in contact header .
I am using avp_subst().But kamailio is not starting.
I am new to kamailio.Any help will be highly appreciated.
Thanks,
Narayan
________________________________
From: Narayan P
Sent: Wednesday, April 12, 2017 8:17:02 AM
To: sr-users(a)lists.sip-router.org
Subject: Not able to replace route_uri in contact header uri
Hi All,
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.
I put some logs on route[REGISTRAR] and able to see the $route_uri as kamailio server
uri($avp(s:fs) and $hdr(Contact) as pjsip server uri ($avp(s:contact).But I am not able
to replace the uri with avp_subst() function.
Can anybody help me how to replace the uri or with any any other function.
Below I have put the snippet of config file.
# Handle SIP registrations
route[REGISTRAR] {
if (!is_method("REGISTER")) return;
if(isflagset(FLT_NATS)) {
setbflag(FLB_NATB);
#!ifdef WITH_NATSIPPING
# do SIP NAT pinging
setbflag(FLB_NATSIPPING);
#!endif
}
xlog("Narayan: before sending contact\n");
$avp(s:contact) = $hdr(Contact);
$avp(s:fs) = $route_uri;
xlog("Narayan: Forced socket is $avp(s:fs)\n");
xlog("Narayan: contact header is $avp(s:contact)\n");
avp_subst("$avp(s:contact)/avp(s:contac)/g",
"/(.*)(a)(.*)/$route_uri/")ri/");
#avp_pushto("$ru/domain","$fd");
#rewritehostport("185.122.206.62:5060");
t_on_reply("MANAGE_REPLY");
t_relay();
#if (!save("location")) {
# sl_reply_error();
#}
exit;
}
Any suggestion will be highly appreciated.
Thanks,
Narayan
_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users(a)lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
--
Daniel-Constantin Mierla
www.twitter.com/miconda --
www.linkedin.com/in/miconda
Kamailio Advanced Training - May 22-24 (USA) -
www.asipto.com
Kamailio World Conference - May 8-10, 2017 -
www.kamailioworld.com