I saw from the packet capture that SipServer responds to register with expire=360, and then Janus will randomly send a register message within 360 seconds. Now I want to control the interval time for sending this message instead of sending it at random time. I know that sending register message is implemented by sofia library. Is there any related configuration of sofia library that can achieve such setting?
The only configurable thing that comes to mind is this setting here:
but I’m not sure if the reply from the server overwrites this.
I tried changing this configuration, but it didn’t work
And I saw in the code that keepalive_interval is used on nua_create instead of nua_register, and from the documentation it seems to be send an OPTIONS message
It’s used on nua_create because it’s meant as a default that is borrowed when sending the REGISTER. I think you’ll find it in the Expires header of the REGISTER if you capture with Wireshark. OPTIONS is as good a message as any, if its purpose is to keep the outbound connection alive. Not sure why it matters when a refresh REGISTER is sent, if it’s actually sent before the timer the server gave expires.
Notice that you can manually refresh a registration too, using the Janus API. If you send the same request: "register" again that also includes a refresh: true, it will send a new REGISTER that updates the previous one. It may help you with programmatic refreshes at given times, originated at the client side.
OK, I understand, thanks
As u said registring the same number triggers refresh true automatically right? so no need to pass again refresh = true? when im registring same number… and whats the difference between keepalive and registrating again.. i know registrating again gives new session id and keepalive has same session id …other than this is there any difference or any use doing keepalive rather than refresh registration