Browse code

Merge afed750ea14890966f9c06955cc8b985844769ba into 8141e4454c5e6eba08d7ff5d5213948c248f7a03

alexyosifov authored on 18/06/2022 10:25:07 • GitHub committed on 18/06/2022 10:25:07
Showing 3 changed files
... ...
@@ -431,6 +431,26 @@
431 431
       </example>
432 432
     </section>
433 433
 
434
+    <section>
435
+      <title>skip_multiple_bindings_on_reg_resp (int)</title>
436
+
437
+      <para>If set to 1 - on Re-Registration registrar sends in 200OK reply only
438
+      current contact in case of multiple bindings.
439
+      If set to 0 - on Re-Registration registrar sends in 200OK reply all
440
+      contacts in case of multiple bindings according to RFC3261.
441
+      </para>
442
+
443
+      <para><emphasis> Default value is 0. </emphasis></para>
444
+
445
+      <example>
446
+        <title>Set <varname>skip_multiple_bindings_on_reg_resp</varname> parameter</title>
447
+
448
+        <programlisting format="linespecific">...
449
+        modparam("ims_registrar_scscf", "skip_multiple_bindings_on_reg_resp", 1)
450
+...</programlisting>
451
+      </example>
452
+    </section>
453
+
434 454
   </section>
435 455
 
436 456
   <section>
... ...
@@ -98,6 +98,7 @@ char *scscf_user_data_xsd = 0; /* Path to "CxDataType_Rel6.xsd" or "CxDataType_R
98 98
 int scscf_support_wildcardPSI = 0;
99 99
 int store_data_on_dereg = 0; /**< should we store SAR data on de-registration  */
100 100
 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 */
101
+int skip_multiple_bindings_on_reg_resp = 0; /* For RE-REGISTRATION in 200OK add only the current contact and skip all other bindings */
101 102
 
102 103
 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
103 104
 				   Some UEs do unsubscribe then everything is fine*/
... ...
@@ -287,6 +288,7 @@ static param_export_t params[] = {
287 288
 	{"max_notification_list_size", INT_PARAM, &max_notification_list_size},
288 289
 	{"notification_processes", INT_PARAM, &notification_processes},
289 290
 	{"send_vs_callid_avp", INT_PARAM, &send_vs_callid_avp},
291
+	{"skip_multiple_bindings_on_reg_resp", INT_PARAM, &skip_multiple_bindings_on_reg_resp},
290 292
     {0, 0, 0}
291 293
 };
292 294
 
... ...
@@ -83,6 +83,7 @@ extern int store_data_on_dereg; /**< should we store SAR user data on de-registr
83 83
 
84 84
 extern int ue_unsubscribe_on_dereg;
85 85
 extern int user_data_always;
86
+extern int skip_multiple_bindings_on_reg_resp;
86 87
 
87 88
 #define DO_NOT_USE_REALM_FOR_PRIVATE_IDENTITY         0x01
88 89
 
... ...
@@ -872,7 +873,7 @@ int update_contacts(struct sip_msg* msg, udomain_t* _d,
872 873
                 goto error;
873 874
             }
874 875
             //build the contact buffer for the exact registered contact for reply on explicit IMPU
875
-            build_contact(impu_rec, contact_header, msg);
876
+            build_contact(impu_rec, contact_header, skip_multiple_bindings_on_reg_resp == 1 ? msg : 0);
876 877
             build_p_associated_uri(impu_rec->s);
877 878
 
878 879
             subscription = impu_rec->s;
... ...
@@ -883,7 +884,7 @@ int update_contacts(struct sip_msg* msg, udomain_t* _d,
883 884
                         ecf1, ecf2, &impu_rec) != 0) {
884 885
                     LM_ERR("Unable to update explicit impurecord for <%.*s>\n", public_identity->len, public_identity->s);
885 886
                 }
886
-                build_contact(impu_rec, contact_header, msg);
887
+                build_contact(impu_rec, contact_header, skip_multiple_bindings_on_reg_resp == 1 ? msg : 0);
887 888
                 ul.unlock_udomain(_d, public_identity);
888 889
                 break;
889 890
             }