Module: kamailio
Branch: master
Commit: 26ef622ff3621c8a82c1c3560a32e8d735e30c4e
URL: https://github.com/kamailio/kamailio/commit/26ef622ff3621c8a82c1c3560a32e8d…
Author: Carsten Bock <carsten(a)ng-voice.com>
Committer: Carsten Bock <carsten(a)ng-voice.com>
Date: 2022-04-27T11:33:31+02:00
dialog: Terminate dialogs in Early stage and add functionality to send messages within a dialog
- This change adds the capability to termiante a dialog in early stage by either sending a SIP response to the A-Party or by sending a CANCEL to the B-Party
- This change adds a function to send a request in-dialog from script (e.g. send INFO to a party to provide additional information or for example UPDATE a Media-Session in early stage, when certain conditions are met
---
Modified: src/modules/dialog/dialog.c
Modified: src/modules/dialog/dlg_handlers.c
Modified: src/modules/dialog/dlg_hash.h
Modified: src/modules/dialog/dlg_req_within.c
Modified: src/modules/dialog/dlg_req_within.h
Modified: src/modules/dialog/doc/dialog.xml
Modified: src/modules/dialog/doc/dialog_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/26ef622ff3621c8a82c1c3560a32e8d…
Patch: https://github.com/kamailio/kamailio/commit/26ef622ff3621c8a82c1c3560a32e8d…
**kamctl** include a python tool that is parsing SQL statements to do operations over the **db_text** files, for the common db operations (e.g., insert, delete). It is located at:
* https://github.com/kamailio/kamailio/tree/master/utils/kamctl/dbtextdb
The tool was contributed long time ago and not kept up to date, being known not to work with Python3 (e.g., #2464).
This issue is created to see if someone has the interest to pick up the maintenance of this tool, if not it will be removed from kamctl.
Note that db_text works with text files, so it is not necessary to have a tool for managing the content of these files, they can be simply updated with any text editor.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2469
### Description
On creating dispatcher with `kamctl` in the case of `db_text` it fails
### Troubleshooting
#### Reproduction
Point `kamctlrc` to DB_TEXT.
Run `kamctl dispatcher add 1 sip:asterisk_2:5060 1 3`
Run 'kamctl dispatcher add 1 sip:asterisk_2:5060 1 3 'prefix=123' 'test1''
Run 'kamctl dispatcher show'
Run 'kamctl dispatcher reload'
#### Debugging Data
```
# kamctl dispatcher add 1 sip:asterisk_2:5060 1 3
attrs cannot be empty or null
-e \E[37;31mERROR: dispatcher - SQL Error
```
```
# kamctl dispatcher add 1 sip:asterisk_2:5060 1 3 'prefix=123' 'test1'
Traceback (most recent call last):
File "/usr/lib/x86_64-linux-gnu/kamailio//kamctl/dbtextdb/dbtextdb.py", line 1243, in <module>
main(sys.argv)
File "/usr/lib/x86_64-linux-gnu/kamailio//kamctl/dbtextdb/dbtextdb.py", line 1230, in main
dataset = conn.Execute(' '.join(argv[1:]))
File "/usr/lib/x86_64-linux-gnu/kamailio//kamctl/dbtextdb/dbtextdb.py", line 423, in Execute
self.WriteTempTable()
File "/usr/lib/x86_64-linux-gnu/kamailio//kamctl/dbtextdb/dbtextdb.py", line 1138, in WriteTempTable
self.temp_file.write(header.strip() + '\n')
File "/usr/lib/python3.7/tempfile.py", line 620, in func_wrapper
return func(*args, **kwargs)
TypeError: a bytes-like object is required, not 'str'
-e \E[37;31mERROR: dispatcher - SQL Error
```
dump is showing active dispatchers, show - is not.
```
# kamctl dispatcher dump
{
"jsonrpc": "2.0",
"result": {
"NRSETS": 1,
"RECORDS": [{
"SET": {
"ID": 1,
"TARGETS": [{
"DEST": {
"URI": "sip:asterisk_2:5060",
"FLAGS": "AP",
"PRIORITY": 0
}
}]
}
}]
},
"id": 124
}
root@e529c8cb4f62:/# kamctl dispatcher show
-e dispatcher gateways
```
No result on reload
```
# kamctl dispatcher reload
{
"jsonrpc": "2.0",
"result": {
},
"id": 160
}
```
### Possible Solutions
I've tried to add data to the table manually, but here I got another issue.
But on Kamailio load, the only first dispatcher is processed. Will add another issue on this.
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
/# kamailio -v
version: kamailio 5.4.1 (x86_64/linux)
flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES, TLS_PTHREAD_MUTEX_SHARED
ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_BUFFER_SIZE 262144, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: unknown
compiled with gcc 8.3.0
```
* **Operating System**:
Debian 10/Docker
```
# uname -a
Linux 9b7efa852274 5.3.18-lp152.36-default #1 SMP Tue Aug 18 17:09:44 UTC 2020 (885251f) x86_64 GNU/Linux
```
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2464
### Description
I am creating a module that uses a 3rd party library(wolfSSL), that depending on build flags,
requires alignment of memory blocks to be the same as `malloc`, i.e., 16 bytes on gcc/AMD64.
It seems that `shm_malloc` returns memory aligned to 8 bytes.
Since system malloc always returns 16-byte aligned memory, it might be good to match that
behaviour in `shm_malloc` in case future kamailio modules use libraries that expect this.
### Expected behavior
`shm_malloc` returns memory aligned on `__alignof__(_max_align_t) == 16`
#### Actual observed behavior
`shm_malloc` returns blocks aligned on 8-bytes
#### Debugging Data
When allocating `*SSL_CTX` and `*SSL ` structs by tls module they occassionally will
have 8 byte (and not necessarily 16-byte) alignments. OpenSSL does not require 16-byte alignments
but wolfSSL requires 16-byte alignments.
### Possible Solutions
* The custom memory allocators in WIP `tls_wolfssl/` could try to wrap around `shm_malloc`.
* have a static build of wolfSSL that does not require 16-byte alignment
### Additional Information
The default `./configure` build of wolfSSL has structs that require 16-byte alignment.
wolfSSL library has a configure flag `--enable-aligndata=no` that relaxes this requirement.
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3157
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3157(a)github.com>
### Description
While upgrading to kamailio version 5.5.2 I noticed that the sip reason is not always filled in correctly. In our current setup with kamailio version 4.4 the acc module writes the INVITE, ACK end BYE messages to a postgres database. Also the missed calls are logged. With version 5.5.2 but also with version 5.5.3 the sip reason seems to contain a random 2 digits.
It gets even worse when a call is missed and kamailio generates a 408 timeout. Then a random string of 15 characters is written to the database. Sometimes this results in a fatal error because the postgres driver can't escape the string.
### Troubleshooting
The relevant part in de code is in the function env_set_code_status in file acc_logic.c
if (reply==FAKED_REPLY || reply==NULL) {
/* code */
acc_env.code_s.s =
int2bstr((unsigned long)code, code_buf, &acc_env.code_s.len);
/* reason */
if (acc_env.reason.len == 0) { /* already extracted in case of locally generated replies */
acc_env.reason.s = error_text(code);
acc_env.reason.len = strlen(acc_env.reason.s);
}
The sip reason is only filled in when the len is 0, but once the length is set it looks like it's not being reset to 0 again somewhere.
I can fix the problem by removing the if statement, but that is probably not the intention of the programmer.
#### Reproduction
The wrong reason in the ACK can probably be reproduces with any call, but in my test setup an Asterisk system answers the call.
After the "OK" an ACK is received which is seen as a FAKED_REPLY. The reason.len however is still 2 and the reason is not set.
The new function "env_set_reason" is not being called in this case.
The issue with the 408 can be reproduced by calling an endpoint and let kamailio timeout. This has to be done twice to reproduce the error. This time kamailio wants to write the missed INVITE to the database with a random string of 15 characters for the sip reason.
To me it looks like the length of 15 comes from the length of the "Request Timeout" string but the pointer reason.s point to a memory part of a previous transaction which is already gone ?
#### Debugging Data
#### Log Messages
#### SIP Traffic
### Possible Solutions
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
version: kamailio 5.5.2 (x86_64/linux) 55e232
flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLOCKLIST, HAVE_RESOLV_RES, TLS_PTHREAD_MUTEX_SHARED
ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_BUFFER_SIZE 262144, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: 55e232
compiled on 15:45:52 Dec 9 2021 with gcc 8.3.0
```
* **Operating System**:
```
Linux 4.19.0-17-amd64 #1 SMP Debian 4.19.194-3 (2021-07-18) x86_64 GNU/Linux
```
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2981
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/2981(a)github.com>
- Use heap memory for the reason code instead of the stack memory.
- See issue #2981
<!-- 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 -->
- [ ] PR should be backported to stable branches
- [x] Tested changes locally
- [x] Related to issue #2981 (replace XXXX with an open issue number)
#### Description
<!-- Describe your changes in detail -->
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3137
-- Commit Summary --
* acc: Fix reason code for locally generated replies.
-- File Changes --
M src/modules/acc/acc_logic.c (17)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3137.patchhttps://github.com/kamailio/kamailio/pull/3137.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3137
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/3137(a)github.com>
#### 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 -->
- [ ] PR should be backported to stable branches
- [x] Tested changes locally
#### Description
Topos is adding Contact header to the 407 reply


Related to https://github.com/kamailio/kamailio/pull/3149 even with https://github.com/kamailio/kamailio/commit/414c7dd608584df18f871b42e05f401… applied
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3158
-- Commit Summary --
* topos: don't insert contact header for 4xx replies
-- File Changes --
M src/modules/topos/tps_msg.c (5)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3158.patchhttps://github.com/kamailio/kamailio/pull/3158.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3158
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/3158(a)github.com>
<!-- 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/3149
-- Commit Summary --
* 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/3149.patchhttps://github.com/kamailio/kamailio/pull/3149.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3149
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/3149(a)github.com>
<!-- 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 -->
- [ ] Commit message has the format required by CONTRIBUTING guide
- [ ] Commits are split per component (core, individual modules, libs, utils, ...)
- [ ] Each component has a single commit (if not, squash them into one commit)
- [ ] 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
- [ ] 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 -->
- [ ] PR should be backported to stable branches
- [ ] Tested changes locally
- [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description
<!-- Describe your changes in detail -->
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3151
-- Commit Summary --
* ppcfg: add values to log to better tell the problem
-- File Changes --
M src/core/ppcfg.c (2)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3151.patchhttps://github.com/kamailio/kamailio/pull/3151.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3151
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/3151(a)github.com>
<!-- 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 -->
Fix debug level for registered timer to DBG instead of ERR
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3150
-- Commit Summary --
* benchmark: Fix debug level for registered timer
-- File Changes --
M src/modules/benchmark/benchmark.c (2)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3150.patchhttps://github.com/kamailio/kamailio/pull/3150.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3150
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/3150(a)github.com>
<!-- 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 -->
- [ ] PR should be backported to stable branches
- [ ] Tested changes locally
- [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description
<!-- Describe your changes in detail -->
according to nats docs: http://nats-io.github.io/nats.c/group__opts_group.html#ga20946800d024b7089e…
If [natsConnection_Connect()](http://nats-io.github.io/nats.c/group__conn_mgt_group.html#ga740be1ba16a8570eb98ef6755ebf52ce) returns NATS_OK (that is, a connection to a NATS Server was established in that call), then the connectedCb callback will not be invoked.
this patch fixes it by manually call the callback function.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3153
-- Commit Summary --
* nats: fix the nats:connected event_route not being triggered on a successful connect
-- File Changes --
M src/modules/nats/nats_mod.c (3)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3153.patchhttps://github.com/kamailio/kamailio/pull/3153.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3153
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/3153(a)github.com>
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.
<!-- 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 -->
- [ ] 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 -->
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3146
-- Commit Summary --
* ims_registrar_scscf: 200OK changes according to RFC3261
-- File Changes --
M src/modules/ims_registrar_scscf/doc/ims_registrar_scscf_admin.xml (20)
M src/modules/ims_registrar_scscf/ims_registrar_scscf_mod.c (2)
M src/modules/ims_registrar_scscf/save.c (5)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3146.patchhttps://github.com/kamailio/kamailio/pull/3146.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3146
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/3146(a)github.com>
Dear developer,
we have a question about the reasons of the changes made in this commit to Kamailio module ims_registrar_scscf
commit 23341c60519bd3e8eb91974c7aca0b283735665e
Author: Aleksandar Yosifov alexyosifov(a)gmail.com
Date: Thu May 7 15:51:34 2020 +0300
ims_registrar_scscf: fix multiple contacts in 200OK
- Prevent sending of multiple contacts in 200OK reply
for UE Re-Registration. Now S-CSCF replies with the
exact contact for Re-Registration.
We read in Section 10.3 "Processing REGISTER Requests" of the RFC3261 ( https://datatracker.ietf.org/doc/html/rfc3261#section-10.3 ) :
8. The registrar returns a 200 (OK) response. The response MUST contain Contact header field values enumerating all current bindings.
We have a test case where for one single IMPU there are two different consecutive REGISTER using different combination of IP/port.
Running our testcase on a version previous your commit, the 200OK of the second registration lists 2 bindings (correctly, as we expect by the RFC). After your commit, in this testcase, the 200OK lists only one binding. It seems that the changes in your commit do not match the RFC specifications. Can you please explain why these changes have been made?
Thanks and Kind Regards,
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;
}
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;
}
<!-- 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>