From afed750ea14890966f9c06955cc8b985844769ba Mon Sep 17 00:00:00 2001 From: Aleksandar Yosifov Date: Wed, 15 Jun 2022 10:14:24 +0300 Subject: [PATCH] ims_registrar_scscf: 200OK changes according to RFC3261 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. --- .../doc/ims_registrar_scscf_admin.xml | 20 +++++++++++++++++++ .../ims_registrar_scscf_mod.c | 2 ++ src/modules/ims_registrar_scscf/save.c | 5 +++-- 3 files changed, 25 insertions(+), 2 deletions(-) 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 @@ +
+ skip_multiple_bindings_on_reg_resp (int) + + 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. + + + Default value is 0. + + + Set <varname>skip_multiple_bindings_on_reg_resp</varname> parameter + + ... + modparam("ims_registrar_scscf", "skip_multiple_bindings_on_reg_resp", 1) +... + +
+
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; }