Module: kamailio Branch: master Commit: d772f47ba196633c53504677103626ecc1904d54 URL: https://github.com/kamailio/kamailio/commit/d772f47ba196633c53504677103626ec...
Author: alexyosifov 47529095+alexyosifov@users.noreply.github.com Committer: GitHub noreply@github.com Date: 2022-06-20T12:42:56+03:00
Merge pull request #3146 from alexyosifov/skip_multiple_bindings_on_reg_resp
ims_registrar_scscf: 200OK changes according to RFC3261
---
Modified: src/modules/ims_registrar_scscf/doc/ims_registrar_scscf_admin.xml Modified: src/modules/ims_registrar_scscf/ims_registrar_scscf_mod.c Modified: src/modules/ims_registrar_scscf/save.c
---
Diff: https://github.com/kamailio/kamailio/commit/d772f47ba196633c53504677103626ec... Patch: https://github.com/kamailio/kamailio/commit/d772f47ba196633c53504677103626ec...
---
diff --git a/src/modules/ims_registrar_scscf/doc/ims_registrar_scscf_admin.xml b/src/modules/ims_registrar_scscf/doc/ims_registrar_scscf_admin.xml index 124c5a14ded..979ccfbd0f7 100644 --- a/src/modules/ims_registrar_scscf/doc/ims_registrar_scscf_admin.xml +++ b/src/modules/ims_registrar_scscf/doc/ims_registrar_scscf_admin.xml @@ -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> diff --git a/src/modules/ims_registrar_scscf/ims_registrar_scscf_mod.c b/src/modules/ims_registrar_scscf/ims_registrar_scscf_mod.c index 8022011e592..b2d7a38d455 100644 --- a/src/modules/ims_registrar_scscf/ims_registrar_scscf_mod.c +++ b/src/modules/ims_registrar_scscf/ims_registrar_scscf_mod.c @@ -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*/ @@ -287,6 +288,7 @@ static param_export_t params[] = { {"max_notification_list_size", INT_PARAM, &max_notification_list_size}, {"notification_processes", INT_PARAM, ¬ification_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} };
diff --git a/src/modules/ims_registrar_scscf/save.c b/src/modules/ims_registrar_scscf/save.c index 6c8127d289c..c89f71de30d 100644 --- a/src/modules/ims_registrar_scscf/save.c +++ b/src/modules/ims_registrar_scscf/save.c @@ -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
@@ -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; @@ -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; }