I am trying to send a SIP CANCEL message using the t_uac_send() function from the tm module to cancel an INVITE message that was sent previously.
`$var(requestHeaders) =
"Via: " + $var(via) +"\r\n"
"To: sip:1010@172.16.100.76:6060;tag="+$var(tt)+"\r\n"
"From: sip:rvrbt@172.16.100.76:6060;tag="+$var(ft)+"\r\n"
"Call-ID: " + $ci + "\r\n"
"CSeq: 1 CANCEL\r\n"
"Max-Forwards: 62\r\n";
t_uac_send("CANCEL", "sip:1010@172.16.100.76:6060", "", "",
"$var(requestHeaders)",
"");`
I am encountering an issue where an additional Via header with a newly generated branch parameter is being added to the top of the headers.
This behavior causes the CANCEL request to not be recognized as part of the existing transaction and I get "SIP/2.0 481 Call/Transaction Does Not Exist"
Logs and Debugging Information:
Include relevant logs here, such as the generated CANCEL request and the 481 response.
[cancleWithExtraViaHeader.zip](https://github.com/user-attachments/files/183…
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/4096
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/4096(a)github.com>
Update item expiration value during de-/incrementation for htables that are configured with autoexpire and updateexpire disabled. Otherwise an item cannot be used until timer cleaned it up.
<!-- 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
Using following configuration
```
#!KAMAILIO
listen=udp:127.0.0.1:9999
log_stderror=yes
loadmodule "xlog.so"
loadmodule "pv.so"
loadmodule "sl.so"
loadmodule "htable.so"
modparam("htable", "htable", "foo=>autoexpire=1;updateexpire=0")
request_route {
if ($sht(foo=>bar) == $null) {
$sht(foo=>bar) = 0;
}
$var(foo) = $shtdec(foo=>bar);
xlog("$Ts single value $sht(foo=>bar)\texpire $shtex(foo=>bar)\n");
sl_send_reply("200", "Hello");
}
```
running
```
while true; do sleep 0.3; sipsak -vs sip:localhost:9999 ; done
```
produces following output
```
0(1414153) ERROR: <script>: 1734539304 single value -1 expire 1
0(1414153) ERROR: <script>: 1734539305 single value -2 expire 0
0(1414153) ERROR: <script>: 1734539305 single value -3 expire 0
0(1414153) ERROR: <script>: 1734539305 single value -4 expire 0
0(1414153) ERROR: <script>: 1734539306 single value <null> expire 4294967295
0(1414153) ERROR: <script>: 1734539306 single value <null> expire 4294967295
0(1414153) ERROR: <script>: 1734539306 single value <null> expire 4294967295
0(1414153) ERROR: <script>: 1734539306 single value <null> expire 4294967295
0(1414153) ERROR: <script>: 1734539307 single value <null> expire 4294967294
0(1414153) ERROR: <script>: 1734539307 single value <null> expire 4294967294
0(1414153) ERROR: <script>: 1734539307 single value <null> expire 4294967294
0(1414153) ERROR: <script>: 1734539308 single value <null> expire 4294967293
0(1414153) ERROR: <script>: 1734539308 single value <null> expire 4294967293
0(1414153) ERROR: <script>: 1734539308 single value <null> expire 4294967293
0(1414153) ERROR: <script>: 1734539309 single value <null> expire 4294967292
0(1414153) ERROR: <script>: 1734539309 single value <null> expire 4294967292
0(1414153) ERROR: <script>: 1734539309 single value <null> expire 4294967292
0(1414153) ERROR: <script>: 1734539310 single value <null> expire 4294967291
0(1414153) ERROR: <script>: 1734539310 single value <null> expire 4294967291
0(1414153) ERROR: <script>: 1734539310 single value <null> expire 4294967291
0(1414153) ERROR: <script>: 1734539311 single value <null> expire 4294967290
0(1414153) ERROR: <script>: 1734539311 single value <null> expire 4294967290
0(1414153) ERROR: <script>: 1734539311 single value <null> expire 4294967290
0(1414153) ERROR: <script>: 1734539312 single value <null> expire 4294967289
0(1414153) ERROR: <script>: 1734539312 single value <null> expire 4294967289
0(1414153) ERROR: <script>: 1734539312 single value <null> expire 4294967289
0(1414153) ERROR: <script>: 1734539313 single value <null> expire 4294967288
0(1414153) ERROR: <script>: 1734539313 single value <null> expire 4294967288
0(1414153) ERROR: <script>: 1734539313 single value <null> expire 4294967288
0(1414153) ERROR: <script>: 1734539314 single value <null> expire 4294967287
0(1414153) ERROR: <script>: 1734539314 single value <null> expire 4294967287
0(1414153) ERROR: <script>: 1734539314 single value <null> expire 4294967287
0(1414153) ERROR: <script>: 1734539315 single value <null> expire 4294967286
0(1414153) ERROR: <script>: 1734539315 single value <null> expire 4294967286
0(1414153) ERROR: <script>: 1734539315 single value <null> expire 4294967286
0(1414153) ERROR: <script>: 1734539316 single value <null> expire 4294967285
0(1414153) ERROR: <script>: 1734539316 single value <null> expire 4294967285
0(1414153) ERROR: <script>: 1734539316 single value <null> expire 4294967285
0(1414153) ERROR: <script>: 1734539316 single value <null> expire 4294967285
0(1414153) ERROR: <script>: 1734539317 single value <null> expire 4294967284
0(1414153) ERROR: <script>: 1734539317 single value <null> expire 4294967284
0(1414153) ERROR: <script>: 1734539317 single value <null> expire 4294967284
0(1414153) ERROR: <script>: 1734539318 single value <null> expire 4294967283
0(1414153) ERROR: <script>: 1734539318 single value <null> expire 4294967283
0(1414153) ERROR: <script>: 1734539318 single value <null> expire 4294967283
0(1414153) ERROR: <script>: 1734539319 single value <null> expire 4294967282
0(1414153) ERROR: <script>: 1734539319 single value <null> expire 4294967282
0(1414153) ERROR: <script>: 1734539319 single value <null> expire 4294967282
0(1414153) ERROR: <script>: 1734539320 single value <null> expire 4294967281
0(1414153) ERROR: <script>: 1734539320 single value <null> expire 4294967281
0(1414153) ERROR: <script>: 1734539320 single value <null> expire 4294967281
0(1414153) ERROR: <script>: 1734539321 single value <null> expire 4294967280
0(1414153) ERROR: <script>: 1734539321 single value <null> expire 4294967280
0(1414153) ERROR: <script>: 1734539321 single value <null> expire 4294967280
0(1414153) ERROR: <script>: 1734539322 single value <null> expire 4294967279
0(1414153) ERROR: <script>: 1734539322 single value <null> expire 4294967279
0(1414153) ERROR: <script>: 1734539322 single value <null> expire 4294967279
0(1414153) ERROR: <script>: 1734539323 single value <null> expire 4294967278
0(1414153) ERROR: <script>: 1734539323 single value <null> expire 4294967278
0(1414153) ERROR: <script>: 1734539323 single value <null> expire 4294967278
0(1414153) ERROR: <script>: 1734539324 single value <null> expire 4294967277
0(1414153) ERROR: <script>: 1734539324 single value <null> expire 4294967277
0(1414153) ERROR: <script>: 1734539324 single value -1 expire 1
0(1414153) ERROR: <script>: 1734539325 single value -2 expire 0
0(1414153) ERROR: <script>: 1734539325 single value -3 expire 0
0(1414153) ERROR: <script>: 1734539325 single value -4 expire 0
```
When adding `initval=0` to `htable` configuration log output changes `<null>` to `0`
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/4079
-- Commit Summary --
* htable: Fix de-/increment w/ auto expire
-- File Changes --
M src/modules/htable/ht_api.c (4)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/4079.patchhttps://github.com/kamailio/kamailio/pull/4079.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/4079
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/4079(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
- [ ] Tested changes locally
- [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description
<!-- Describe your changes in detail -->
This PR fixes a logic error where "flow failed" could also be triggered, when the call was ringing and has not been answered...
(according to https://www.kamailio.org/docs/modules/stable/modules/tm.html#tm.f.t_branch_… )
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/4087
-- Commit Summary --
* outbound/doc: Fix logic error
-- File Changes --
M src/modules/outbound/doc/outbound_admin.xml (3)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/4087.patchhttps://github.com/kamailio/kamailio/pull/4087.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/4087
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/4087(a)github.com>
Hello,
I am trying to figure out what would be the best date to branch 6.0 in
the git repo.
To allow a bit of time after returning from the winter holidays to tune
more the cmake and packaging, I would think that January 15, 2025 could
be a good choice.
If nobody comes with other opinions/suggestions, then we will go for it.
Cheers,
Daniel
--
Daniel-Constantin Mierla (@ asipto.com)
twitter.com/miconda -- linkedin.com/in/miconda
Kamailio Consultancy, Training and Development Services -- asipto.com
### Description
I encountered an issue with a specific device that is receiving a T.38 fax. The call gets established towards the device normally with inband media, then the device requests T.38 media and tries to remove the audio media via sending port 0 in the ReInvite SDP. Also it sends connection-information only on the media level and there is no "c=" on the session level.
Reading through the related RFCs and the kamailio code and discussing this on the mailing list, we came to the conclusion that kamailio is doing everything correct as per RFC. Though we were wondering if it would be possible to adjust the parser to be not as strict as it is right now, and allow a missing "c=" line on the media-level if the stream is removed/rejected via port 0, since i see no sense in requiring connection information. Of course we are also in contact with the vendor to hopefully adjust on their side.
Here are the related RFCs:
1. RFC8866 5.7
`A session description MUST contain either at least one "c=" line in each media description or a single "c=" line at the session level. It MAY contain a single session-level "c=" line and additional media-level "c=" line(s) per-media-description, in which case the media-level values override the session-level settings for the respective media.`
2. RFC3264 8.2
`Existing media streams are removed by creating a new SDP with the port number for that stream set to zero. The stream description MAY omit all attributes present previously, and MAY list just a single media format.`
At first i was especially confused by the RFC3264 8.2 part, since it seemed correct what the device is sending, but if you read carefully and keep the wording for SDP in mind only attributes ("a=") MAY be omitted. So a "c=" line should still be in the SDP for the removed media if it's not included on the session-level. Or do you see this differently?
### Expected behavior
Kamailio allows and parses the SDP when there is no session-wide "c=", a media stream is being removed via port zero and there is no "c=" for this media stream and only the remaining media streams include a "c=" line.
#### Actual observed behavior
Kamailio throws an error when trying to parse the SDP.
#### Log Messages
```
<core> [core/parser/sdp/sdp.c:523]: parse_sdp_session(): can't find media IP in the message
```
#### SIP Traffic
```
v=0
o=xmserver 1726638425 1726638427 IN IP4 169.254.1.1
s=xmserver
t=0 0
m=audio 0 RTP/AVP 8
m=image 56002 udptl t38
c=IN IP4 169.254.1.1
a=sendrecv
a=T38FaxVersion:0
a=T38MaxBitRate:14400
a=T38FaxFillBitRemoval:0
a=T38FaxTranscodingMMR:0
a=T38FaxTranscodingJBIG:0
a=T38FaxRateManagement:transferredTCF
a=T38FaxMaxBuffer:200
a=T38FaxMaxDatagram:72
a=T38FaxUdpEC:t38UDPRedundancy
```
### Possible Solutions
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
version: kamailio 5.8.3 (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, MEM_JOIN_FREE, 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_SEND_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 12.2.0
```
* **Operating System**:
```
Debian 12
Linux hostname 6.1.0-20-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.85-1 (2024-04-11) x86_64 GNU/Linux
```
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3982
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3982(a)github.com>
### Description
Some UAC (notably Aastra Phones) use the sips: uri scheme without ;transport=tls when TLS is being used.
I observed kamailio 5.7.6 and most probably also 5.8.4 to insert the sips URI in the wrong Record-Route header causing replies not to reach the destination.
#### Reproduction
Find a UAC which uses the sips URI scheme when configured to use TLS. (AAstra IP Phones for example).
Important: The Registration looks like this, contains no transport attribute but the sips scheme with port 5061 and a path pointing to the SBC.
```
"Contact" : {
"Address" : "sips:315996608@157.161.4.237:5061",
"CFlags" : 0,
"CSeq" : 1446407115,
"Call-ID" : "3abf8e6af6391e7b",
"Expires" : 56,
"Flags" : 0,
"Instance" : "<urn:uuid:00000000-0000-1000-8000-00085D49FB42>",
"KA-Roundtrip" : 0,
"Keepalive" : 0,
"Last-Keepalive" : 1735827284,
"Last-Modified" : 1735827284,
"Methods" : 16095,
"Path" : "<sip:157.161.23.249;lr;r2=on>,<sip:157.161.23.249:5061;transport=tls;lr;r2=on>",
"Q" : 0.44,
"Received" : "[not set]",
"Reg-Id" : 0,
"Ruid" : "uloc-677695ae-20472d-23",
"Server-Id" : 0,
"Socket" : "udp:157.161.23.4:5060",
"State" : "CS_DIRTY",
"Tcpconn-Id" : -1,
"User-Agent" : "Aastra 6869i/6.3.0.1020"
}
```
Using this set-up:
UAC (TLS) - Kamailio SBC (rtpengine / nat) udp - Kamailio Registrar udp - Core Infrastructure
Call the UAC. Each hop is adding a Record-Route header which is then used by the UAC when creating a new transaction within the dialog.
In this example:
Transaction 1:
CORE => UAC: INVITE 100rel supported
UAC => CORE: 180 Ringing 100rel required
---
Transaction 2:
CORE => UAC: PRACK
During the first transaction, Record-Route header are accumulated to indicate the Route set to be taken by the in-dialog PRACK request.
In the INVITE, the UAC is presented with those Record-Route Header:
The first two header are added by the SBC (IP .249) with r2=on to indicate the change from UDP to TLS
The third header was added by the Registrar (IP .5)
The fourth header was added by the Core (IP .2)
```
02.01.2025 15:17:54.250 +01:00: 157.161.23.249:5061 -> 157.161.4.237:5061
INVITE sips:315996608@157.161.4.237:5061 SIP/2.0
Record-Route: <sips:157.161.23.249:5061;transport=tls;r2=on;lr;ftag=3944816274-1416360442>
Record-Route: <sips:157.161.23.249;r2=on;lr;ftag=3944816274-1416360442>
Record-Route: <sips:157.161.23.5;lr;ftag=3944816274-1416360442>
Record-Route: <sip:157.161.23.2;lr;ftag=3944816274-1416360442;did=e77.89e5>
```
UAC is ringing:
```
02.01.2025 15:17:54.368 +01:00: 157.161.4.237:5061 -> 157.161.23.249:5061
SIP/2.0 180 Ringing
Via: SIP/2.0/TLS 157.161.23.249:5061;branch=z9hG4bK5b72.d42e9bf4e341f690d8b383a0a96edeb3.0
Via: SIP/2.0/UDP 157.161.23.5;rport=5060;branch=z9hG4bK5b72.621bba23d60b529f876b92bf2ab718de.0
Via: SIP/2.0/UDP 157.161.23.2;branch=z9hG4bK5b72.2d88c4e6630f19da5ae24efb523564bf.0
Via: SIP/2.0/UDP 157.161.10.230:5060;branch=z9hG4bK100567609d7e7e9517ddfb1eaa7d684c
Record-Route: <sips:157.161.23.249:5061;transport=tls;r2=on;lr;ftag=3944816274-1416360442>, <sips:157.161.23.249;r2=on;lr;ftag=3944816274-1416360442>, <sips:157.161.23.5;lr;ftag=3944816274-1416360442>, <sip:157.161.23.2;lr;ftag=3944816274-1416360442;did=e77.89e5>
[...]
Contact: "Somebody" <sips:315996608@157.161.4.237:5061>;+sip.instance="<urn:uuid:00000000-0000-1000-8000-00085D49FB42>"
```
Origin of call takes this Record-Route to create the source Route header for new PRACK transaction:
```
02.01.2025 15:17:54.393 +01:00: 157.161.10.230:5060 -> 157.161.23.2:5060
PRACK sips:315996608@157.161.4.237:5061 SIP/2.0
Max-Forwards: 66
Route: <sip:157.161.23.2;lr;ftag=3944816274-1416360442;did=e77.89e5>
Route: <sips:157.161.23.5;lr;ftag=3944816274-1416360442>
Route: <sips:157.161.23.249;r2=on;lr;ftag=3944816274-1416360442>
Route: <sips:157.161.23.249:5061;transport=tls;r2=on;lr;ftag=3944816274-1416360442>
RAck: 1 1 INVITE
```
According to this route set, the call shall be routed from 157.161.23.2 to 157.161.23.5 via 'sips'
This fails as there is no TLS socket bound between those two instances.
`prepare_new_uac(): can't fwd to af 2, proto 3 (no corresponding listening socket)`
IMHO the issue is caused by the wrong URI scheme (sips instead of sip) being used when the registrar is adding it's Record-Route header. (And maybe also by the SBC when adding the double (r2=on) RR to indicate the change of transport.
I suspect this happens, because the UAC has registered it's contact with the sips uri scheme.
Repeating the same situation with an UAC which registers a sip:user@domain:5061;transport=tls URI when using TLS demonstrates this works fine. It only happens when an UAC uses the sips URI scheme.
If any more information is required like a SIP trace of the issue, I am glad to provide it.
-Benoît-
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/4092
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/4092(a)github.com>