<div dir="ltr">Hi Daniel,<div>originally I was thinking that i should just terminate or allow the dialog module to terminate the call if websocket:closed happens.</div><div>However, I believe the sip.js library I am using in the client will do a re-INVITE after websocket connection is reestablished so that requests from the other end will come to the right socket so I am thinking in just reduce the dlg timeout and if the re-INVITE happens, reset it to its usual value.</div><div>I have not checked yet if sip.js does this re-INVITE but I believe it is reasonable to assume it does and if it doesn't I think it should not be difficult to patch it to do so.</div><div><br></div><div>I will check the other alternatives you mentioned.</div><div>Thank you.</div><div><br></div><div>Regards,</div><div>Takeshi<br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Feb 10, 2016 at 10:23 PM, Daniel-Constantin Mierla <span dir="ltr"><<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    Hello Takeshi,<br>
    <br>
    so do you expect a re-INVITE after the websocket connection is
    closed?<br>
    <br>
    You may want to check also the dialog keepalive features, it might
    just be enough to enable it, but of course it may take longer to
    detect when one leg of the call is gone.<br>
    <br>
    Also, typically with PSTN gateways works to set session timers (see
    sst module).<br>
    <br>
    Cheers,<br>
    Daniel<div><div class="h5"><br>
    <br>
    <div>On 10/02/16 12:27, mayamatakeshi wrote:<br>
    </div>
    <blockquote type="cite">
      <div dir="ltr">Hi Daniel,
        <div><br>
        </div>
        <div>Yes, that will solve it.</div>
        <div>Then when i get the in-dialog INVITE i can revert the
          lifetime back to the original value.</div>
        <div>Thanks and regards,</div>
        <div>Takeshi<br>
          <div class="gmail_extra"><br>
            <div class="gmail_quote">On Wed, Feb 10, 2016 at 5:59 PM,
              Daniel-Constantin Mierla <span dir="ltr"><<a href="mailto:miconda@gmail.com" target="_blank"></a><a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>></span>
              wrote:<br>
              <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
                <div 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
                  <div>
                    <div><br>
                      <br>
                      <div>On 09/02/16 23:37, mayamatakeshi wrote:<br>
                      </div>
                    </div>
                  </div>
                  <blockquote type="cite">
                    <div>
                      <div>
                        <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></fieldset>
                        <br>
                      </div>
                    </div>
                    <pre>_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><span><font color="#888888">
</font></span></pre>
                    <span><font color="#888888"> </font></span></blockquote>
                  <span><font color="#888888"> <br>
                      <pre cols="72">-- 
Daniel-Constantin Mierla
<a href="http://twitter.com/#%21/miconda" target="_blank">http://twitter.com/#!/miconda</a> - <a href="http://www.linkedin.com/in/miconda" target="_blank">http://www.linkedin.com/in/miconda</a>
Book: SIP Routing With Kamailio - <a href="http://www.asipto.com" target="_blank">http://www.asipto.com</a>
<a href="http://miconda.eu" target="_blank">http://miconda.eu</a></pre>
                    </font></span></div>
                <br>
                _______________________________________________<br>
                SIP Express Router (SER) and Kamailio (OpenSER) -
                sr-users mailing list<br>
                <a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a><br>
                <a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
                <br>
              </blockquote>
            </div>
            <br>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
    <pre cols="72">-- 
Daniel-Constantin Mierla
<a href="http://twitter.com/#!/miconda" target="_blank">http://twitter.com/#!/miconda</a> - <a href="http://www.linkedin.com/in/miconda" target="_blank">http://www.linkedin.com/in/miconda</a>
Book: SIP Routing With Kamailio - <a href="http://www.asipto.com" target="_blank">http://www.asipto.com</a>
<a href="http://miconda.eu" target="_blank">http://miconda.eu</a></pre>
  </div></div></div>

</blockquote></div><br></div></div></div>