Is there a way to identify if the registrations on sip server are made from same application?

151 Views Asked by At

I am using Sip.js library to create a calling app. There seems to be times when the application registers itself multiple times, I have used ua.stop() method which serves the purpose of stopping the useragent but is there a way in which I can identify if all the registrations are made from same application or not so that I can handle them.

user_agent.stop().then(()=>console.log("ua stopped"))
1

There are 1 best solutions below

0
AymericM On

You need to use the extension defined in rfc5626.

In this specification, you need to check the +sip.instance the reg-id parameters.

When the same application registers, you need to re-use the exact same +sip.instance the reg-id parameter. This is how the server can detect if the registration replaces an old one (matching parameters) or is a new one (not matching parameters).

Contact: <sip:[email protected];transport=tcp>;reg-id=1
 ;+sip.instance="<urn:uuid:00000000-0000-1000-8000-AABBCCDDEEFF>"

Of course, the server must support/understand those parameters.