Hello all,
I've come across the following issue with topos on Kamailio 5.1.0-rc2.
### Description
Kamailio acts as a proxy for asterisk instances residing in a private IP range. Asterisk's peers are configured with their public IP address or hostname, but asterisk will dispatch requests to them to kamailio instead (because kamailio's IP is set in outboundproxy option in peer definition).
This works fine for INVITEs, but if qualify=yes is set for the peer, asterisk will send out OPTIONs to monitor these peers. If the topos module is loaded, 200 OK replies to these OPTIONs will be malformed when forwarded from kamailio to asterisk (no Via header present). Disabling the topos module will resolve this.
### Troubleshooting
#### Reproduction
Configure a peer in asterisk with outboundproxy option set to kamailio's IP address. Set qualify=yes.
Adjust kamailio's default configuration so that OPTIONs to other hosts besides itself are routed. Change the following section in request_route:
```
if ($rU==$null) {
# request with no Username in RURI
sl_send_reply("484","Address Incomplete");
exit;
}
```
to:
```
if ( ($rU==$null) && !(is_method("OPTIONS")) ) {
# request with no Username in RURI
sl_send_reply("484","Address Incomplete");
exit;
}
# Permit asterisk's monitoring using options
if(is_method("OPTIONS") && uri!=myself) {
route(RELAY);
}
```
Enable and configure the topos module with database.
#### SIP Traffic
asterisk:5060 -> kamailio:5060
```
OPTIONS sip:peer.domain.tld SIP/2.0
Via: SIP/2.0/UDP asterisk:5060;branch=z9hG4bK460330cf;rport
Max-Forwards: 70
From: "asterisk" <sip:asterisk@domain.tld>;tag=as690c2406
To: <sip:peer.domain.tld>
Contact: <sip:asterisk@asterisk:5060>
Call-ID: 6548f43b2d8740122186bb0c6e72ac78(a)domain.tld
CSeq: 102 OPTIONS
User-Agent: myUA
Date: Sun, 03 Dec 2017 00:39:38 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0
```
kamailio:5060 -> peer:5060
```
OPTIONS sip:peer.domain.tld SIP/2.0
Via: SIP/2.0/UDP kamailio:5060;branch=z9hG4bK460330cf;rport
Max-Forwards: 69
From: "asterisk" <sip:asterisk@domain.tld>;tag=as690c2406
To: <sip:peer.domain.tld>
Contact: <sip:asterisk@asterisk:5060>
Call-ID: 6548f43b2d8740122186bb0c6e72ac78(a)domain.tld
CSeq: 102 OPTIONS
User-Agent: myUA
Date: Sun, 03 Dec 2017 00:39:38 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0
```
peer:5060 -> kamailio:5060
```
SIP/2.0 200 OK
Via: SIP/2.0/UDP kamailio;branch=z9hG4bKda8d.cc03bd2def8ad36e8c43f61ab31a636f.0;received=kamailio;rport=5060
From: "asterisk" <sip:asterisk@domain.tld>;tag=as690c2406
To: <sip:peer.domain.tld>;tag=as472874ee
Call-ID: 6548f43b2d8740122186bb0c6e72ac78(a)domain.tld
CSeq: 102 OPTIONS
Server: myUA
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Contact: <sip:peer:5060>
Accept: application/sdp
Content-Length: 0
```
**kamailio:5060 -> asterisk:5060: Missing Via Header**
```
SIP/2.0 200 OK
From: "asterisk" <sip:asterisk@domain.tld>;tag=as690c2406
To: <sip:peer.domain.tld>;tag=as472874ee
Call-ID: 6548f43b2d8740122186bb0c6e72ac78(a)domain.tld
CSeq: 102 OPTIONS
Server: myUA
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Contact: <sip:peer:5060>
Accept: application/sdp
Content-Length: 0
```
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
version: kamailio 5.1.0-rc2 (x86_64/linux)
flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, 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
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, 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 6.3.0
```
* **Operating System**:
```
Debian 9.1
```
* **Other pertinent configuration information**:
This kamailio box has several network interfaces. mhomed is not used, instead force_send_socket is called where necessary. I'm mentioning this in case it's what might trigger this issue with topos.
--
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/1350
(from devmeeting #Fosdem) - adding new dependencies as core dependencies
- Curl
- libssl
- uuid
- libunistring
- libxml2
Any other candidates? They have to be libraries that are commonly installed on most Linux/Unix system.
This would mean that a lot of more modules will be built by default, like TLS, HTTP_CLIENT, WEBSOCKET.
We may also look over the names of the packages/groups for the build system and linux distros
--
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/969
It seems a good idea to support JWT as a new SIP authorization method. Wonder if anyone is interested? Think auth_db would be the best spot to add support for JWT.
---
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/29
<!-- 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
- [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 -->
192.0.0.0/29 is a reserved subnet for NATtin IPv4 across an IPv6 netwerk. For example Dual Stack Lite carrier grade NAT.
This is small change and updates the subnets used for NAT according to https://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-speci…
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/1488
-- Commit Summary --
* Support for
-- File Changes --
M src/modules/ipops/detailed_ip_type.c (1)
M src/modules/ipops/detailed_ip_type.h (2)
M src/modules/nat_traversal/nat_traversal.c (3)
M src/modules/nathelper/nathelper.c (1)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/1488.patchhttps://github.com/kamailio/kamailio/pull/1488.diff
--
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/pull/1488
Tracking here the issue exposed by @linuxmaniac via PR #924, as it was merged and then reverted (by #1248), so anyone can be aware of as well as comment/propose solutions for it.
> Add "-fno-strict-aliasing" to compilation flags
>
> Fixes a slew of:
> "dereferencing type-punned pointer will break strict-aliasing rules"
> warnings from GCC for lines of the form:
> Py_INCREF(Py_True);
> and
> Py_INCREF(Py_False);
>
> due to the cast from PyIntObject* to PyObject*
>
> GCC is technically correct here; see:
> http://www.python.org/dev/peps/pep-3123/
> though this is unlikely to lead to non-working machine code.
The initial proposed patch for `src/modules/app_python/Makefile` is:
```
@@ -22,6 +22,8 @@ ifeq ($(OS), freebsd)
LIBS+=-pthread
endif
+# python2 https://www.python.org/dev/peps/pep-3123/
+DEFS+=-fno-strict-aliasing
DEFS+=-I${PYTHON_INCDIR}
DEFS+=-DKAMAILIO_MOD_INTERFACE
```
--
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/1249
allow to clean the shared and private info of a test scenario in order to be able to re-trigger it without restart kamailio
---
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/574
I am forking a call to multiple destinations and want to keep the only branch which sends quicker provisional 180/183 reply and cancel the remaining branches. Below is my related cfg snippet.
modparam("tm", "failure_reply_mode", 3)
modparam("tm", "fr_timer", 30000)
modparam("tm", "fr_inv_timer", 120000)
modparam("tm", "cancel_b_method", 2)
...
route[SIPOUT] {
if (uri==myself) return;
append_hf("P-hint: outbound\r\n");
append_branch();
append_branch();
route(RELAY);
exit;
}
onreply_route[MANAGE_REPLY] {
xdbg("incoming reply\n");
if(status=~"[12][0-9][0-9]") {
xlog("L_INFO","Received $rs (IP:$si:$sp)\n");
if(status=~"18[03]"){
t_cancel_branches("others");
xlog("L_INFO","cancelled all other branches\n");
}
route(NATMANAGE);
}
}
...
But I see kamailio does not instantly send CANCEL to other branches after it has received 180/180 from any branch.
Kamailio is sending CANCEL to other branches after they start sending 180/183 one by one.
I want to cancel other brances instantly as soon as i get reply from any other branch.
--
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/909
Starting Kamailio (4.4 with branch updates through e43d82d applied) with the following systemd unit file, native systemd/journald logging doesn't work as expected. I *do* get core logging when I use
```
log_engine_type="systemd"
loadmodule "log_systemd.so"
```
but `xlog` and `sd_journal_print` *don't* send anything to the journal.
When I comment out `log_engine_type`, keeping the log_systemd.so module loaded, `sd_journal_print` *does* log the messages properly to the systemd journal, `xlog` and core startup messages are sent to syslog.
If I change the service to `Type=simple` and add the `-D` option to `ExecStart` to disable forking, then logging to systemd via `xlog` and `sd_journal_print` works, but TCP/TLS listeners aren't created.
```
[Unit]
Description=Kamailio SIP Server
Documentation=man:kamailio(8) http://www.kamailio.org/
After=syslog.target network-online.target
Wants=network-online.target
[Service]
Type=forking
User=kamailio
Environment=SHM_SIZE=64
Environment=PKG_SIZE=8
ExecStartPre=/usr/sbin/kamailio -c
ExecStart=/usr/sbin/kamailio -m $SHM_SIZE -M $PKG_SIZE -P /run/kamailio/kamailio.pid
PIDFile=/run/kamailio/kamailio.pid
Restart=on-failure
RestartSec=30
RuntimeDirectory=kamailio
RuntimeDirectoryMode=0750
[Install]
WantedBy=multi-user.target
```
--
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/799
<!--
Kamailio Project uses GitHub Issues only for bugs in the code or feature requests.
If you have questions about using Kamailio or related to its configuration file,
ask on sr-users mailing list:
* http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
If you have questions about developing extensions to Kamailio or its existing
C code, ask on sr-dev mailing list
* http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
Please try to fill this template as much as possible for any issue. It helps the
developers to troubleshoot the issue.
If you submit a feature request (or enhancement), you can delete the text of
the template and only add the description of what you would like to be added.
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
<!--
Explain what you did, what you expected to happen, and what actually happened.
-->
I received a wireshark trace from a team member showing that a tel: uri was translated to a sip: uri in a very strange (invalid) way:
INVITE tel:491234567891;phone-context=ims.mnc001.mcc001.3gppnetwork.org
Was translated to:
INVITE sip:491234567891;phone-context=ims.mnc001.mcc001.3gppnetwork.org@ims.mnc001.mcc001.3gppnetwork.org;user=phone
### Troubleshooting
I first thought this was definitely an error, and only the phone number should be copied to the sip: uri. But, on further reading of the specification, (https://www.ietf.org/rfc/rfc3261.txt), I see that it is in fact legal to leave all parameters in. Though, when the phone-context parameter is simply a domain, it would at least seem the cleanest thing would be to remove it when the exact same domain is also inserted after the @ in the sip message.
So, looking to find where the message is translated, I saw in the scscf.cfg configuration file that there is a translation specified.
I found that "tel2sip" is mapped to the C function of the same name tel2sip()
In this function, the translation will do exactly what I found in the trace, in other words, it will leave in all parameters separated by semi-colon, inserted before the @ symbol.
But, reading the spec, I see that the spec is not being followed in any case. The spec states that all parameters included when translating, must be switched to alphabetic order, with the exception that
isdn-subaddress and post-dial, must occur first and in that order. There is no code in tel2sip() to perform that sorting.
Also, the parser removes '(', ')', '.', and '-' in the phone number, as specified, but, these same characters could be scattered anywhere in invalid places, and they are just silently removed, '+' can scattered anywhere and it is just left alone, Other characters can be scattered anywhere and they will just be left as-is, no error. So, I feel there should be some minimal checking of the phone number, trying to follow the spec (if we could just execute the BNF from the spec!).
#### Reproduction
<!--
If the issue can be reproduced, describe how it can be done.
-->
This can be reproduced by sending a tel: uri with parameters inserted separated by semicolon.
#### Debugging Data
<!--
If you got a core dump, use gdb to extract troubleshooting data - full backtrace,
local variables and the list of the code at the issue location.
gdb /path/to/kamailio /path/to/corefile
bt full
info locals
list
If you are familiar with gdb, feel free to attach more of what you consider to
be relevant.
-->
```
(none)
```
#### Log Messages
<!--
Check the syslog file and if there are relevant log messages printed by Kamailio, add them next, or attach to issue, or provide a link to download them (e.g., to a pastebin site).
-->
```
(none)
```
#### SIP Traffic
<!--
If the issue is exposed by processing specific SIP messages, grab them with ngrep or save in a pcap file, then add them next, or attach to issue, or provide a link to download them (e.g., to a pastebin site).
-->
```
See attached file
```
### Possible Solutions
<!--
If you found a solution or workaround for the issue, describe it. Ideally, provide a pull request with a fix.
-->
The solution would be to modify tel2sip(), adding the sorting of parameters, putting the two exceptions first if they exist, before inserting back into the string.
We should also throw errors on obvious bad formatting and ilegal characters, etc, in the input tel: uri
Should we remove the "phone-context" if it is a domain and also exactly the same as the domain inserted after the @?
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
version: kamailio 5.0.0-dev5 (x86_64/linux) da4ef4-dirty
flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, 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
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: da4ef4 -dirty
compiled on 10:37:40 May 12 2017 with gcc 5.4.0
```
SIP spec:
https://www.ietf.org/rfc/rfc3261.txtWireshark output:
![wireshark-tel2sip](https://user-images.githubusercontent.com/4886876/27705203-cfd3c150-5cd2-11e7-9f77-1664a51e7ac3.png)
```
In RFC 3966, Tel URI format:
The "tel" URI has the following syntax:
telephone-uri = "tel:" telephone-subscriber
telephone-subscriber = global-number / local-number
global-number = global-number-digits *par
local-number = local-number-digits *par context *par
par = parameter / extension / isdn-subaddress
isdn-subaddress = ";isub=" 1*uric
extension = ";ext=" 1*phonedigit
context = ";phone-context=" descriptor
descriptor = domainname / global-number-digits
global-number-digits = "+" *phonedigit DIGIT *phonedigit
local-number-digits =
*phonedigit-hex (HEXDIG / "*" / "#")*phonedigit-hex
domainname = *( domainlabel "." ) toplabel [ "." ]
domainlabel = alphanum
/ alphanum *( alphanum / "-" ) alphanum
toplabel = ALPHA / ALPHA *( alphanum / "-" ) alphanum
parameter = ";" pname ["=" pvalue ]
pname = 1*( alphanum / "-" )
pvalue = 1*paramchar
paramchar = param-unreserved / unreserved / pct-encoded
unreserved = alphanum / mark
mark = "-" / "_" / "." / "!" / "~" / "*" /
"'" / "(" / ")"
pct-encoded = "%" HEXDIG HEXDIG
param-unreserved = "[" / "]" / "/" / ":" / "&" / "+" / "$"
phonedigit = DIGIT / [ visual-separator ]
phonedigit-hex = HEXDIG / "*" / "#" / [ visual-separator ]
visual-separator = "-" / "." / "(" / ")"
alphanum = ALPHA / DIGIT
reserved = ";" / "/" / "?" / ":" / "@" / "&" /
"=" / "+" / "$" / ","
uric = reserved / unreserved / pct-encoded
```
* **Operating System**:
<!--
Details about the operating system, the type: Linux (e.g.,: Debian 8.4, Ubuntu 16.04, CentOS 7.1, ...), MacOS, xBSD, Solaris, ...;
Kernel details (output of `uname -a`)
-->
```
# uname -a
Linux epc-enablers 4.4.0-51-generic #72-Ubuntu SMP Thu Nov 24 18:29:54 UTC 2016 x86_64 x86_64 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/1173