Module: kamailio
Branch: master
Commit: afed750ea14890966f9c06955cc8b985844769ba
URL: https://github.com/kamailio/kamailio/commit/afed750ea14890966f9c06955cc8b98…
Author: Aleksandar Yosifov <alexyosifov(a)gmail.com>
Committer: Aleksandar Yosifov <alexyosifov(a)gmail.com>
Date: 2022-06-15T10:14:24+03:00
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.
---
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/afed750ea14890966f9c06955cc8b98…
Patch: https://github.com/kamailio/kamailio/commit/afed750ea14890966f9c06955cc8b98…
---
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;
}
Module: kamailio
Branch: master
Commit: d772f47ba196633c53504677103626ecc1904d54
URL: https://github.com/kamailio/kamailio/commit/d772f47ba196633c53504677103626e…
Author: alexyosifov <47529095+alexyosifov(a)users.noreply.github.com>
Committer: GitHub <noreply(a)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/d772f47ba196633c53504677103626e…
Patch: https://github.com/kamailio/kamailio/commit/d772f47ba196633c53504677103626e…
---
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;
}
<!-- Kamailio Pull Request Template -->
<!--
IMPORTANT:
- for detailed contributing guidelines, read:
https://github.com/kamailio/kamailio/blob/master/.github/CONTRIBUTING.md
- pull requests must be done to master branch, unless they are backports
of fixes from master branch to a stable branch
- backports to stable branches must be done with 'git cherry-pick -x ...'
- code is contributed under BSD for core and main components (tm, sl, auth, tls)
- code is contributed GPLv2 or a compatible license for the other components
- GPL code is contributed with OpenSSL licensing exception
-->
#### Pre-Submission Checklist
<!-- Go over all points below, and after creating the PR, tick all the checkboxes that apply -->
<!-- All points should be verified, otherwise, read the CONTRIBUTING guidelines from above-->
<!-- If you're unsure about any of these, don't hesitate to ask on sr-dev mailing list -->
- [x] Commit message has the format required by CONTRIBUTING guide
- [x] Commits are split per component (core, individual modules, libs, utils, ...)
- [x] Each component has a single commit (if not, squash them into one commit)
- [x] No commits to README files for modules (changes must be done to docbook files
in `doc/` subfolder, the README file is autogenerated)
#### Type Of Change
- [x] Small bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds new functionality)
- [ ] Breaking change (fix or feature that would change existing functionality)
#### Checklist:
<!-- Go over all points below, and after creating the PR, tick the checkboxes that apply -->
- [x] PR should be backported to stable branches
- [x] Tested changes locally
- [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description
<!-- Describe your changes in detail -->
According to RFC 3261 & 3262 CANCEL , PRACK and BYE requests and their associated responses (most of them) must not have contact header
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3148
-- Commit Summary --
* Enable tm dns failover to try next ip on receiving code other than 503
* updates from master
* Merge branch 'kamailio-master'
* topos: remove contact header for CANCEL,BYE,PRACK REQUESTS
-- File Changes --
M src/modules/topos/tps_msg.c (7)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3148.patchhttps://github.com/kamailio/kamailio/pull/3148.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3148
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/3148(a)github.com>