SIP disconnect was performed, but SIP unregistration failed.

sangsoo

Member
Hello.
SIP disconnect was performed, but SIP unregistration failed.

I integrated with Asterisk following this guide. SIP call connections work fine.
: https://docs.flashphoner.com/static...ons/SIP_calls_in_a_WebRTC-compatible_browser/

----- MY WCS, Version info-----
wcs_version=5.3.243-b287c9cf9f9fb400f97398296810c5ca214b5199
wcs_client_version=2.0.269-7ca52229c68b6b769e3e67e29c7e4cf887237822

After register connect, if disconnect is called or the webpage is closed, I want unregister to process within 60 seconds.

Looking at the server logs, it appears that even after calling disconnect, the register refresh timer (set to 50 seconds?) continues to run, causing the registration to persist and preventing unregistration.
1763800656314.png


I applied this setting in flashphoner.properties but it didn't resolve the issue.
#SIP ===================
#dtmf=INFO
dtmf=RFC2833
reg_expires=60
sip_force_session_expires=60

Below is the Asterisk pjsip.conf configuration.
1763800790210.png


How can I achieve the desired behavior (processing sip unregist after a certain time following the disconnect call)?
Thank you.
 

Max

Administrator
Staff member
Hello

This is the WCS SIP mapping

1. Connect to WCS via Websocket.
Code:
var session = Flashphoner.createSession(connectionOptions);
Will be mapped to SIP REGISTER with initial register logic.

2. Start a new SIP call.
Code:
session.createCall().call();
Will be mapped to SIP INVITE

3. Disconnecting from WCS via Websocket.
Code:
session.disconnect();
Will be mapped to SIP REGISTER with unregister logic.

Therefore if you just hangup a call (with SIP BYE), SIP registration is still valid because Websocket connection is still established.
Code:
call.hangup();
Note. SIP registration process is required if you plan to receive incoming calls
Therefore if you do outgoing SIP calls only, REGISTER logic can be omitted. Pass sipRegisterRequired false to omit SIP register logic (no SIP REGISTER requests).
Code:
var session = Flashphoner.createSession({sipRegisterRequired: false});
See also:
 

sangsoo

Member
Thank you for your response.
I understand the SIP registration settings during the createSession process.

Our service must unregister all incoming calls after using them once SIP registration is established.
Specifically, we want to remove calls from the list shown by “pjsip show contacts”.

After SIP unregistration, the web service receives this event via SIP AMI and cleans up the task.

We aim to resolve the following two issues:
1. How to perform SIP unregister like a standard softphone
2. How to delete based on SIP expiration settings after refreshing the webpage or closing the browser tab

We tested various expiration settings, but since WCS calls register periodically, we cannot configure them to expire.
- maximum_expiration, ...

How can we resolve this issue?
Please provide your feedback. Thank you.
 

Max

Administrator
Staff member
1. How to perform SIP unregister like a standard softphone
You should close websocket session at client side by
Code:
session.disconnect()
2. How to delete based on SIP expiration settings after refreshing the webpage or closing the browser tab
Use the server setting
Code:
reg_expires=3600
By default, it it 3600 seconds. The value is sent to a SIP PBX in Expires SIP header.
There is also the parameter
Code:
sip_force_session_expires=1800
This is about periodic SIP session refresh (in 1800 seconds by default).
So you can set up like
Code:
reg_expires=300
sip_force_session_expires=150
In this case SIP session should exire in 5 minutes. Note that session will expire even if the client is still connected.
 

sangsoo

Member
Thank you for your reply.
As I mentioned in my initial post, I tested reg_expires and sip_force_session_expires before asking the question, as they seemed related.
I also confirmed that the expired= value in the SIP header was changing.

However, it still remained in the contacts list.
I monitored this, and when I turned on "psjip set logger on" in Asterisk,
I saw that WCS was sending SIP registration messages every few seconds.
I may have configured SIP incorrectly. (Is there something wrong with pjsip.conf in the thread above?)

I'll refer to your reply and check again.
Thank you.
 
Last edited:

sangsoo

Member
Thank you Max.
I have a question.
Can you tell me when it will be released?
I'm preparing a service demo using this feature.
I was planning to use it next week—when will the updated version be available?
 
Top