[SR-Users] Add websocket header to SIP

Kamrul Khan dodul at live.com
Thu Aug 28 20:21:24 CEST 2014


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


_______________________________________________
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 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20140829/7c68ef10/attachment.html>


More information about the sr-users mailing list