Re: [SR-Users] Not able to replace route_uri in contact header uri

2017-04-28 Thread Narayan P
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: 
;tag=9f62c1ea-36a3-4318-a767-55a6b278fd23
To: 
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: 
Expires: 300
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, 
MESSAGE, OPTIONS
Content-Length:  0

Thanks,

Narayan


From: Daniel-Constantin Mierla 
Sent: Friday, April 21, 2017 9:36:37 AM
To: Narayan P; sr-us...@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: 
\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 
Sent: Tuesday, April 18, 2017 1:04:38 PM
To: Narayan P; 
sr-us...@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: 



you want to have:


Contact: 



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: 
Max-Forwards: 70
From: 
;tag=35af1666-a2b1-4c6e-a7b6-8675845036e7
To: 
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: 

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: 
;tag=35af1666-a2b1-4c6e-a7b6-8675845036e7
Call-ID: 5bc6558f-1ffc-4990-bc99-d099c4fdcbcb
CSeq: 41801 REGISTER
To: 
;tag=1492409213989
Expires: 50
Contact: 
;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 

Re: [SR-Users] Not able to replace route_uri in contact header uri

2017-04-20 Thread Aqs Younas
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  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 
> *Sent:* Tuesday, April 18, 2017 1:04:38 PM
> *To:* Narayan P; sr-us...@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: 
>
>
> you want to have:
>
>
> Contact: 
>
>
> 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: 
> Max-Forwards: 70
> From: 
> ;tag=35af1666-a2b1-4c6e-a7b6-8675845036e7
> To: 
> 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: 
> 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: 
> ;tag=35af1666-a2b1-4c6e-a7b6-8675845036e7
> Call-ID: 5bc6558f-1ffc-4990-bc99-d099c4fdcbcb
> CSeq: 41801 REGISTER
> To: ;tag=1492409213989
> Expires: 50
> Contact: ;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  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-us...@lists.sip-router.org
> *Cc:* moco...@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
>  and contact header is @172.22.13.41.
> I want my contact header to be @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
>
>
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Not able to replace route_uri in contact header uri

2017-04-20 Thread Narayan P
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 
Sent: Tuesday, April 18, 2017 1:04:38 PM
To: Narayan P; sr-us...@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: 



you want to have:


Contact: 



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: 
Max-Forwards: 70
From: 
;tag=35af1666-a2b1-4c6e-a7b6-8675845036e7
To: 
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: 

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: 
;tag=35af1666-a2b1-4c6e-a7b6-8675845036e7
Call-ID: 5bc6558f-1ffc-4990-bc99-d099c4fdcbcb
CSeq: 41801 REGISTER
To: 
;tag=1492409213989
Expires: 50
Contact: 
;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 



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-us...@lists.sip-router.org
Cc: moco...@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 
 and contact header is 
@172.22.13.41.
I want my contact header to be 
@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
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Not able to replace route_uri in contact header uri

2017-04-17 Thread Narayan P
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 


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-us...@lists.sip-router.org
Cc: moco...@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  
and contact header is @172.22.13.41.
I want my contact header to be @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-us...@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-us...@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


root@dharm-VirtualBox:/home/dharm/rudra/pjsip_comp/pjsip-apps/bin# 
root@dharm-VirtualBox:/home/dharm/rudra/pjsip_comp/pjsip-apps/bin# 
root@dharm-VirtualBox:/home/dharm/rudra/pjsip_comp/pjsip-apps/bin# 
root@dharm-VirtualBox:/home/dharm/rudra/pjsip_comp/pjsip-apps/bin# 
./pjsua-x86_64-unknown-linux-gnu --local-port=5067 
--outbound=sip:185.122.205.178:5070 --config-file=config_cfg.cfg --no-tcp
11:49:40.373 os_core_unix.c !pjlib 2.3 for POSIX initialized
11:49:40.373 sip_endpoint.c  .Creating endpoint instance...
11:49:40.373  pjlib  .select() I/O Queue created (0xe95240)
11:49:40.373 sip_endpoint.c  .Module "mod-msg-print" registered
11:49:40.373 sip_transport.  .Transport manager created.
11:49:40.373   pjsua_core.c  .PJSUA state changed: NULL --> CREATED
11:49:40.373   pjsua_core.c  .pjsua_init

11:49:40.373   pjsua_core.c  .rtpCompStatus 0 rtpEncStatus 0 sipCompressStatus 
1  encryptionState 1

11:49:40.373 sip_endpoint.c  .Module "mod-pjsua-log" registered
11:49:40.373 sip_endpoint.c  .Module "mod-tsx-layer" registered
11:49:40.373 sip_endpoint.c  .Module "mod-stateful-util" registered
11:49:40.373 sip_endpoint.c  .Module "mod-ua" registered
11:49:40.373 sip_endpoint.c  .Module "mod-100rel" registered
11:49:40.373 sip_endpoint.c  .Module "mod-pjsua" registered
11:49:40.373 sip_endpoint.c  .Module "mod-invite" registered
bt_audio_service_open: connect() failed: Connection refused (111)
bt_audio_service_open: connect() failed: Connection refused (111)
bt_audio_service_open: connect() failed: Connection refused (111)
bt_audio_service_open: connect() failed: Connection refused (111)
11:49:40.427   pa_dev.c  ..PortAudio sound library initialized, status=0
11:49:40.428   pa_dev.c  ..PortAudio host api count=2
11:49:40.428   pa_dev.c  ..Sound device count=11
11:49:40.428  pjlib  ..select() I/O Queue created (0xeddd98)
11:49:40.434 

Re: [SR-Users] Not able to replace route_uri in contact header uri

2017-04-15 Thread Daniel-Constantin Mierla
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 
>  and contact header is @172.22.13.41.
> I want my contact header to be @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-us...@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-us...@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

-- 
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


___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Not able to replace route_uri in contact header uri

2017-04-14 Thread Narayan P
Hi Daniel,

Thanks for your response.

I mean to say,
In my register request the route header i.e. route_uri is  
and contact header is @172.22.13.41.
I want my contact header to be @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-us...@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-us...@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


Re: [SR-Users] Not able to replace route_uri in contact header uri

2017-04-14 Thread Daniel-Constantin Mierla
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-us...@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

-- 
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

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Not able to replace route_uri in contact header uri

2017-04-13 Thread Narayan P
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-us...@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