when using sdp module to parse sdp I noticed that function called from sdp_get return -1 when no m-lines are present in sdp , normally we should accept sdp without m -line because it can be at a later time through a modified offer , how can we accept such sdp without changing source code for function "parse_sdp_session"
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3779
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3779(a)github.com>
<!--
Kamailio Project uses GitHub Issues only for bugs in the code or feature requests. Please use this template only for bug reports.
If you have questions about using Kamailio or related to its configuration file, ask on sr-users mailing list:
* https://lists.kamailio.org/mailman3/postorius/lists/sr-users.lists.kamailio…
If you have questions about developing extensions to Kamailio or its existing C code, ask on sr-dev mailing list:
* https://lists.kamailio.org/mailman3/postorius/lists/sr-dev.lists.kamailio.o…
Please try to fill this template as much as possible for any issue. It helps the developers to troubleshoot the issue.
Note that an issue report may be closed automatically after about 2 months
if there is no interest from developers or community users on pursuing it, being
considered expired. In such case, it can be reopened by writing a comment that includes
the token `/notexpired`. About two weeks before considered expired, the issue is
marked with the label `stale`, trying to notify the submitter and everyone else
that might be interested in it. To remove the label `stale`, write a comment that
includes the token `/notstale`. Also, any comment postpone the `expire` timeline,
being considered that there is interest in pursuing the issue.
If there is no content to be filled in a section, the entire section can be removed.
You can delete the comments from the template sections when filling.
You can delete next line and everything above before submitting (it is a comment).
-->
### Description
The uri parser seems to fail in multiple ways on username-parameters. The ways it fails depends on the presence of user-params in the incoming request and on adjustments to $ru, $rd and $rU in the script.
My expectation is that the whole username, including user-params is *always* visible in $rU. In reality, the user-params are absent or present depending on manipulations to the uri in the script.
When setting $rU to a value with a user-param, that user-param is represented when reading $ru, but not in $rU.
<!--
Explain what you did, what you expected to happen, and what actually happened.
-->
### Troubleshooting
#### Reproduction
I used below config script to test various scenario's.
```
debug=2
memlog=4
#fork=no # This option should not be present to enable forking but disable daemonize, also -D commandline parameter is needed
log_stderror=yes
log_name="kamailio-test"
log_facility=LOG_LOCAL5
sip_warning=no
children=2
shm_mem_size=128
check_via=no # (cmd. line: -v)
dns=no # (cmd. line: -r)
rev_dns=no # (cmd. line: -R)
dns_use_search_list=no
use_dns_failover=yes
dns_srv_lb=yes
disable_tcp=yes
auto_aliases=no
listen=172.16.1.19:7060
loadmodule "sl.so"
loadmodule "pv.so"
loadmodule "xlog.so"
modparam("xlog", "prefix", "")
route {
xnotice("Incoming $rm to $rU\n");
xinfo("$$ru = $ru\n");
switch ($rU) {
case "100":
xnotice("Set $$rU = \"1234;first=yes\"\n");
$rU = "1234;first=yes";
xinfo("$$ru: $ru\n");
xinfo("$$rU: $rU\n");
if ($rU != "1234;first=yes") {
xerr("Fail!\n");
} else {
xinfo("Success!\n");
}
break;
case "200":
xnotice("Set $$rd = \"example.com;transport=udp\"\n");
$rd = "example.com;transport=udp";
xinfo("$$ru: $ru\n");
xinfo("$$rU: $rU\n");
xnotice("Set $$rU = \"1234;first=yes\"\n");
$rU = "1234;first=yes";
xinfo("$$ru: $ru\n");
xinfo("$$rU: $rU\n");
if ($rU != "1234;first=yes") {
xerr("Fail!\n");
} else {
xinfo("Success!\n");
}
break;
case "300":
xnotice("Set $$ru = \"sip:1234@example.com;transport=udp\"\n");
$ru = "sip:1234@example.com;transport=udp";
xinfo("$$ru: $ru\n");
xinfo("$$rU: $rU\n");
xnotice("Set $$rU = \"1234;first=yes\"\n");
$rU = "1234;first=yes";
xinfo("$$ru: $ru\n");
xinfo("$$rU: $rU\n");
if ($rU != "1234;first=yes") {
xerr("Fail!\n");
} else {
xinfo("Success!\n");
}
break;
case "400":
xnotice("Set $$ru = \"sip:1234;first=yes@example.com;transport=udp\"\n");
$ru = "sip:1234;first=yes@example.com;transport=udp";
xinfo("$$ru: $ru\n");
xinfo("$$rU: $rU\n");
if ($rU != "1234;first=yes") {
xerr("Fail!\n");
} else {
xinfo("Success!\n");
}
xnotice("Set $$rU = \"1234;second=yes\"\n");
$rU = "1234;second=yes";
xinfo("$$ru: $ru\n");
xinfo("$$rU: $rU\n");
if ($rU != "1234;second=yes") {
xerr("Fail!\n");
} else {
xinfo("Success!\n");
}
break;
}
sl_send_reply(500, "Done");
exit;
}
```
Outputs:
---
```
1(2206122) NOTICE: Incoming INVITE to 100
1(2206122) INFO: $ru = sip:100@172.16.1.19:7060;user=phone
1(2206122) NOTICE: Set $rU = "1234;first=yes"
1(2206122) INFO: $ru: sip:1234;first=yes@172.16.1.19:7060;user=phone
1(2206122) INFO: $rU: 1234
1(2206122) ERROR: Fail!
```
Setting $rU with a user-param sets it correctly in $ru, but reading $rU back fails.
---
```
1(2206122) NOTICE: Incoming INVITE to 200
1(2206122) INFO: $ru = sip:200@172.16.1.19:7060;user=phone
1(2206122) NOTICE: Set $rd = "example.com;transport=udp"
1(2206122) INFO: $ru: sip:200@example.com;transport=udp:7060;user=phone
1(2206122) INFO: $rU: 200
1(2206122) NOTICE: Set $rU = "1234;first=yes"
1(2206122) INFO: $ru: sip:1234;first=yes@example.com;transport=udp:7060;user=phone
1(2206122) INFO: $rU: 1234
1(2206122) ERROR: Fail!
```
Same when setting $rd in advance.
---
```
1(2206122) NOTICE: Incoming INVITE to 300
1(2206122) INFO: $ru = sip:300@172.16.1.19:7060;user=phone
1(2206122) NOTICE: Set $ru = "sip:1234@example.com;transport=udp"
1(2206122) INFO: $ru: sip:1234@example.com;transport=udp
1(2206122) INFO: $rU: 1234
1(2206122) NOTICE: Set $rU = "1234;first=yes"
1(2206122) INFO: $ru: sip:1234;first=yes@example.com;transport=udp
1(2206122) INFO: $rU: 1234;first=yes
1(2206122) INFO: Success!
```
When setting $ru first with no user-param lets a later asssignment to $rU with user-param succeed.
---
```
1(2206122) NOTICE: Incoming INVITE to 400
1(2206122) INFO: $ru = sip:400@172.16.1.19:7060;user=phone
1(2206122) NOTICE: Set $ru = "sip:1234;first=yes@example.com;transport=udp"
1(2206122) INFO: $ru: sip:1234;first=yes@example.com;transport=udp
1(2206122) INFO: $rU: 1234;first=yes
1(2206122) INFO: Success!
1(2206122) NOTICE: Set $rU = "1234;second=yes"
1(2206122) INFO: $ru: sip:1234;second=yes@example.com;transport=udp
1(2206122) INFO: $rU: 1234;second=yes
1(2206122) INFO: Success!
```
Setting $ru with a user-params succeeds. Subsequently overwriting the user part with $rU with a user-param also succeeds.
---
```
1(2206122) NOTICE: Incoming INVITE to 400
1(2206122) INFO: $ru = sip:400;existing=yes@172.16.1.19:7060;user=phone
1(2206122) NOTICE: Set $ru = "sip:1234;first=yes@example.com;transport=udp"
1(2206122) INFO: $ru: sip:1234;first=yes@example.com;transport=udp
1(2206122) INFO: $rU: 1234;first=yes
1(2206122) INFO: Success!
1(2206122) NOTICE: Set $rU = "1234;second=yes"
1(2206122) INFO: $ru: sip:1234;second=yes@example.com;transport=udp
1(2206122) INFO: $rU: 1234;second=yes
1(2206122) INFO: Success!
```
Same as previous, but with incoming user-param.
---
```
1(2206122) NOTICE: Incoming INVITE to 100
1(2206122) INFO: $ru = sip:100;existing=yes@172.16.1.19:7060;user=phone
1(2206122) NOTICE: Set $rU = "1234;first=yes"
1(2206122) INFO: $ru: sip:1234;first=yes;existing=yes@172.16.1.19:7060;user=phone
1(2206122) INFO: $rU: 1234
1(2206122) ERROR: Fail!
```
This one fails in an interesting way. The incoming uri has a user-param. When overwriting $rU with a user-param, the user-param from the incoming request is kept in addition to the new one instead of being overwritten. $rU still misses (both) user-params.
#### Debugging Data
I have no build (yet) with EXTRA_DEBUG enabled.
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3762
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3762(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
I faced an issue with memory leak in case drop NOTIFY messages in the "local-request" event route in `mem_copy_subs` and `build_uac_req`
analysis of mem leak:
kamcmd corex.shm_summary
<code>...
Mar 23 12:00:28 pbx kamailio[72308]: NOTICE: fm_status: fm_sums(): count= 11 size= 7520 bytes from presence: hash.c: mem_copy_subs(141)<br>
Mar 23 12:00:28 pbx kamailio[72308]: NOTICE: fm_status: fm_sums(): count= 23 size= 22536 bytes from tm: t_msgbuilder.c: build_uac_req(1618)
...</code>
a lot of dropped messages in local-request event route
<code>...
Mar 23 12:01:09 pbx kamailio[72308]: NOTICE: fm_status: fm_sums(): count= 83 size= 51256 bytes from presence: hash.c: mem_copy_subs(141)
Mar 23 12:01:09 pbx kamailio[72308]: NOTICE: fm_status: fm_sums(): count= 98 size= 116864 bytes from tm: t_msgbuilder.c: build_uac_req(1618)
...</code>
no messages, no activities
<code>...
Mar 23 12:02:34 pbx kamailio[72308]: NOTICE: fm_status: fm_sums(): count= 83 size= 51256 bytes from presence: hash.c: mem_copy_subs(141)
Mar 23 12:02:34 pbx kamailio[72308]: NOTICE: fm_status: fm_sums(): count= 96 size= 115432 bytes from tm: t_msgbuilder.c: build_uac_req(1618)
...</code>
In the code, we have a comment like "never free cbp here because if t_uac_prepare fails, cbp is not freed and thus caller has no chance to discover if it is freed or not", but we'll free the cbp in two cases:
1. in case of error, but we have if (ret == E_DROP) then ret = 0; (so, no error result)
2. in case call insert_tmcb for cbp, but we don't do it for E_DROP
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3403
-- Commit Summary --
* tm: memory leak in case dropping messages in local-request event route
-- File Changes --
M src/modules/tm/uac.c (8)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3403.patchhttps://github.com/kamailio/kamailio/pull/3403.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3403
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/3403(a)github.com>
### Description
We are using Kamailio as a 'mid-registrar', and saving the location record (i.e calling registrar.save()) in the reply-route depending on received status code from other registrar.
We noticed the saved location record had the contact URI (incl. instance id) and UA from response message; instead we would like to use the contact and UA from the original request.
This feature change is similar to what was added for `tcpconn_id` in PR: https://github.com/kamailio/kamailio/pull/3430. i.e. we would set the request's contact URI and UA in `xavp_cfg` variable. Then `registrar.save.c` would use the contact and UA from `xavp_cfg`.
Thanks.
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3753
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3753(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, ...)
- [ ] 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
A couple small changes to the ims_registrar_scscf which prevents kamailio from crashing on my system.
I would love to have more testing because I only did tests in my single user IMS setup.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3787
-- Commit Summary --
* ims_registrar_scscf: fix uninitialized arguments in save()
* ims_registrar_scscf: refactor save_fixup4
* ims_registrar_scscf: fix typo in function name uint_fixup
* ims_registrar_scscf: free_uint_fixup: fix memleak/freeing the wrong parameter
-- File Changes --
M src/modules/ims_registrar_scscf/ims_registrar_scscf_mod.c (55)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3787.patchhttps://github.com/kamailio/kamailio/pull/3787.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3787
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/3787(a)github.com>
After the transaction was suspended, 1st user registered, got INVITE message, there is 2nd user wakes up and send REGISTER.
Kamailio check if transaction suspended (for 2nd user, it is not suspended anymore), and checks if there is stored transaction.
So, for 2nd user we have stored transaction, then it should append new branch. ts_append failed.
if ($var(suspended) == 0) {
if ($var(stored)) {
# no suspended INVITE (i.e. there was at least one
# registered contact for target) and 'stored' set
# (i.e. ongoing transaction) -> this newly just
# registered contact needs alerting.
ts_append("location", "sip:$avp(extension)@LOCALVIRTUALIP");
xinfo("appending branches for sip:$avp(extension)@LOCALVIRTUALIP, result $rc");
} else {
xinfo("no suspended transactions for $tu");
}
return;
}
Mar 10 21:07:11 stage-webrtc-kama-01 /usr/sbin/kamailio[4067482]: INFO: [t3jutj5k1na4eir1o8pvk9 REGISTER WAKE_SUSPENDED:1:1339] <script>: -----------122583d4102d400d8565c6f48d217b8d
Mar 10 21:07:11 stage-webrtc-kama-01 /usr/sbin/kamailio[4067482]: INFO: [t3jutj5k1na4eir1o8pvk9 REGISTER WAKE_SUSPENDED:1:1348] <script>: var(suspended)=0, tsilo=>suspended::122583d4102d400d8565c6f48d217b8d
Mar 10 21:07:11 stage-webrtc-kama-01 /usr/sbin/kamailio[4067482]: INFO: [t3jutj5k1na4eir1o8pvk9 REGISTER WAKE_SUSPENDED:1:1349] <script>: var(stored)=1, tsilo=>stored::122583d4102d400d8565c6f48d217b8d
Mar 10 21:07:11 stage-webrtc-kama-01 /usr/sbin/kamailio[4067482]: ERROR: [t3jutj5k1na4eir1o8pvk9 REGISTER WAKE_SUSPENDED:1:1357] tsilo [ts_append.c:152]: ts_append_to(): transaction 11743:1310842517: error updating dset (-1)
Mar 10 21:07:11 stage-webrtc-kama-01 /usr/sbin/kamailio[4067482]: INFO: [t3jutj5k1na4eir1o8pvk9 REGISTER WAKE_SUSPENDED:1:1359] <script>: appending branches for sip:1000@10.160.201.190, result 1
At this moment we have active transaction
`{
cell: 0x7f313d43cda8
tindex: 11743
tlabel: 1310842517
method: INVITE
from: From: "9988" <sip:9988@10.156.0.6>;tag=as081c0936
to: To: <sip:1000@10.160.201.190:5070>
callid: Call-ID: 66d9dace125df36915783fb379f4e3dd@10.156.0.6:5060
cseq: CSeq: 102
uas_request: yes
tflags: 69
outgoings: 3
ref_count: 1
lifetime: 5402832
}
`
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3782
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3782(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
We noticed that configuration option tcp_accept_iplimit was included in newer kamailio versions (most notably 5.7.4), and it was a breaking change for us. Added sample configuration value in /etc/kamailio.cfg file - already tested in our production deployment.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3792
-- Commit Summary --
* tcp/docs: Added tcp_accept_iplimit config sample
-- File Changes --
M etc/kamailio.cfg (3)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3792.patchhttps://github.com/kamailio/kamailio/pull/3792.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3792
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/3792(a)github.com>
### Description
Hello. Probably I'm doing something wrong but I can't get rid of **received** parameter in the **Via** header in responses from kamailio by websocket transport.
According [RFC 7118](https://datatracker.ietf.org/doc/rfc7118/):
``
When a SIP WebSocket Server receives a request, it MAY decide not
to add a "received" parameter to the top Via header. Therefore,
SIP WebSocket Clients MUST accept responses without such a
parameter in the top Via header regardless of whether the **Via**
"sent-by" field contains a domain name.
``
### Expected behavior
For responses to websocket transport have a way to not add **received** parameter in **Via** header
#### Actual observed behavior
Responses to OPTION or REGISTER methods trough websocket got **received** containing IP we want to not show to the end users.
### Possible Solutions
maybe add a param in **tm** module or something
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
version: kamailio 5.2.1 (x86_64/linux)
```
and
```
kamailio 5.6.1 (x86_64/linux) b36a13
```
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3515
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3515(a)github.com>