Add "DIVERSION" hdr

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Add "DIVERSION" hdr

Spady#7
Hi guys, I was wondering if opensips is able to add a "DIVERSION" header as can do Asterisk.
I read on Forum about CPL module that can do something similar. Is there not a function into opensips's core?
What i would like to achive is an invite like this:

INVITE sip:3999@10.9.101.161:5065 SIP/2.0
Via: SIP/2.0/TCP 172.16.52.123:5060;branch=z9hG4bK4b8d050a
Max-Forwards: 70
From: "6000" <sip:6000@172.16.52.123>;tag=as209a146a
To: <sip:3999@10.9.101.161:5065>
Contact: <sip:6000@172.16.52.123:5060;transport=TCP>
Call-ID: 5aabc83c1d177184784b7c5d6c82a4ba@172.16.52.123:5060
CSeq: 102 INVITE
User-Agent: FPBX-2.9.0(1.8.5.0)
Date: Thu, 28 Jul 2011 13:05:33 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Diversion: <tel:3950>;reason=no-answer;screen=no;privacy=off
Content-Type: application/sdp
Content-Length: 420

Is it possible??

regards.
Reply | Threaded
Open this post in threaded view
|

Re: Add "DIVERSION" hdr

Max Mühlbronner

Hi,

sure, it is possible to add any header.

append_hf("Diversion:
<tel:3950>;reason=no-answer;screen=no;privacy=off\r\n");

obviously it makes more sense to insert some variables from your script.
e.g: if there is a $var(diversion) set which contains "3950" you could
use this instead :

append_hf("Diversion:
<tel:$var(diversion)>;reason=no-answer;screen=no;privacy=off\r\n");



BR

Max M.


Am 28.07.2011 15:10, schrieb spady:

> Hi guys, I was wondering if opensips is able to add a "DIVERSION" header as
> can do Asterisk.
> I read on Forum about CPL module that can do something similar. Is there not
> a function into opensips's core?
> What i would like to achive is an invite like this:
>
> INVITE sip:3999@10.9.101.161:5065 SIP/2.0
> Via: SIP/2.0/TCP 172.16.52.123:5060;branch=z9hG4bK4b8d050a
> Max-Forwards: 70
> From: "6000"&lt;sip:6000@172.16.52.123&gt;;tag=as209a146a
> To:&lt;sip:3999@10.9.101.161:5065&gt;
> Contact:&lt;sip:6000@172.16.52.123:5060;transport=TCP&gt;
> Call-ID: 5aabc83c1d177184784b7c5d6c82a4ba@172.16.52.123:5060
> CSeq: 102 INVITE
> User-Agent: FPBX-2.9.0(1.8.5.0)
> Date: Thu, 28 Jul 2011 13:05:33 GMT
> Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO,
> PUBLISH
> Supported: replaces, timer
> *Diversion:<tel:3950>;reason=no-answer;screen=no;privacy=off*
> Content-Type: application/sdp
> Content-Length: 420
>
> Is it possible??
>
> regards.
>
> --
> View this message in context: http://opensips-open-sip-server.1449251.n2.nabble.com/Add-DIVERSION-hdr-tp6629796p6629796.html
> Sent from the OpenSIPS - Users mailing list archive at Nabble.com.
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Add "DIVERSION" hdr

Spady#7
Hi MAX thanks a lot for your quick reply. I was studying your solution an d i would like to ask you a couple of thing about it:

1- What " \r\n " mean at the end of "append_hf". I searched into
 http://www.opensips.org/html/docs/modules/1.4.x/textops.html but I cannot find anything about it.

2- I read about textops module at http://www.opensips.org/html/docs/modules/1.4.x/textops.html and i am asking what is the really difference beatween "append_hf(txt)" and "append_hf(txt, hdr)" .

I am sorry for dummy question but i am studying OpenSIPS from a couple of weeks and it's all new for me.

Thnak you very much.

Reply | Threaded
Open this post in threaded view
|

Re: Add "DIVERSION" hdr

Max Mühlbronner
Hi,



\r\n is just the line break (new line), like <br> in html.


difference between both functions is the location where the header will be added.
append_hf(txt) - Appends 'txt' as header after the last header field. 
		
append_hf(txt, hdr) - Appends 'txt' as header after first 'hdr' header field.




BR 


Max M.		
Am 28.07.2011 15:56, schrieb spady:
Hi MAX thanks a lot for your quick reply. I was studying your solution an d i
would like to ask you a couple of thing about it:

1- What " \r\n " mean at the end of "append_hf". I searched into
 http://www.opensips.org/html/docs/modules/1.4.x/textops.html but I cannot
find anything about it.

2- I read about textops module at
http://www.opensips.org/html/docs/modules/1.4.x/textops.html and i am asking
what is the really difference beatween "append_hf(txt)" and "append_hf(txt,
hdr)" .

I am sorry for dummy question but i am studying OpenSIPS from a couple of
weeks and it's all new for me.

Thnak you very much.



--
View this message in context: http://opensips-open-sip-server.1449251.n2.nabble.com/Add-DIVERSION-hdr-tp6629796p6629941.html
Sent from the OpenSIPS - Users mailing list archive at Nabble.com.

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Add "DIVERSION" hdr

Spady#7
Thanks Max. Very helpfull!!!