[SR-Users] Add websocket header to SIP

Daniel-Constantin Mierla miconda at gmail.com
Thu Aug 28 22:35:47 CEST 2014


Welcome!

Daniel

On 28/08/14 20:21, Kamrul Khan wrote:
> Worked perfectly. Thanks a lot!
>
> ------------------------------------------------------------------------
> Date: Thu, 28 Aug 2014 12:11:04 +0200
> From: miconda at gmail.com
> To: sr-users at lists.sip-router.org
> Subject: Re: [SR-Users] Add websocket header to SIP
>
> Hello,
>
> the header Origin is inside the http request used for opening the 
> websocket connection. It is no longer available at invite time.
>
> You can use htable module to store the origin header using connection id.
>
> The logic in the config file should be like:
> - in event_route during the handling of websocket connection, store 
> the origin header like:
>
> $sht(origin=>$conid) = $hdr(Origin);
>
> in request route, while handling the invite, do:
>
> if((proto==WS || proto==WSS) && $sht(origin=>$conid)!=$null) {
>    append_hf("Origin: $sht(origin=>$conid)\r\n");
> }
>
> See readme of htable module about how to define origin hash table.
>
> Cheers,
> Daniel
>
> On 28/08/14 01:16, Kamrul Khan wrote:
>
>     Hi,
>
>     I want to append the origin header of my incoming websockets to
>     the SIP INVITES. I tried something like the below but didnt work:
>
>      if (ws_handle_handshake())
>     {
>                             if(method=="INVITE"){
>                                  insert_hf("Origin: $hdr(Origin)");
>                             }
>     exit;
>     }
>
>     Is there any other way to do it ?
>
>
>
>
>
>     _______________________________________________
>     SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
>     sr-users at lists.sip-router.org  <mailto:sr-users at lists.sip-router.org>
>     http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>
>
> -- 
> Daniel-Constantin Mierla
> http://twitter.com/#!/miconda  <http://twitter.com/#%21/miconda>  -http://www.linkedin.com/in/miconda
> Next Kamailio Advanced Trainings 2014 -http://www.asipto.com
> Sep 22-25, Berlin, Germany ::: Oct 15-17, San Francisco, USA
>
> _______________________________________________ SIP Express Router 
> (SER) and Kamailio (OpenSER) - sr-users mailing list 
> sr-users at lists.sip-router.org 
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Next Kamailio Advanced Trainings 2014 - http://www.asipto.com
Sep 22-25, Berlin, Germany ::: Oct 15-17, San Francisco, USA

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20140828/d6ee530c/attachment.html>


More information about the sr-users mailing list