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", "/(.*)@(.*)/$route_uri/"); #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
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@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", "/(.*)@(.*)/$route_uri/"); #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
Hello,
can you paste here a sample SIP request and point what part of it do you want to update? Otherwise I don't understand what do you mean by "the domain part of $route-uri in contact header".
Cheers, Daniel
On 13.04.17 13:13, Narayan P wrote:
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@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", "/(.*)@(.*)/$route_uri/"); #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@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
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@172.22.13.41. I want my contact header to be 3333@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@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@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", "/(.*)@(.*)/$route_uri/"); #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
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@172.22.13.41. I want my contact header to be 3333@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@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@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", "/(.*)@(.*)/$route_uri/"); #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@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Hi Daniel,
I am attaching here my sip trace at client side.Request you to see this.
My client IP in register request is 125.16.231.74 and the server on which kamailio is running is 185.122.205.178.
I want my contact header to be sip:OTT919620649614@185.122.205.178:5070;lr
I am using avp_subst() function to replace this.But kamailio is not starting.
Please reply if I am in wrong way or have different understanding as I am very new to kamailio.
Thanks,
Narayan
________________________________ From: Narayan P Sent: Friday, April 14, 2017 12:54:25 PM To: sr-users@lists.sip-router.org Cc: moconda@gmail.com Subject: RE: Not able to replace route_uri in contact header uri
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@172.22.13.41. I want my contact header to be 3333@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@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@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", "/(.*)@(.*)/$route_uri/"); #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
Hello,
to clarify, in the REGISTER you sent and pasted again below, from
Contact: sip:OTT919620649614@125.16.231.74:25841;ob
you want to have:
Contact: sip:OTT919620649614@185.122.205.178:5070;lr
If yes, then this doesn't look right at all, then the device cannot receive calls anymore. Maybe you can explain the purpose and then we may be able to offer some hints.
Cheers, Daniel
REGISTER sip:185.122.206.62 SIP/2.0 Via: SIP/2.0/UDP 125.16.231.74:25841;rport;branch=z9hG4bKPj592750e4-9a06-4662-a55e-a8a71dedb974 Route: sip:185.122.205.178:5070;lr Max-Forwards: 70 From: sip:OTT919620649614@185.122.206.62;tag=35af1666-a2b1-4c6e-a7b6-8675845036e7 To: sip:OTT919620649614@185.122.206.62 Call-ID: 5bc6558f-1ffc-4990-bc99-d099c4fdcbcb CSeq: 41801 REGISTER User-Agent: PJSUA v2.3 Linux-4.4.0.64/x86_64/glibc-2.19 Contact: sip:OTT919620649614@125.16.231.74:25841;ob Expires: 300 Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS Authorization: Digest username="OTT919620649614", realm="185.122.206.62", nonce="af7780946d2b72ddc5e765a68798e937", uri="sip:185.122.206.62", response="a4c0614fbc3c72ece619247de5766a4b", algorithm=MD5 Content-Length: 0
SIP/2.0 200 OK Via: SIP/2.0/UDP 125.16.231.74:25841;rport=25841;branch=z9hG4bKPj592750e4-9a06-4662-a55e-a8a71dedb974;received=125.16.231.74 From: sip:OTT919620649614@185.122.206.62;tag=35af1666-a2b1-4c6e-a7b6-8675845036e7 Call-ID: 5bc6558f-1ffc-4990-bc99-d099c4fdcbcb CSeq: 41801 REGISTER To: sip:OTT919620649614@185.122.206.62;tag=1492409213989 Expires: 50 Contact: sip:OTT919620649614@125.16.231.74:25841;ob;expires=50 Content-Length: 0
On 17.04.17 08:38, Narayan P wrote:
Hi Daniel,
I am attaching here my sip trace at client side.Request you to see this.
My client IP in register request is 125.16.231.74 and the server on which kamailio is running is 185.122.205.178.
I want my contact header to be sip:OTT919620649614@185.122.205.178:5070;lr
I am using avp_subst() function to replace this.But kamailio is not starting.
Please reply if I am in wrong way or have different understanding as I am very new to kamailio.
Thanks,
Narayan
*From:* Narayan P *Sent:* Friday, April 14, 2017 12:54:25 PM *To:* sr-users@lists.sip-router.org *Cc:* moconda@gmail.com *Subject:* RE: Not able to replace route_uri in contact header uri
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@172.22.13.41. I want my contact header to be 3333@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
Thanks for your kind Response Daniel,
Yes as you told with the requirement I have mentioned call will not reach client, I have explained my requirement in detail,
My requirement is to establish a call between 2 SIP clients Alice and Bob which are using 185.122.205.178(Kamailio) as outbound proxy and registered to a SIP SERVER,
I am not able to establish call between Alice and Bob, So I am trying to Replace the Contact header in Register request with Kamailio IP and then I will direct the Invite request to callee client using the data(Username to IP:port tuple) I have stored in Kamailio database.
Please suggest me if you have better Idea than what i am doing
Thanks & Regards
Narayan
________________________________ From: Daniel-Constantin Mierla miconda@gmail.com Sent: Tuesday, April 18, 2017 1:04:38 PM To: Narayan P; sr-users@lists.sip-router.org Subject: Re: Not able to replace route_uri in contact header uri
Hello,
to clarify, in the REGISTER you sent and pasted again below, from
Contact: sip:OTT919620649614@125.16.231.74:25841;obsip:OTT919620649614@125.16.231.74:25841;ob
you want to have:
Contact: sip:OTT919620649614@185.122.205.178:5070;lrsip:OTT919620649614@185.122.205.178:5070;lr
If yes, then this doesn't look right at all, then the device cannot receive calls anymore. Maybe you can explain the purpose and then we may be able to offer some hints.
Cheers, Daniel
REGISTER sip:185.122.206.62 SIP/2.0 Via: SIP/2.0/UDP 125.16.231.74:25841;rport;branch=z9hG4bKPj592750e4-9a06-4662-a55e-a8a71dedb974 Route: sip:185.122.205.178:5070;lrsip:185.122.205.178:5070;lr Max-Forwards: 70 From: sip:OTT919620649614@185.122.206.62sip:OTT919620649614@185.122.206.62;tag=35af1666-a2b1-4c6e-a7b6-8675845036e7 To: sip:OTT919620649614@185.122.206.62sip:OTT919620649614@185.122.206.62 Call-ID: 5bc6558f-1ffc-4990-bc99-d099c4fdcbcb CSeq: 41801 REGISTER User-Agent: PJSUA v2.3 Linux-4.4.0.64/x86_64/glibc-2.19 Contact: sip:OTT919620649614@125.16.231.74:25841;obsip:OTT919620649614@125.16.231.74:25841;ob Expires: 300 Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS Authorization: Digest username="OTT919620649614", realm="185.122.206.62", nonce="af7780946d2b72ddc5e765a68798e937", uri="sip:185.122.206.62"sip:185.122.206.62, response="a4c0614fbc3c72ece619247de5766a4b", algorithm=MD5 Content-Length: 0
SIP/2.0 200 OK Via: SIP/2.0/UDP 125.16.231.74:25841;rport=25841;branch=z9hG4bKPj592750e4-9a06-4662-a55e-a8a71dedb974;received=125.16.231.74 From: sip:OTT919620649614@185.122.206.62sip:OTT919620649614@185.122.206.62;tag=35af1666-a2b1-4c6e-a7b6-8675845036e7 Call-ID: 5bc6558f-1ffc-4990-bc99-d099c4fdcbcb CSeq: 41801 REGISTER To: sip:OTT919620649614@185.122.206.62sip:OTT919620649614@185.122.206.62;tag=1492409213989 Expires: 50 Contact: sip:OTT919620649614@125.16.231.74:25841;obsip:OTT919620649614@125.16.231.74:25841;ob;expires=50 Content-Length: 0
On 17.04.17 08:38, Narayan P wrote:
Hi Daniel,
I am attaching here my sip trace at client side.Request you to see this.
My client IP in register request is 125.16.231.74 and the server on which kamailio is running is 185.122.205.178.
I want my contact header to be sip:OTT919620649614@185.122.205.178:5070;lrsip:OTT919620649614@185.122.205.178:5070;lr
I am using avp_subst() function to replace this.But kamailio is not starting.
Please reply if I am in wrong way or have different understanding as I am very new to kamailio.
Thanks,
Narayan
________________________________ From: Narayan P Sent: Friday, April 14, 2017 12:54:25 PM To: sr-users@lists.sip-router.orgmailto:sr-users@lists.sip-router.org Cc: moconda@gmail.commailto:moconda@gmail.com Subject: RE: Not able to replace route_uri in contact header uri
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.178sip:185.122.205.178 and contact header is 3333@172.22.13.41mailto:3333@172.22.13.41. I want my contact header to be 3333@185.122.205.178mailto:3333@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
-- Daniel-Constantin Mierla www.twitter.com/micondahttp://www.twitter.com/miconda -- www.linkedin.com/in/micondahttp://www.linkedin.com/in/miconda Kamailio Advanced Training - May 22-24 (USA) - www.asipto.comhttp://www.asipto.com Kamailio World Conference - May 8-10, 2017 - www.kamailioworld.comhttp://www.kamailioworld.com
Instead of doing this manually go for path header if your SIP SERVER supports it. https://www.kamailio.org/docs/modules/devel/modules/path.html
On 20 April 2017 at 19:09, Narayan P narayana88@outlook.com wrote:
Thanks for your kind Response Daniel,
Yes as you told with the requirement I have mentioned call will not reach client, I have explained my requirement in detail,
My requirement is to establish a call between 2 SIP clients Alice and Bob which are using 185.122.205.178(Kamailio) as outbound proxy and registered to a SIP SERVER,
I am not able to establish call between Alice and Bob, So I am trying to Replace the Contact header in Register request with Kamailio IP and then I will direct the Invite request to callee client using the data(Username to IP:port tuple) I have stored in Kamailio database.
Please suggest me if you have better Idea than what i am doing
Thanks & Regards
Narayan
*From:* Daniel-Constantin Mierla miconda@gmail.com *Sent:* Tuesday, April 18, 2017 1:04:38 PM *To:* Narayan P; sr-users@lists.sip-router.org *Subject:* Re: Not able to replace route_uri in contact header uri
Hello,
to clarify, in the REGISTER you sent and pasted again below, from
Contact: sip:OTT919620649614@125.16.231.74:25841;ob
you want to have:
Contact: sip:OTT919620649614@185.122.205.178:5070;lr
If yes, then this doesn't look right at all, then the device cannot receive calls anymore. Maybe you can explain the purpose and then we may be able to offer some hints.
Cheers, Daniel
REGISTER sip:185.122.206.62 SIP/2.0 Via: SIP/2.0/UDP 125.16.231.74:25841;rport;branch=z9hG4bKPj592750e4-9a06-4662-a55e-a8a71dedb974 Route: sip:185.122.205.178:5070;lr Max-Forwards: 70 From: sip:OTT919620649614@185.122.206.62;tag=35af1666-a2b1-4c6e-a7b6-8675845036e7 To: sip:OTT919620649614@185.122.206.62 Call-ID: 5bc6558f-1ffc-4990-bc99-d099c4fdcbcb CSeq: 41801 REGISTER User-Agent: PJSUA v2.3 Linux-4.4.0.64/x86_64/glibc-2.19 Contact: sip:OTT919620649614@125.16.231.74:25841;ob Expires: 300 Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS Authorization: Digest username="OTT919620649614", realm="185.122.206.62", nonce="af7780946d2b72ddc5e765a68798e937", uri="sip:185.122.206.62", response="a4c0614fbc3c72ece619247de5766a4b", algorithm=MD5 Content-Length: 0
SIP/2.0 200 OK Via: SIP/2.0/UDP 125.16.231.74:25841;rport=25841;branch=z9hG4bKPj592750e4-9a06-4662-a55e-a8a71dedb974;received=125.16.231.74 From: sip:OTT919620649614@185.122.206.62;tag=35af1666-a2b1-4c6e-a7b6-8675845036e7 Call-ID: 5bc6558f-1ffc-4990-bc99-d099c4fdcbcb CSeq: 41801 REGISTER To: sip:OTT919620649614@185.122.206.62;tag=1492409213989 Expires: 50 Contact: sip:OTT919620649614@125.16.231.74:25841;ob;expires=50 Content-Length: 0
On 17.04.17 08:38, Narayan P wrote:
Hi Daniel,
I am attaching here my sip trace at client side.Request you to see this.
My client IP in register request is 125.16.231.74 and the server on which kamailio is running is 185.122.205.178.
I want my contact header to be sip:OTT919620649614@185.122. 205.178:5070;lr
I am using avp_subst() function to replace this.But kamailio is not starting.
Please reply if I am in wrong way or have different understanding as I am very new to kamailio.
Thanks,
Narayan
*From:* Narayan P *Sent:* Friday, April 14, 2017 12:54:25 PM *To:* sr-users@lists.sip-router.org *Cc:* moconda@gmail.com *Subject:* RE: Not able to replace route_uri in contact header uri
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@172.22.13.41. I want my contact header to be 3333@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
-- Daniel-Constantin Mierlawww.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
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Hello,
skipping to understand exactly the purpose of what you want to achieve, if you want to replace the contact header uri with [username from old Contact]@[kamailio ip]:[kamailio port] , you can try this:
if(is_present_hf("Contact")) {
remove_hf("Contact");
append_hf("Contact: sip:$(ct{tobody.user})@$Ri:$Rp\r\n)");
}
If doesn't work, let me know.
Cheers, Daniel
On 20.04.17 16:09, Narayan P wrote:
Thanks for your kind Response Daniel,
Yes as you told with the requirement I have mentioned call will not reach client, I have explained my requirement in detail,
My requirement is to establish a call between 2 SIP clients Alice and Bob which are using 185.122.205.178(Kamailio) as outbound proxy and registered to a SIP SERVER,
I am not able to establish call between Alice and Bob, So I am trying to Replace the Contact header in Register request with Kamailio IP and then I will direct the Invite request to callee client using the data(Username to IP:port tuple) I have stored in Kamailio database.
Please suggest me if you have better Idea than what i am doing
Thanks & Regards
Narayan
*From:* Daniel-Constantin Mierla miconda@gmail.com *Sent:* Tuesday, April 18, 2017 1:04:38 PM *To:* Narayan P; sr-users@lists.sip-router.org *Subject:* Re: Not able to replace route_uri in contact header uri
Hello,
to clarify, in the REGISTER you sent and pasted again below, from
Contact: sip:OTT919620649614@125.16.231.74:25841;ob
you want to have:
Contact: sip:OTT919620649614@185.122.205.178:5070;lr
If yes, then this doesn't look right at all, then the device cannot receive calls anymore. Maybe you can explain the purpose and then we may be able to offer some hints.
Cheers, Daniel
REGISTER sip:185.122.206.62 SIP/2.0 Via: SIP/2.0/UDP 125.16.231.74:25841;rport;branch=z9hG4bKPj592750e4-9a06-4662-a55e-a8a71dedb974 Route: sip:185.122.205.178:5070;lr Max-Forwards: 70 From: sip:OTT919620649614@185.122.206.62;tag=35af1666-a2b1-4c6e-a7b6-8675845036e7 To: sip:OTT919620649614@185.122.206.62 Call-ID: 5bc6558f-1ffc-4990-bc99-d099c4fdcbcb CSeq: 41801 REGISTER User-Agent: PJSUA v2.3 Linux-4.4.0.64/x86_64/glibc-2.19 Contact: sip:OTT919620649614@125.16.231.74:25841;ob Expires: 300 Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS Authorization: Digest username="OTT919620649614", realm="185.122.206.62", nonce="af7780946d2b72ddc5e765a68798e937", uri="sip:185.122.206.62", response="a4c0614fbc3c72ece619247de5766a4b", algorithm=MD5 Content-Length: 0
SIP/2.0 200 OK Via: SIP/2.0/UDP 125.16.231.74:25841;rport=25841;branch=z9hG4bKPj592750e4-9a06-4662-a55e-a8a71dedb974;received=125.16.231.74 From: sip:OTT919620649614@185.122.206.62;tag=35af1666-a2b1-4c6e-a7b6-8675845036e7 Call-ID: 5bc6558f-1ffc-4990-bc99-d099c4fdcbcb CSeq: 41801 REGISTER To: sip:OTT919620649614@185.122.206.62;tag=1492409213989 Expires: 50 Contact: sip:OTT919620649614@125.16.231.74:25841;ob;expires=50 Content-Length: 0
On 17.04.17 08:38, Narayan P wrote:
Hi Daniel,
I am attaching here my sip trace at client side.Request you to see this.
My client IP in register request is 125.16.231.74 and the server on which kamailio is running is 185.122.205.178.
I want my contact header to be sip:OTT919620649614@185.122.205.178:5070;lr
I am using avp_subst() function to replace this.But kamailio is not starting.
Please reply if I am in wrong way or have different understanding as I am very new to kamailio.
Thanks,
Narayan
*From:* Narayan P *Sent:* Friday, April 14, 2017 12:54:25 PM *To:* sr-users@lists.sip-router.org *Cc:* moconda@gmail.com *Subject:* RE: Not able to replace route_uri in contact header uri
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@172.22.13.41. I want my contact header to be 3333@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
-- 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
Hi Daniel,
Thanks for your response.I have added this in the registrar module but it didn't work.
Please see the sip trace.
-end msg-- 17:28:47.162 sip_endpoint.c .Response msg 408/REGISTER/cseq=52880 (rdata0x231b418) from 185.122.205.178:5070 was dropped/unhandled by any modules 17:28:47.404 pjsua_core.c .TX 597 bytes Request msg REGISTER/cseq=3179 (tdta0x2320060) to UDP 185.122.205.178:5070: REGISTER sip:185.122.205.178:5070 SIP/2.0 Via: SIP/2.0/UDP 172.22.13.41:5067;rport;branch=z9hG4bKPjd734f1a6-d644-4a96-913c-c31738a33eed Max-Forwards: 70 From: sip:OTT919620649614@185.122.205.178;tag=9f62c1ea-36a3-4318-a767-55a6b278fd23 To: sip:OTT919620649614@185.122.205.178 Call-ID: 6fc0b9f9-8439-4fc6-a28e-05ce1e52ec80 CSeq: 3179 REGISTER User-Agent: PJSUA v2.3 Linux-4.4.0.64/x86_64/glibc-2.19 Contact: sip:OTT919620649614@172.22.13.41:5067;ob Expires: 300 Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS Content-Length: 0
Thanks,
Narayan
________________________________ From: Daniel-Constantin Mierla miconda@gmail.com Sent: Friday, April 21, 2017 9:36:37 AM To: Narayan P; sr-users@lists.sip-router.org Subject: Re: Not able to replace route_uri in contact header uri
Hello,
skipping to understand exactly the purpose of what you want to achieve, if you want to replace the contact header uri with [username from old Contact]@[kamailio ip]:[kamailio port] , you can try this:
if(is_present_hf("Contact")) {
remove_hf("Contact");
append_hf("Contact: sip:$(ct{tobody.user})@$Ri:$Rpsip:$(ct{tobody.user})@$Ri:$Rp\r\n)");
}
If doesn't work, let me know.
Cheers, Daniel
On 20.04.17 16:09, Narayan P wrote:
Thanks for your kind Response Daniel,
Yes as you told with the requirement I have mentioned call will not reach client, I have explained my requirement in detail,
My requirement is to establish a call between 2 SIP clients Alice and Bob which are using 185.122.205.178(Kamailio) as outbound proxy and registered to a SIP SERVER,
I am not able to establish call between Alice and Bob, So I am trying to Replace the Contact header in Register request with Kamailio IP and then I will direct the Invite request to callee client using the data(Username to IP:port tuple) I have stored in Kamailio database.
Please suggest me if you have better Idea than what i am doing
Thanks & Regards
Narayan
________________________________ From: Daniel-Constantin Mierla miconda@gmail.commailto:miconda@gmail.com Sent: Tuesday, April 18, 2017 1:04:38 PM To: Narayan P; sr-users@lists.sip-router.orgmailto:sr-users@lists.sip-router.org Subject: Re: Not able to replace route_uri in contact header uri
Hello,
to clarify, in the REGISTER you sent and pasted again below, from
Contact: sip:OTT919620649614@125.16.231.74:25841;obsip:OTT919620649614@125.16.231.74:25841;ob
you want to have:
Contact: sip:OTT919620649614@185.122.205.178:5070;lrsip:OTT919620649614@185.122.205.178:5070;lr
If yes, then this doesn't look right at all, then the device cannot receive calls anymore. Maybe you can explain the purpose and then we may be able to offer some hints.
Cheers, Daniel
REGISTER sip:185.122.206.62 SIP/2.0 Via: SIP/2.0/UDP 125.16.231.74:25841;rport;branch=z9hG4bKPj592750e4-9a06-4662-a55e-a8a71dedb974 Route: sip:185.122.205.178:5070;lrsip:185.122.205.178:5070;lr Max-Forwards: 70 From: sip:OTT919620649614@185.122.206.62sip:OTT919620649614@185.122.206.62;tag=35af1666-a2b1-4c6e-a7b6-8675845036e7 To: sip:OTT919620649614@185.122.206.62sip:OTT919620649614@185.122.206.62 Call-ID: 5bc6558f-1ffc-4990-bc99-d099c4fdcbcb CSeq: 41801 REGISTER User-Agent: PJSUA v2.3 Linux-4.4.0.64/x86_64/glibc-2.19 Contact: sip:OTT919620649614@125.16.231.74:25841;obsip:OTT919620649614@125.16.231.74:25841;ob Expires: 300 Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS Authorization: Digest username="OTT919620649614", realm="185.122.206.62", nonce="af7780946d2b72ddc5e765a68798e937", uri="sip:185.122.206.62"sip:185.122.206.62, response="a4c0614fbc3c72ece619247de5766a4b", algorithm=MD5 Content-Length: 0
SIP/2.0 200 OK Via: SIP/2.0/UDP 125.16.231.74:25841;rport=25841;branch=z9hG4bKPj592750e4-9a06-4662-a55e-a8a71dedb974;received=125.16.231.74 From: sip:OTT919620649614@185.122.206.62sip:OTT919620649614@185.122.206.62;tag=35af1666-a2b1-4c6e-a7b6-8675845036e7 Call-ID: 5bc6558f-1ffc-4990-bc99-d099c4fdcbcb CSeq: 41801 REGISTER To: sip:OTT919620649614@185.122.206.62sip:OTT919620649614@185.122.206.62;tag=1492409213989 Expires: 50 Contact: sip:OTT919620649614@125.16.231.74:25841;obsip:OTT919620649614@125.16.231.74:25841;ob;expires=50 Content-Length: 0
On 17.04.17 08:38, Narayan P wrote:
Hi Daniel,
I am attaching here my sip trace at client side.Request you to see this.
My client IP in register request is 125.16.231.74 and the server on which kamailio is running is 185.122.205.178.
I want my contact header to be sip:OTT919620649614@185.122.205.178:5070;lrsip:OTT919620649614@185.122.205.178:5070;lr
I am using avp_subst() function to replace this.But kamailio is not starting.
Please reply if I am in wrong way or have different understanding as I am very new to kamailio.
Thanks,
Narayan
________________________________ From: Narayan P Sent: Friday, April 14, 2017 12:54:25 PM To: sr-users@lists.sip-router.orgmailto:sr-users@lists.sip-router.org Cc: moconda@gmail.commailto:moconda@gmail.com Subject: RE: Not able to replace route_uri in contact header uri
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.178sip:185.122.205.178 and contact header is 3333@172.22.13.41mailto:3333@172.22.13.41. I want my contact header to be 3333@185.122.205.178mailto:3333@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
-- Daniel-Constantin Mierla www.twitter.com/micondahttp://www.twitter.com/miconda -- www.linkedin.com/in/micondahttp://www.linkedin.com/in/miconda Kamailio Advanced Training - May 22-24 (USA) - www.asipto.comhttp://www.asipto.com Kamailio World Conference - May 8-10, 2017 - www.kamailioworld.comhttp://www.kamailioworld.com
-- Daniel-Constantin Mierla www.twitter.com/micondahttp://www.twitter.com/miconda -- www.linkedin.com/in/micondahttp://www.linkedin.com/in/miconda Kamailio Advanced Training - May 22-24 (USA) - www.asipto.comhttp://www.asipto.com Kamailio World Conference - May 8-10, 2017 - www.kamailioworld.comhttp://www.kamailioworld.com
Hello,
On 17.04.17 08:38, Narayan P wrote:
Hi Daniel,
I am attaching here my sip trace at client side.Request you to see this.
My client IP in register request is 125.16.231.74 and the server on which kamailio is running is 185.122.205.178.
I want my contact header to be sip:OTT919620649614@185.122.205.178:5070;lr
I am using avp_subst() function to replace this.But kamailio is not starting.
If kamailio is not starting, then there is something wrong in the config.
Can you look in the syslog (/var/log/syslog or /var/log/messages) and see what error messages are printed there?
Cheers, Daniel
Please reply if I am in wrong way or have different understanding as I am very new to kamailio.
Thanks,
Narayan
*From:* Narayan P *Sent:* Friday, April 14, 2017 12:54:25 PM *To:* sr-users@lists.sip-router.org *Cc:* moconda@gmail.com *Subject:* RE: Not able to replace route_uri in contact header uri
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@172.22.13.41. I want my contact header to be 3333@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@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@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", "/(.*)@(.*)/$route_uri/"); #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