-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
Feature Request: Support multiple registrations using sip.instance
Summary
FreeSWITCH currently supports multiple SIP registrations per user using the multiple-registrations SIP profile parameter. However, there is no support for tracking registrations using the sip.instance contact parameter (RFC 5626), which is required for modern SIP/WebRTC clients.
This feature request proposes adding a new option to multiple-registrations that allows FreeSWITCH to uniquely track devices using sip.instance.
Current Behavior
The multiple-registrations parameter in SIP profiles supports the following values:
truecontactcall-id(undocumented but implemented)
Example configuration:
<!-- Can be 'true' or 'contact' -->
<!-- <param name="multiple-registrations" value="contact"/> -->The call-id option is not documented, but it works too, i could see it's implementation in the code.
if (!strcasecmp(var, "multiple-registrations")) {
if (val && !strcasecmp(val, "call-id")) {
sofia_set_pflag(profile, PFLAG_MULTIREG);
} else if (val && (!strcasecmp(val, "contact") || switch_true(val))) {
sofia_set_pflag(profile, PFLAG_MULTIREG);
sofia_set_pflag(profile, PFLAG_MULTIREG_CONTACT);
} else if (!switch_true(val)) {
sofia_clear_pflag(profile, PFLAG_MULTIREG);
sofia_clear_pflag(profile, PFLAG_MULTIREG_CONTACT);
}
}What's missing ?
There is currently no option to track registrations using the sip.instance parameter from the Contact header.
Proposed configuration
<param name="multiple-registrations" value="sip-instance"/>In this mode, FreeSWITCH would:
- Compare registrations using the +sip.instance contact parameter
- Maintain one active registration per device
- Allow multiple devices per user without duplicate registrations
Why ?
Devices / clients like SIP over WebSockets using libraries like JSSip, SIPjs cannot really preserve the call-id or contact to be same across browser page refreshes for obvious reasons like client ports will dynamic etc.. Hence the reREGISTER requests (specially across the page reloads) will not have the same call-id or contact params.
What these libs or clients offer instead is the sip.instance attribute, documented here. JSSip Implementation.
If this makes sense, happy to create a pull request.
Having this option, we can easily track unique device per user (when user has multiple devices) even when the clients contact uri cannot be preserved.