Hello everyone,
--
I have a following problem:
- User is registered, and gets expiry=3600 from the server
- user is configured to re-register 5 mins before expiry by using the setDelayBeforeRefreshSec()
On most Android devices i'm testing on, the re-registration really does not happen before 55 minutes. It happens exactly 55mins and a few seconds after the first successful registration.
But on some other devices, the re-registration is sent randomly, even though there was no IP change. Only the port changed, as can be seen on the OpenSIPS server:
root@ip-172-18-0-120:/home/milan# python get_sip_contact.py -msisdn 601591400005
sip:601591400005@<redacted>.247.213:4278;transport=TLS;ob
root@ip-172-18-0-120:/home/milan# python get_sip_contact.py -msisdn 601591400005
sip:601591400005@
<redacted>.247.213:4278;transport=TLS;ob
root@ip-172-18-0-120:/home/milan#
root@ip-172-18-0-120:/home/milan#
root@ip-172-18-0-120:/home/milan# python get_sip_contact.py -msisdn 601591400005
sip:601591400005@
<redacted>.247.213:31036;transport=TLS;ob
root@ip-172-18-0-120:/home/milan#
root@ip-172-18-0-120:/home/milan#
root@ip-172-18-0-120:/home/milan#
root@ip-172-18-0-120:/home/milan#
root@ip-172-18-0-120:/home/milan# python get_sip_contact.py -msisdn 601591400005
sip:601591400005@
<redacted>.247.213:13952;transport=TLS;ob
root@ip-172-18-0-120:/home/milan#
root@ip-172-18-0-120:/home/milan#
root@ip-172-18-0-120:/home/milan#
root@ip-172-18-0-120:/home/milan#
root@ip-172-18-0-120:/home/milan#
root@ip-172-18-0-120:/home/milan# python get_sip_contact.py -msisdn 601591400005
sip:601591400005@
<redacted>.247.213:14077;transport=TLS;ob
Same thing (inconsistent behavior) can be observed when the client is registered from either WiFi or Mobile data.
The real problem i'm trying to solve is the following:
OpenSIPS people said they will support UPDATE from v2.4 (we're currently using 2.2.5)
If the client (any of the two involved parties) re-registers during the call, OpenSIPS won't know where to send the BYE package and i'm trying to address that either from the client side or the server side
I'm looking to solve the issue from both the client side and the server side, but for now I'm kinda preventing the client to re-register while he's in the call with a trivial Java modification:
@Override
public void notifyRegState(pjsip_status_code code, String reason, int expiration) {
Log.w(TAG, "notifyRegState() reason" + reason + " expiration " + expiration + " CODE = " + code.swigValue() + "\t\tin call ? " + (currentCall != null));
String msg_str = "";
boolean isRegistration;
if (expiration == 0) {
msg_str += "Unregistration";
isRegistration = false;
} else {
msg_str += "Registration";
isRegistration = true;
}
if (code.swigValue() / 100 == 2) {
msg_str += " successful";
setSipRegistrationStatus(isRegistration);
} else {
msg_str += " failed: " + reason;
setSipRegistrationStatus(false);
}
// If we're in a call, on mobile data, lets try not registering/consuming the message
// unless internet source changes
//TODO add a check that we're not on WiFi here as well
if (!isInCall()) {
Message m = Message.obtain(handler, MSG_TYPE.REG_STATE, msg_str);
Log.w(TAG, "notifyRegState()\tsending message: " + m + " to target...");
m.sendToTarget();
}
}
public boolean isInCall() {
return (currentCall != null);
}
And I still observe some clients (certain devices) re-registering, which makes me wonder and ask for some guidance on the following question:
"Where is the re-registration being performed, and what is triggering it?"
I'll also contact the PJSIP support about this, but I'd appreciate any insights anyone else might have on this matter.
Kind regards and thanks in advance,
_______________________________________________ Visit our blog: http://blog.pjsip.org pjsip mailing list pjsip@xxxxxxxxxxxxxxx http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org