No SIP RE-registration

Need some help to figure out what could be causing Janus to complete initially registration fine. However, when it’s time for the re-registration to get generated, nothing is sent. Anywhere in the configuration that could be related?

Sofia SIP will look at the response to the REGISTER to know when a refresh needs to be sent. This happens automatically, not done by us. Check what’s the value sent in the 200 in response to the REGISTER.

I agree 100% with you, this is what makes this so frustrating. I have posted a sample of the 200OK response. Is there anything in the janus.log that would indicate the cause?

SIP/2.0 200 OK
Via: SIP/2.0/UDP 10.153.1.184:44940;received=x.x.x.x;branch=z9hG4bK8pQpSBKgrNKeB;rport=44940
From: “FromURIREMOVED”;tag=79BF9c5r7Hp6Q
To: “TOURIREMOVED”;tag=1006506712-1709593718194
Call-ID: f9b33576-551e-123d-d895-0050568db6bd
CSeq: 979645631 REGISTER
Contact: sip:x.x.x.x@10.153.1.184:44940;transport=udp;expires=300;q=0.5
Allow-Events: call-info,line-seize,dialog,message-summary,as-feature-event,x-broadworks-hoteling,x-broadworks-call-center-status,conference
Content-Length: 0

I see an expires=300' which suggests the server wants a new registration after 5 minutes, but again, this is dealt with by Sofia automatically, not by us. We don’t log anything: we only copy the value of expires in the subscribe_succeeded event you receive on the client side, so you can check if it matches that.

If you want to check what Sofia SIP is doing internally, you can enable debugging for the library itself by setting the SOFIA_DEBUG=9 NUA_DEBUG=9 NTA_DEBUG=9 env variables when starting Janus. I guess it will cause very verbose logs, but should give you a glimpse at what’s happening.

1 Like

These debug commands work, but, can only be run from the cli while manually starting Janus and dumps the output to the screen. Is there a sofia config and log file I can enable these debugs and view respectively?

Thanks

Note, the issue is in prod, which is a docker container and I dont see a way how to manully run these commands simultaneously with the ‘docker compose start’

I was able to identify the cause of the lack of sip re-registration. It seems when behind_nat is true in the Janus configuration, Sofia generate a significantly high refresh timer, although 200OK had 300s.

nua_dialog.c:564 nua_dialog_usage_set_refresh_range() nua(): refresh register after 2413 seconds (in [900…2700])

When behind_nat is set to false, the Sofia refresh timer is much smaller and within 300s.
nua_dialog.c:564 nua_dialog_usage_set_refresh_range() nua(): refresh register after 111 seconds (in [75…225])
nua_dialog.c:564 nua_dialog_usage_set_refresh_range() nua(): refresh register after 158 seconds (in [129…159])
nua_dialog.c:564 nua_dialog_usage_set_refresh_range() nua(): refresh register after 207 seconds (in [75…225])
nua_dialog.c:564 nua_dialog_usage_set_refresh_range() nua(): refresh register after 182 seconds (in [75…225]
nua_dialog.c:564 nua_dialog_usage_set_refresh_range() nua(): refresh register after 162 seconds (in [75…225])

Would this be considered a Janus or Sofia bug? Or is there an explanation why Sofia would override the 200OK with a much higher refresh time?

Sounds like a Sofia bug to me. As I said, those automatic retries are enabled by Sofia looking at the SIP dialogs it handles itself.