Hello,
I checked the docs and indeed sip.js supports GRUU (haven't heard of this before).
I will try with it.
Thanks,
Takeshi

On Thu, Feb 11, 2016 at 6:01 AM, Daniel-Constantin Mierla <miconda@gmail.com> wrote:
Hello,

if the client UA does GRUU (iirc, jssip supports that, sip.js started as a fork of jssip) and you enable that in Kamailio (see registrar module), it should be enough that the client UA reconnects on websocket for SIP singaling, no need for re-INVITE, unless the IP/ports for media stream change. The BYE or other requests within dialog will be routed properly to the new contact address after the reconnect.

But you have to check with your UA and see how it behaves in order to build the proper solution on server side.

Cheers,
Daniel


On 10/02/16 20:57, mayamatakeshi wrote:
Hi Daniel,
originally I was thinking that i should just terminate or allow the dialog module to terminate the call if websocket:closed happens.
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.
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.

I will check the other alternatives you mentioned.
Thank you.

Regards,
Takeshi

On Wed, Feb 10, 2016 at 10:23 PM, Daniel-Constantin Mierla <miconda@gmail.com> wrote:
Hello Takeshi,

so do you expect a re-INVITE after the websocket connection is closed?

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.

Also, typically with PSTN gateways works to set session timers (see sst module).

Cheers,
Daniel


On 10/02/16 12:27, mayamatakeshi wrote:
Hi Daniel,

Yes, that will solve it.
Then when i get the in-dialog INVITE i can revert the lifetime back to the original value.
Thanks and regards,
Takeshi

On Wed, Feb 10, 2016 at 5:59 PM, Daniel-Constantin Mierla <miconda@gmail.com> wrote:
Hello,

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.

Cheers,
Daniel


On 09/02/16 23:37, mayamatakeshi wrote:
Hello,
I am using module websocket and it works very well.
However I would like to send BYE to the other end if event [websocket:closed] happens.
From the docs I can see websocket module itself doesn't provide for this.

I was considering doing something like this:
  - use module htable to match $si:$sp to dialogs
  - use event_route[dialog:start] to insert dialog info to my htable under $si:$sp of Websocket side of the call
  - use event_route[dialog:end] to remove dialog info from htable
  - use event_route[websocket:closed] to iterate over entries in the htable under key $si:$sp and call dlg_get() and dlg_bye().

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. 

However before going with this, I would like to ask for other possible approaches.

Regards,
Takeshi



_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@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
Book: SIP Routing With Kamailio - http://www.asipto.com
http://miconda.eu

_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@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
Book: SIP Routing With Kamailio - http://www.asipto.com
http://miconda.eu


-- 
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Book: SIP Routing With Kamailio - http://www.asipto.com
http://miconda.eu