<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hello,<br>
    <br>
    perhaps you can just lower the dialog lifetime in the websocket
    event route, then dialog will take care of sending the BYEs, without
    the need to store additional information in hash table.<br>
    <br>
    Cheers,<br>
    Daniel<br>
    <br>
    <div class="moz-cite-prefix">On 09/02/16 23:37, mayamatakeshi wrote:<br>
    </div>
    <blockquote
cite="mid:CABaNFCY+_tTAk42GmLb92DO2zHSfx=fQ4e1exWLdMa=mKu2GnA@mail.gmail.com"
      type="cite">
      <div dir="ltr">Hello,
        <div>I am using module websocket and it works very well.</div>
        <div>However I would like to send BYE to the other end if event
          [websocket:closed] happens.</div>
        <div>From the docs I can see websocket module itself doesn't
          provide for this.</div>
        <div><br>
        </div>
        <div>I was considering doing something like this:</div>
        <div>  - use module htable to match $si:$sp to dialogs</div>
        <div>  - use event_route[dialog:start] to insert dialog info to
          my htable under $si:$sp of Websocket side of the call</div>
        <div>  - use event_route[dialog:end] to remove dialog info from
          htable</div>
        <div>  - use event_route[websocket:closed] to iterate over
          entries in the htable under key $si:$sp and call dlg_get() and
          dlg_bye().</div>
        <div><br>
        </div>
        <div>Obs: in the above, there is a risk of losing some dialogs
          as insertion in htable cannot be done atomically, but I am
          fine with it as it it not expected to happen as WebSocket
          users would only infrequently generate simultaneous calls. </div>
        <div><br>
        </div>
        <div>However before going with this, I would like to ask for
          other possible approaches.</div>
        <div><br>
        </div>
        <div>Regards,</div>
        <div>Takeshi</div>
        <div><br>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla
<a class="moz-txt-link-freetext" href="http://twitter.com/#!/miconda">http://twitter.com/#!/miconda</a> - <a class="moz-txt-link-freetext" href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a>
Book: SIP Routing With Kamailio - <a class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a>
<a class="moz-txt-link-freetext" href="http://miconda.eu">http://miconda.eu</a></pre>
  </body>
</html>