Skip to content

Commit

Permalink
ims_registrar_scscf: 200OK changes according to RFC3261
Browse files Browse the repository at this point in the history
Added corrections for 200OK reply on Re-Registration
according to RFC3261 - registrar respond with multiple bindings in case
of multiple bindings.
Added a new parameter skip_multiple_bindings_on_reg_resp
for 200OK reply used for Re-Registration. Default value is 0.
If set to 1 - registrar replies only with current contact, not with
multiple bindings.
  • Loading branch information
alexyosifov committed Jun 15, 2022
1 parent f0cea1a commit afed750
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
20 changes: 20 additions & 0 deletions src/modules/ims_registrar_scscf/doc/ims_registrar_scscf_admin.xml
Expand Up @@ -431,6 +431,26 @@
</example>
</section>

<section>
<title>skip_multiple_bindings_on_reg_resp (int)</title>

<para>If set to 1 - on Re-Registration registrar sends in 200OK reply only
current contact in case of multiple bindings.
If set to 0 - on Re-Registration registrar sends in 200OK reply all
contacts in case of multiple bindings according to RFC3261.
</para>

<para><emphasis> Default value is 0. </emphasis></para>

<example>
<title>Set <varname>skip_multiple_bindings_on_reg_resp</varname> parameter</title>

<programlisting format="linespecific">...
modparam("ims_registrar_scscf", "skip_multiple_bindings_on_reg_resp", 1)
...</programlisting>
</example>
</section>

</section>

<section>
Expand Down
2 changes: 2 additions & 0 deletions src/modules/ims_registrar_scscf/ims_registrar_scscf_mod.c
Expand Up @@ -98,6 +98,7 @@ char *scscf_user_data_xsd = 0; /* Path to "CxDataType_Rel6.xsd" or "CxDataType_R
int scscf_support_wildcardPSI = 0;
int store_data_on_dereg = 0; /**< should we store SAR data on de-registration */
unsigned int send_vs_callid_avp = 1; /* flag to enable/disable proprietary use of a callid AVP. TODO: add call-id as per TS129.229 */
int skip_multiple_bindings_on_reg_resp = 0; /* For RE-REGISTRATION in 200OK add only the current contact and skip all other bindings */

int ue_unsubscribe_on_dereg = 0; /*many UEs do not unsubscribe on de reg - therefore we should remove their subscription and not send a notify
Some UEs do unsubscribe then everything is fine*/
Expand Down Expand Up @@ -287,6 +288,7 @@ static param_export_t params[] = {
{"max_notification_list_size", INT_PARAM, &max_notification_list_size},
{"notification_processes", INT_PARAM, &notification_processes},
{"send_vs_callid_avp", INT_PARAM, &send_vs_callid_avp},
{"skip_multiple_bindings_on_reg_resp", INT_PARAM, &skip_multiple_bindings_on_reg_resp},
{0, 0, 0}
};

Expand Down
5 changes: 3 additions & 2 deletions src/modules/ims_registrar_scscf/save.c
Expand Up @@ -83,6 +83,7 @@ extern int store_data_on_dereg; /**< should we store SAR user data on de-registr

extern int ue_unsubscribe_on_dereg;
extern int user_data_always;
extern int skip_multiple_bindings_on_reg_resp;

#define DO_NOT_USE_REALM_FOR_PRIVATE_IDENTITY 0x01

Expand Down Expand Up @@ -872,7 +873,7 @@ int update_contacts(struct sip_msg* msg, udomain_t* _d,
goto error;
}
//build the contact buffer for the exact registered contact for reply on explicit IMPU
build_contact(impu_rec, contact_header, msg);
build_contact(impu_rec, contact_header, skip_multiple_bindings_on_reg_resp == 1 ? msg : 0);
build_p_associated_uri(impu_rec->s);

subscription = impu_rec->s;
Expand All @@ -883,7 +884,7 @@ int update_contacts(struct sip_msg* msg, udomain_t* _d,
ecf1, ecf2, &impu_rec) != 0) {
LM_ERR("Unable to update explicit impurecord for <%.*s>\n", public_identity->len, public_identity->s);
}
build_contact(impu_rec, contact_header, msg);
build_contact(impu_rec, contact_header, skip_multiple_bindings_on_reg_resp == 1 ? msg : 0);
ul.unlock_udomain(_d, public_identity);
break;
}
Expand Down

0 comments on commit afed750

Please sign in to comment.