Enable registration of pcscf contact callback during download from db location table and inserting pcontact (normally this callback is registered during handling of REGISTER). Refuse REGISTER when pcontact is expired since [0 to 20] seconds. Within this time window a NOTIFY is expected from scscf and in order to avoid race time conditions between scscf and pcscf REGISTER will be refused. Refuse REGISTER when pcontact is expired longer than 20 seconds - send PUBLISH (contact expired) to scscf to trigger NOTIFY. In both REGISTER refused scenarios routing script should reply 500 - Deregister in progress.

Pre-Submission Checklist

Type Of Change

Checklist:

Description

In case a pcontact found in location db has to be inserted into pcscf cache depending on contact state also callbacks have to be registered for this pcontact. Registering of callback_pcscf_contact_cb is enabled in this module.
Handling of contact expiry is usually triggered in the scscf (mem_timer_udomain which runs every 10 secs). Sending of NOTIFY to pcscf may take up to 20 seconds from start of expiry due to timing conditions.
To avoid race time conditions between a REREGISTER and the expiry handler state machine in the scscf an approach is chosen to refuse a REREGISTER in time window of 20 seconds after pcontact expiry on the pcscf (thus allowing expiry handling to finish). REREGISTER is refused in this scenario with new return_code -2.
In case a REREGISTER arrives at pcscf and the respective pcontact is expired longer than time window of 20 seconds registration also is refused with rc -2 and additionaly PUBLISH is sent to scscf with expiry = 0.
The rc -2 shall be handled in register.cfg script as follows:

pcscf_save_pending("location");
switch ($retcode) {
case -1:
# Missing/wrong Information in REGISTER.
send_reply("400", "Information wrong - See log.");
exit;
break;
case -2:
# De-Register in Progress, or PUBLISH ongoing due to registration expiry,
# or new REGISTER blocked because registration just expired (up to 20sec).
append_to_reply("Retry-After: 30\r\n");
send_reply("500", "Deregister in progress - Please try again");
exit;
break;
}


You can view, comment on, or merge this pull request online at:

  https://github.com/kamailio/kamailio/pull/3317

Commit Summary

File Changes

(3 files)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <kamailio/kamailio/pull/3317@github.com>