Re: [SR-Users] Kamailio second contact header

2015-06-05 Thread Daniel-Constantin Mierla
Hello,

the last address from next_gw() becaomes the last r-uri and that is
added as first contact. You will have to shift the URIs. Maybe the
simplest way would be to disable adding r-uri as contact in 3xx via a
mod param in sl module.

Also, if you use 4.3, might worth looking at rtjson module, you can
build a json holding the destination addresses in the order you want and
the push them to r-uri and branches.

Cheers,
Daniel

On 04/06/15 17:00, Ali Taher wrote:
>
> Hi,
>
>  
>
> I tried to not calling append_branch() when last successful next_gw()
> using below code :
>
>  
>
> $var(z)=0;
>
> $var(a)=0;
>
> if (!load_gws(1, $rU, $fu))
>
>   {
>
>   sl_send_reply("502", "Unable To lOad GatEwAyS");
>
>   exit; }
>
> while(next_gw()) $var(z) = $var(z) +1;
>
> xlog("L_INFO", "number of gateways : $var(z)\n");  
>
> load_gws(1, $rU, $fu);
>
>  
>
> while (next_gw()){
>
> xlog("L_INFO", "gateway is : $ru\n"); 
>
> $var(a)=$var(a)+1;
>
> if($var(a)!=$var(z))append_branch();
>
>
>
> }
>
>  
>
> In this case I’m getting in contact headers the following gateways : 3,1,2
>
>  
>
> Regards,
>
> Ali
>
> *From:*Ali Taher [mailto:ata...@vanrise.com]
> *Sent:* Thursday, June 04, 2015 5:44 PM
> *To:* mico...@gmail.com; 'Kamailio (SER) - Users Mailing List'
> *Cc:* 'Ali Taher~Vanrise Technical Support'
> *Subject:* RE: [SR-Users] Kamailio second contact header
>
>  
>
> Hi Daniel,
>
>  
>
> If it is the case then the ordering shouldn’t be 1,2,3,3  ?  but I’m
> getting 3,1,2,3.
>
> I tried to set $(branch(uri)[-1]) = $null; after the while block , but
> nothing changed L
>
>  
>
> Thanks,
>
> Ali
>
>  
>
> *From:*Daniel-Constantin Mierla [mailto:mico...@gmail.com]
> *Sent:* Thursday, June 04, 2015 5:28 PM
> *To:* Ali Taher; 'Kamailio (SER) - Users Mailing List'
> *Subject:* Re: [SR-Users] Kamailio second contact header
>
>  
>
> Hello,
>
> next_gw() is also setting the r-uri, so for the last successful
> next_gw() you should not call anymore append_branch(). Try to remove
> the last branch after the while block:
>
> $(branch(uri)[-1]) = $null;
>
> Cheers,
> Daniel
>
> On 04/06/15 16:01, Ali Taher wrote:
>
> Hi Daniel,
>
>  
>
> I’m using this method because I’m having issue with append_branch
> where last gateway is listed first.
>
> For example if gateways are ordered in LCR_rule_target as 1,2,3  ,
> I’m having them in contact header as : 3,1,2,3
>
>  
>
> I’m using below code :
>
>  
>
> if (!load_gws(1, $rU, $fu)) {
>
>  
>
>   sl_send_reply("502", "Unable To lOad GatEwAyS");
>
>  
>
>   exit;}
>
>  
>
>   while(next_gw()){
>
>   append_branch(); }
>
>   sl_send_reply("302","Moved Temporary");
>
>   exit;
>
> } 
>
>  
>
> Any hint regarding the above would be appreciated.
>
>  
>
> Regards,
>
> Ali
>
>  
>
> *From:*sr-users [mailto:sr-users-boun...@lists.sip-router.org] *On
> Behalf Of *Daniel-Constantin Mierla
> *Sent:* Thursday, June 04, 2015 4:41 PM
> *To:* Kamailio (SER) - Users Mailing List
> *Subject:* Re: [SR-Users] Kamailio second contact header
>
>  
>
> Hello,
>
> the r-uri is added as a Contact address for 3xx replies -- I don't
> remember if this is some RFC requirement or just an implementation
> of the sl function for 3xx replies (well, I haven't implemented
> those function either).
>
> The active branches of the request are added as contact header to
> the reply. So you can practically use append_branch() as many
> times as you need and then do sl_send_reply("3xx", ...). You don't
> need to append headers to replies explicitely.
>
> Cheers,
> Daniel
>
> On 04/06/15 13:59, Ali Taher wrote:
>
> Hello,
>
>  
>
> I’m trying to build new contact header that will be sent from
> Kamailio as below :
>
>  
>
>  
>
> load_gws(1, $rU, $fu);
>
> append_to_reply("Contact:");
>
> while (next_gw())
>
> {
>
>
> append_to_reply("$ru");
>
> }
>
> append_to_reply("\r\n");
>
> sl_send_reply("300","Multiple
> Choices");
>
> exit;  
>
>  
>
>  
>
> yet I’m getting two Contact headers as shown in below

Re: [SR-Users] Misc Radius can't parse sip-avps?

2015-06-05 Thread ycaner

Hello Daniel
i am not good at it but i am gonna try when i have free time. i am busy  now
so i stopped my radius project.
Thanks for helps.



--
View this message in context: 
http://sip-router.1086192.n5.nabble.com/Misc-Radius-can-t-parse-sip-avps-tp138137p138472.html
Sent from the Users mailing list archive at Nabble.com.

___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Kamailio second contact header

2015-06-05 Thread Ali Taher
Hi Daniel,

 

I tried the following mod param : modparam("sl", "bind_tm", 0), which is the
only boolean param in sl module , but unfortunately still the same 

How could I shift the URIs ?

 

Thanks,

Ali

 

From: Daniel-Constantin Mierla [mailto:mico...@gmail.com] 
Sent: Friday, June 05, 2015 10:04 AM
To: Ali Taher; 'Kamailio (SER) - Users Mailing List'
Subject: Re: [SR-Users] Kamailio second contact header

 

Hello,

the last address from next_gw() becaomes the last r-uri and that is added as
first contact. You will have to shift the URIs. Maybe the simplest way would
be to disable adding r-uri as contact in 3xx via a mod param in sl module.

Also, if you use 4.3, might worth looking at rtjson module, you can build a
json holding the destination addresses in the order you want and the push
them to r-uri and branches.

Cheers,
Daniel

On 04/06/15 17:00, Ali Taher wrote:

Hi,

 

I tried to not calling append_branch() when last successful next_gw() using
below code :

 

$var(z)=0;

$var(a)=0;

if (!load_gws(1, $rU, $fu)) 

  {

  sl_send_reply("502", "Unable To lOad GatEwAyS");

  exit; }

while(next_gw()) $var(z) = $var(z) +1;

xlog("L_INFO", "number of gateways : $var(z)\n");   

load_gws(1, $rU, $fu);

 

while (next_gw()){

xlog("L_INFO", "gateway is : $ru\n");  

$var(a)=$var(a)+1;

if($var(a)!=$var(z))append_branch();



}

 

In this case I'm getting in contact headers the following gateways : 3,1,2

 

Regards,

Ali

From: Ali Taher [mailto:ata...@vanrise.com] 
Sent: Thursday, June 04, 2015 5:44 PM
To: mico...@gmail.com  ; 'Kamailio (SER) - Users
Mailing List'
Cc: 'Ali Taher~Vanrise Technical Support'
Subject: RE: [SR-Users] Kamailio second contact header

 

Hi Daniel,

 

If it is the case then the ordering shouldn't be 1,2,3,3  ?  but I'm getting
3,1,2,3.

I tried to set $(branch(uri)[-1]) = $null; after the while block , but
nothing changed :(

 

Thanks,

Ali

 

From: Daniel-Constantin Mierla [mailto:mico...@gmail.com] 
Sent: Thursday, June 04, 2015 5:28 PM
To: Ali Taher; 'Kamailio (SER) - Users Mailing List'
Subject: Re: [SR-Users] Kamailio second contact header

 

Hello,

next_gw() is also setting the r-uri, so for the last successful next_gw()
you should not call anymore append_branch(). Try to remove the last branch
after the while block:

$(branch(uri)[-1]) = $null;

Cheers,
Daniel

On 04/06/15 16:01, Ali Taher wrote:

Hi Daniel,

 

I'm using this method because I'm having issue with append_branch where last
gateway is listed first.

For example if gateways are ordered in LCR_rule_target as 1,2,3  , I'm
having them in contact header as : 3,1,2,3

 

I'm using below code : 

 

if (!load_gws(1, $rU, $fu)) {

 

  sl_send_reply("502", "Unable To lOad GatEwAyS");

 

  exit;}

 

  while(next_gw()){

  append_branch(); }

  sl_send_reply("302","Moved Temporary");

  exit; 

}  

 

Any hint regarding the above would be appreciated.

 

Regards,

Ali

 

From: sr-users [mailto:sr-users-boun...@lists.sip-router.org] On Behalf Of
Daniel-Constantin Mierla
Sent: Thursday, June 04, 2015 4:41 PM
To: Kamailio (SER) - Users Mailing List
Subject: Re: [SR-Users] Kamailio second contact header

 

Hello,

the r-uri is added as a Contact address for 3xx replies -- I don't remember
if this is some RFC requirement or just an implementation of the sl function
for 3xx replies (well, I haven't implemented those function either).

The active branches of the request are added as contact header to the reply.
So you can practically use append_branch() as many times as you need and
then do sl_send_reply("3xx", ...). You don't need to append headers to
replies explicitely.

Cheers,
Daniel

On 04/06/15 13:59, Ali Taher wrote:

Hello,

 

I'm trying to build new contact header that will be sent from Kamailio as
below :

 

 

load_gws(1, $rU, $fu);

append_to_reply("Contact:");

while (next_gw())

{

 
append_to_reply("$ru");

}

append_to_reply("\r\n");

sl_send_reply("300","Multiple Choices");

exit;   

 

 

yet I'm getting two Contact headers as shown in below SIP message.

How can I remove second contact header (highlighted below in gray)

 

Via: SIP/2.0/UDP
192.168.26.3:42528;branch=z9hG4bK-d8754z-4c2cc56c3145b446-1---d8754z-;rport=
42528;received=192.168.26.3

To: "9612" 
;tag=b27e1a1d33761e85846fc98f5f3a7e58.1a8d

From: "test" 
;tag=8571af74

Re: [SR-Users] Kamailio second contact header

2015-06-05 Thread Ali Taher
Hi Daniel,

 

Here is the log I got :

2015-06-05T10:04:35.864338+03:00 ubuntu /usr/local/sbin/kamailio[25115]:
INFO: 

Re: [SR-Users] Need information regarding kamilio setup to support IPSec

2015-06-05 Thread Priyaranjan Nayak
Hi Daniel,

I am sending Security-Client header in register message to kamailio server.
I need one Security-Server header  in 200 OK message as given below.

*Security-Server:* ipsec-3gpp; q=0.1; alg=hmac-md5-96; ealg=des-ede3-cbc;
prot=ah; mod=trans; spi-c=; spi-s=; port-c=5066; port-s=5068

Could you please give me idea how can we add this header in 200 OK response
by using textop module ?


On Thu, Jun 4, 2015 at 7:06 PM, Daniel-Constantin Mierla 
wrote:

>  Hello,
>
>
> kamailio is agnostic of the ipsec layer, it doesn't do anything to manage
> ipsec, but it can get the traffic from any ipsec channel as any application
> on the OS does. ipsec encryption/decryption is done by the kernel.
>
> Adding/removing headers in kamailio is easy and straightforward using
> textops module. If you know that you have to add any Security-* header,
> then you can do it from kamailio.cfg with the functions from textops module.
>
> Cheers,
> Daniel
>
>
> On 04/06/15 13:35, Priyaranjan Nayak wrote:
>
> Hi All,
>
> I have a ims client endpoint supporting rfc 3329(IPSec).Now I am sending
> register message to kamailio server with Security-Client header and not
> getting any Security-Server header in response. Could you please tell me
> below queries
>
>- Whether kamailio server supporting rfc 3329 (IPSec) or not ?
> - If yes,how can we setup kamailio server to support
>Security-Client,Security-Server and Security-varify(as per rfc 3329) header
>?
>
>  Thanks
> Priyaranjan
>
>
> ___
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing 
> listsr-us...@lists.sip-router.orghttp://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>
>
> --
> Daniel-Constantin Mierlahttp://twitter.com/#!/miconda - 
> http://www.linkedin.com/in/miconda
> Book: SIP Routing With Kamailio - http://www.asipto.com
>
>
> ___
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users@lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>
>


-- 
Thanks
Priyaranjan
___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Kamailio second contact header

2015-06-05 Thread Daniel-Constantin Mierla
Hello,

can you try with latest master branch? I pushed some code to clean up
dropping last branch.

If all ok, I will backport.

Cheers,
Daniel

On 05/06/15 09:26, Ali Taher wrote:
>
> Hi Daniel,
>
>  
>
> Here is the log I got :
>
> 2015-06-05T10:04:35.864338+03:00 ubuntu
> /usr/local/sbin/kamailio[25115]: INFO: 

Re: [SR-Users] Kamailio second contact header

2015-06-05 Thread Daniel-Constantin Mierla
Hello,

there is no parameter to disable adding new r-uri as a contact, I
suggested to be added.

Meanwhile I looked at the code and there could be an option to get it work.

Append a branch after each next_gw() and before sending reply, do
"revert_uri();" (ie., instead of dropping last branch do revert_uri()).

Cheers,
Daniel

On 05/06/15 09:27, Ali Taher wrote:
>
> Hi Daniel,
>
>  
>
> I tried the following mod param : modparam("sl", "bind_tm", 0), which
> is the only boolean param in sl module , but unfortunately still the same
>
> How could I shift the URIs ?
>
>  
>
> Thanks,
>
> Ali
>
>  
>
> *From:*Daniel-Constantin Mierla [mailto:mico...@gmail.com]
> *Sent:* Friday, June 05, 2015 10:04 AM
> *To:* Ali Taher; 'Kamailio (SER) - Users Mailing List'
> *Subject:* Re: [SR-Users] Kamailio second contact header
>
>  
>
> Hello,
>
> the last address from next_gw() becaomes the last r-uri and that is
> added as first contact. You will have to shift the URIs. Maybe the
> simplest way would be to disable adding r-uri as contact in 3xx via a
> mod param in sl module.
>
> Also, if you use 4.3, might worth looking at rtjson module, you can
> build a json holding the destination addresses in the order you want
> and the push them to r-uri and branches.
>
> Cheers,
> Daniel
>
> On 04/06/15 17:00, Ali Taher wrote:
>
> Hi,
>
>  
>
> I tried to not calling append_branch() when last successful
> next_gw() using below code :
>
>  
>
> $var(z)=0;
>
> $var(a)=0;
>
> if (!load_gws(1, $rU, $fu))
>
>   {
>
>   sl_send_reply("502", "Unable To lOad GatEwAyS");
>
>   exit; }
>
> while(next_gw()) $var(z) = $var(z) +1;
>
> xlog("L_INFO", "number of gateways : $var(z)\n");  
>
> load_gws(1, $rU, $fu);
>
>  
>
> while (next_gw()){
>
> xlog("L_INFO", "gateway is :
> $ru\n"); 
>
> $var(a)=$var(a)+1;
>
> if($var(a)!=$var(z))append_branch();
>
>
>
> }
>
>  
>
> In this case I’m getting in contact headers the following gateways
> : 3,1,2
>
>  
>
> Regards,
>
> Ali
>
> *From:*Ali Taher [mailto:ata...@vanrise.com]
> *Sent:* Thursday, June 04, 2015 5:44 PM
> *To:* mico...@gmail.com ; 'Kamailio
> (SER) - Users Mailing List'
> *Cc:* 'Ali Taher~Vanrise Technical Support'
> *Subject:* RE: [SR-Users] Kamailio second contact header
>
>  
>
> Hi Daniel,
>
>  
>
> If it is the case then the ordering shouldn’t be 1,2,3,3  ?  but
> I’m getting 3,1,2,3.
>
> I tried to set $(branch(uri)[-1]) = $null; after the while block ,
> but nothing changed L
>
>  
>
> Thanks,
>
> Ali
>
>  
>
> *From:*Daniel-Constantin Mierla [mailto:mico...@gmail.com]
> *Sent:* Thursday, June 04, 2015 5:28 PM
> *To:* Ali Taher; 'Kamailio (SER) - Users Mailing List'
> *Subject:* Re: [SR-Users] Kamailio second contact header
>
>  
>
> Hello,
>
> next_gw() is also setting the r-uri, so for the last successful
> next_gw() you should not call anymore append_branch(). Try to
> remove the last branch after the while block:
>
> $(branch(uri)[-1]) = $null;
>
> Cheers,
> Daniel
>
> On 04/06/15 16:01, Ali Taher wrote:
>
> Hi Daniel,
>
>  
>
> I’m using this method because I’m having issue with
> append_branch where last gateway is listed first.
>
> For example if gateways are ordered in LCR_rule_target as
> 1,2,3  , I’m having them in contact header as : 3,1,2,3
>
>  
>
> I’m using below code :
>
>  
>
> if (!load_gws(1, $rU, $fu)) {
>
>  
>
>   sl_send_reply("502", "Unable To lOad GatEwAyS");
>
>  
>
>   exit;}
>
>  
>
>   while(next_gw()){
>
>   append_branch(); }
>
>   sl_send_reply("302","Moved Temporary");
>
>   exit;
>
> } 
>
>  
>
> Any hint regarding the above would be appreciated.
>
>  
>
> Regards,
>
> Ali
>
>  
>
> *From:*sr-users [mailto:sr-users-boun...@lists.sip-router.org]
> *On Behalf Of *Daniel-Constantin Mierla
> *Sent:* Thursday, June 04, 2015 4:41 PM
> *To:* Kamailio (SER) - Users Mailing List
> *Subject:* Re: [SR-Users] Kamailio second contact header
>
>  
>
> Hello,
>
> the r-uri is added as a Contact address for 3xx replies -- I
> don't remember if this is some RFC requirement or just an
>

Re: [SR-Users] Kamailio second contact header

2015-06-05 Thread Ali Taher
Hi Daniel,

 

Below solution works very well.

 

Thanks :)

Ali

 

From: Daniel-Constantin Mierla [mailto:mico...@gmail.com] 
Sent: Friday, June 05, 2015 12:49 PM
To: Ali Taher; 'Kamailio (SER) - Users Mailing List'
Subject: Re: [SR-Users] Kamailio second contact header

 

Hello,

there is no parameter to disable adding new r-uri as a contact, I suggested
to be added.

Meanwhile I looked at the code and there could be an option to get it work.

Append a branch after each next_gw() and before sending reply, do
"revert_uri();" (ie., instead of dropping last branch do revert_uri()).

Cheers,
Daniel

On 05/06/15 09:27, Ali Taher wrote:

Hi Daniel,

 

I tried the following mod param : modparam("sl", "bind_tm", 0), which is the
only boolean param in sl module , but unfortunately still the same 

How could I shift the URIs ?

 

Thanks,

Ali

 

From: Daniel-Constantin Mierla [mailto:mico...@gmail.com] 
Sent: Friday, June 05, 2015 10:04 AM
To: Ali Taher; 'Kamailio (SER) - Users Mailing List'
Subject: Re: [SR-Users] Kamailio second contact header

 

Hello,

the last address from next_gw() becaomes the last r-uri and that is added as
first contact. You will have to shift the URIs. Maybe the simplest way would
be to disable adding r-uri as contact in 3xx via a mod param in sl module.

Also, if you use 4.3, might worth looking at rtjson module, you can build a
json holding the destination addresses in the order you want and the push
them to r-uri and branches.

Cheers,
Daniel

On 04/06/15 17:00, Ali Taher wrote:

Hi,

 

I tried to not calling append_branch() when last successful next_gw() using
below code :

 

$var(z)=0;

$var(a)=0;

if (!load_gws(1, $rU, $fu)) 

  {

  sl_send_reply("502", "Unable To lOad GatEwAyS");

  exit; }

while(next_gw()) $var(z) = $var(z) +1;

xlog("L_INFO", "number of gateways : $var(z)\n");   

load_gws(1, $rU, $fu);

 

while (next_gw()){

xlog("L_INFO", "gateway is : $ru\n");  

$var(a)=$var(a)+1;

if($var(a)!=$var(z))append_branch();



}

 

In this case I'm getting in contact headers the following gateways : 3,1,2

 

Regards,

Ali

From: Ali Taher [mailto:ata...@vanrise.com] 
Sent: Thursday, June 04, 2015 5:44 PM
To: mico...@gmail.com  ; 'Kamailio (SER) - Users
Mailing List'
Cc: 'Ali Taher~Vanrise Technical Support'
Subject: RE: [SR-Users] Kamailio second contact header

 

Hi Daniel,

 

If it is the case then the ordering shouldn't be 1,2,3,3  ?  but I'm getting
3,1,2,3.

I tried to set $(branch(uri)[-1]) = $null; after the while block , but
nothing changed :(

 

Thanks,

Ali

 

From: Daniel-Constantin Mierla [mailto:mico...@gmail.com] 
Sent: Thursday, June 04, 2015 5:28 PM
To: Ali Taher; 'Kamailio (SER) - Users Mailing List'
Subject: Re: [SR-Users] Kamailio second contact header

 

Hello,

next_gw() is also setting the r-uri, so for the last successful next_gw()
you should not call anymore append_branch(). Try to remove the last branch
after the while block:

$(branch(uri)[-1]) = $null;

Cheers,
Daniel

On 04/06/15 16:01, Ali Taher wrote:

Hi Daniel,

 

I'm using this method because I'm having issue with append_branch where last
gateway is listed first.

For example if gateways are ordered in LCR_rule_target as 1,2,3  , I'm
having them in contact header as : 3,1,2,3

 

I'm using below code : 

 

if (!load_gws(1, $rU, $fu)) {

 

  sl_send_reply("502", "Unable To lOad GatEwAyS");

 

  exit;}

 

  while(next_gw()){

  append_branch(); }

  sl_send_reply("302","Moved Temporary");

  exit; 

}  

 

Any hint regarding the above would be appreciated.

 

Regards,

Ali

 

From: sr-users [mailto:sr-users-boun...@lists.sip-router.org] On Behalf Of
Daniel-Constantin Mierla
Sent: Thursday, June 04, 2015 4:41 PM
To: Kamailio (SER) - Users Mailing List
Subject: Re: [SR-Users] Kamailio second contact header

 

Hello,

the r-uri is added as a Contact address for 3xx replies -- I don't remember
if this is some RFC requirement or just an implementation of the sl function
for 3xx replies (well, I haven't implemented those function either).

The active branches of the request are added as contact header to the reply.
So you can practically use append_branch() as many times as you need and
then do sl_send_reply("3xx", ...). You don't need to append headers to
replies explicitely.

Cheers,
Daniel

On 04/06/15 13:59, Ali Taher wrote:

Hello,

 

I'm trying to build new contact header that will be sent from Kamailio as
below :

 

 

load_gws(1, $rU, $fu);

append_to_reply("Contact:");

 

[SR-Users] Private IP in SDP packet headers

2015-06-05 Thread Alex
Hello!

Please help to fix problem with sdp headers

UAC Inet -> (X.X.X.X) Kamailio (192.168.30.250) -> Asterisk (192.168.30.2)

When i call from UAC to 9002 i received INVITE/SDP from kamailio

SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.1.52:27080
;received=10.10.101.50;branch=z9hG4bK-d8754z-027c786dac17bf68-1---d8754z-;rport=27080
Record-Route: 
Record-Route: 
From: ;tag=0748d948
To: ;tag=as3914e1d1
Call-ID: ZWU5YmFiNTNhNmNmYWQzYzhkZWUzZDNjOTU3MDFiNGU.
CSeq: 2 INVITE
Server: Virtel.net Node2
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY,
INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Contact: 
Content-Type: application/sdp
Content-Length: 278

v=0
o=root 732368067 732368067 IN IP4 X.X.X.X
s=Asterisk PBX 11.17.1
c=IN IP4 X.X.X.X
t=0 0
m=audio 15768 RTP/AVP 0 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=sendrecv
a=nortpproxy:yes

Why Record-Route and Contact fields contain private IP of asterisk ?
___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


[SR-Users] Need to add extra header in 200 OK message by using kamailio.cfg file

2015-06-05 Thread Priyaranjan Nayak
Hi All,

I wanted to send  a extra header(i.e. Security-Server ) in the 200 OK from
kamailio server. Could you please suggest me how can I add extra header in
200 OK message by using kamailio.cfg file ?

Thanks
Priyaranjan
___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Need to add extra header in 200 OK message by using kamailio.cfg file

2015-06-05 Thread Mikko Lehto
Priyaranjan Nayak :

> I wanted to send  a extra header(i.e. Security-Server ) in the 200 OK from
> kamailio server. Could you please suggest me how can I add extra header in
> 200 OK message by using kamailio.cfg file ?

Hi Priyaranjan

Maybe you are looking for script function append_to_reply() ?

http://www.kamailio.org/docs/modules/4.3.x/modules/textops.html#textops.f.append_to_reply

-- 
Mikko Lehto

___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Need to add extra header in 200 OK message by using kamailio.cfg file

2015-06-05 Thread Priyaranjan Nayak
Hi Mikko,

I have configured the kamailio.cfg file as given below

onreply_route[MANAGE_REPLY] {
xdbg("incoming reply\n");
if(method == "REGISTER") {
   *append_to_reply*("Security-Server: ipsec-3gpp; q=0.1;
alg=hmac-md5-96; ealg=des-ede3-cbc; prot=ah; mod=trans; spi-c=;
spi-s=; port-c=5066; port-s=5068\r\n");
}
if(status=~"[12][0-9][0-9]")
route(NATMANAGE);
}

Now I am getting below error message
loading modules under config path: /usr/local/lib64/kamailio/modules/
 0(3002) ERROR:  [cfg.y:3282]: yyparse(): misused command
append_to_reply
 0(3002) :  [cfg.y:3426]: yyerror_at(): parse error in config file
/usr/local/etc/kamailio/kamailio.cfg, line 982, column 164: Command cannot
be used in the block

ERROR: bad config file (1 errors)
 0(3002) WARNING:  [ppcfg.c:219]: pp_ifdef_level_check(): different
number of preprocessor directives: N(#!IF[N]DEF) - N(#!ENDIF) = 1

Could you please give me idea where I went wrong ?


On Sat, Jun 6, 2015 at 11:37 AM, Mikko Lehto  wrote:

> Priyaranjan Nayak :
>
> > I wanted to send  a extra header(i.e. Security-Server ) in the 200 OK
> from
> > kamailio server. Could you please suggest me how can I add extra header
> in
> > 200 OK message by using kamailio.cfg file ?
>
> Hi Priyaranjan
>
> Maybe you are looking for script function append_to_reply() ?
>
>
> http://www.kamailio.org/docs/modules/4.3.x/modules/textops.html#textops.f.append_to_reply
>
> --
> Mikko Lehto
>
> ___
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users@lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>



-- 
Thanks
Priyaranjan
___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users