Covers setups when kamailio behind the service with HAPROXY protocol support but in other hand it also serves requests from other services that available per direct connection (such as B2BUA in the same local network).
#### Pre-Submission Checklist
- [*] 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:
- [*] PR should be backported to stable branches
- [*] Tested changes locally
#### Description
- function tcpconn_read_haproxy() returns 2 if PROXY header NOT found.
- Message about no header shown at the debug level.
- No errors
- TCP connection successfully establishes
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/2206
-- Commit Summary --
* handle tcp request with tcp_accept_haproxy even no PROXY header found
* core:tcp allow to handle TCP connections even message does not contain PROXY protocol header
* core:tcp allow to handle TCP connections even message does not contain PROXY protocol header
-- File Changes --
M src/core/tcp_main.c (8)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/2206.patchhttps://github.com/kamailio/kamailio/pull/2206.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/2206
<!-- 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/2209
-- Commit Summary --
* add received_in_via function(use it in hiops module)
* hiops: new module in Kamailio
-- File Changes --
M src/core/msg_translator.c (25)
M src/core/msg_translator.h (3)
A src/modules/hiops/Alarm-Indicator.c (153)
A src/modules/hiops/Alarm-Indicator.h (57)
A src/modules/hiops/BIT_STRING.c (189)
A src/modules/hiops/BIT_STRING.h (33)
A src/modules/hiops/CMakeLists.txt (92)
A src/modules/hiops/Code.c (64)
A src/modules/hiops/Code.h (49)
A src/modules/hiops/CommunicationIdentifier.c (94)
A src/modules/hiops/CommunicationIdentifier.h (43)
A src/modules/hiops/GeneralizedTime.c (706)
A src/modules/hiops/GeneralizedTime.h (69)
A src/modules/hiops/HI1-Operation.c (94)
A src/modules/hiops/HI1-Operation.h (61)
A src/modules/hiops/IA5String.c (77)
A src/modules/hiops/IA5String.h (27)
A src/modules/hiops/INTEGER.c (1025)
A src/modules/hiops/INTEGER.h (82)
A src/modules/hiops/IP-value.c (130)
A src/modules/hiops/IP-value.h (55)
A src/modules/hiops/IPAddress.c (393)
A src/modules/hiops/IPAddress.h (67)
A src/modules/hiops/LawfulInterceptionIdentifier.c (126)
A src/modules/hiops/LawfulInterceptionIdentifier.h (38)
A src/modules/hiops/LocalTimeStamp.c (191)
A src/modules/hiops/LocalTimeStamp.h (50)
A src/modules/hiops/Makefile (15)
A src/modules/hiops/National-HI1-ASN1parameters.c (139)
A src/modules/hiops/National-HI1-ASN1parameters.h (43)
A src/modules/hiops/NativeEnumerated.c (207)
A src/modules/hiops/NativeEnumerated.h (32)
A src/modules/hiops/NativeInteger.c (332)
A src/modules/hiops/NativeInteger.h (37)
A src/modules/hiops/Network-Element-Identifier.c (198)
A src/modules/hiops/Network-Element-Identifier.h (60)
A src/modules/hiops/Network-Identifier.c (94)
A src/modules/hiops/Network-Identifier.h (48)
A src/modules/hiops/Notification.c (153)
A src/modules/hiops/Notification.h (57)
A src/modules/hiops/OBJECT_IDENTIFIER.c (764)
A src/modules/hiops/OBJECT_IDENTIFIER.h (139)
A src/modules/hiops/OCTET_STRING.c (1807)
A src/modules/hiops/OCTET_STRING.h (86)
A src/modules/hiops/PrintableString.c (109)
A src/modules/hiops/PrintableString.h (24)
A src/modules/hiops/Priority.c (125)
A src/modules/hiops/Priority.h (38)
A src/modules/hiops/TimeStamp.c (64)
A src/modules/hiops/TimeStamp.h (49)
A src/modules/hiops/UTCTime.c (179)
A src/modules/hiops/UTCTime.h (38)
A src/modules/hiops/asn_application.h (47)
A src/modules/hiops/asn_codecs.h (109)
A src/modules/hiops/asn_codecs_prim.c (312)
A src/modules/hiops/asn_codecs_prim.h (53)
A src/modules/hiops/asn_internal.h (128)
A src/modules/hiops/asn_system.h (137)
A src/modules/hiops/ber_decoder.c (283)
A src/modules/hiops/ber_decoder.h (64)
A src/modules/hiops/ber_tlv_length.c (178)
A src/modules/hiops/ber_tlv_length.h (50)
A src/modules/hiops/ber_tlv_tag.c (144)
A src/modules/hiops/ber_tlv_tag.h (60)
A src/modules/hiops/constr_CHOICE.c (1114)
A src/modules/hiops/constr_CHOICE.h (57)
A src/modules/hiops/constr_SEQUENCE.c (1425)
A src/modules/hiops/constr_SEQUENCE.h (60)
A src/modules/hiops/constr_TYPE.c (77)
A src/modules/hiops/constr_TYPE.h (180)
A src/modules/hiops/constraints.c (93)
A src/modules/hiops/constraints.h (63)
A src/modules/hiops/der_encoder.c (201)
A src/modules/hiops/der_encoder.h (68)
A src/modules/hiops/hi1ops.c (682)
A src/modules/hiops/hi1ops.h (102)
A src/modules/hiops/hi2ops.c (1319)
A src/modules/hiops/hi2ops.h (109)
A src/modules/hiops/hiops.c (272)
A src/modules/hiops/hiops.h (38)
A src/modules/hiops/per_decoder.c (93)
A src/modules/hiops/per_decoder.h (56)
A src/modules/hiops/per_encoder.c (151)
A src/modules/hiops/per_encoder.h (69)
A src/modules/hiops/per_opentype.c (378)
A src/modules/hiops/per_opentype.h (22)
A src/modules/hiops/per_support.c (483)
A src/modules/hiops/per_support.h (135)
A src/modules/hiops/tcp_socket.c (136)
A src/modules/hiops/tcp_socket.h (39)
A src/modules/hiops/xer_decoder.c (368)
A src/modules/hiops/xer_decoder.h (106)
A src/modules/hiops/xer_encoder.c (67)
A src/modules/hiops/xer_encoder.h (59)
A src/modules/hiops/xer_support.c (227)
A src/modules/hiops/xer_support.h (55)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/2209.patchhttps://github.com/kamailio/kamailio/pull/2209.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/2209
<!--
Kamailio Project uses GitHub Issues only for bugs in the code or feature requests. Please use this template only for feature requests.
If you have questions about using Kamailio or related to its configuration file, ask on sr-users mailing list:
* http://lists.kamailio.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.kamailio.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) 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
Looking for a mechanism to reload Location attributes at runtime.
Having both registered and permanent Contacts under AoR, with Attributes from `usrloc` to be used for various routing decisions.
This is about attributes of permanent Contacts. Registered ones have `xavp_contact` of `usrloc` to store attributes during registration.
**Problem:**
Only way to make it work is:
1. adding a permanent Contact using `rpc ul.add`
2. assigning attributes in DB `location_attr` per RUID (can't find an rpc function for attributes)
3. restart Kamailio
modparam("usrloc", "db_mode", 1)
modparam("usrloc", "db_load", 1)
This however is far from ideal, having to restart Kamailio for every change in attributes of a Contact.
### Expected behavior
#### Actual observed behavior
#### Debugging Data
```
(paste your debugging data here)
```
#### 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).
-->
```
(paste your log messages here)
```
#### 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).
-->
```
(paste your sip traffic here)
```
### Possible Solutions
<!--
If you found a solution or workaround for the issue, describe it. Ideally, provide a pull request with a improvement.
-->
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
version: kamailio 5.3.3 (x86_64/linux) 44ccb9
* **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`)
-->
```
(paste your output here)
```
--
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/2299
<!--
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:
* http://lists.kamailio.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.kamailio.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 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
We are using xmlrpc to terminate the calls once customer balance reaches to zero. call got terminated but we will not be able to set the dialog variable related to hangup_reason. There should be a way during dlg.terminate_dlg xmlrpc request that if i mention the some parameter then it should set before sending bye to callee and caller.
<!--
Explain what you did, what you expected to happen, and what actually happened.
-->
### Troubleshooting
#### Reproduction
<!--
If the issue can be reproduced, describe how it can be done.
-->
#### 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.
-->
```
(paste your debugging data here)
```
#### 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).
-->
```
(paste your log messages here)
```
#### 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).
-->
```
(paste your sip traffic here)
```
### Possible Solutions
<!--
If you found a solution or workaround for the issue, describe it. Ideally, provide a pull request with a fix.
-->
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
root@ip-172-31-4-160:/etc/kamailio# kamailio -version
version: kamailio 5.1.4 (x86_64/linux) 6ebfda
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: 6ebfda
compiled on 11:48:26 Sep 7 2018 with gcc 4.8.4
```
* **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`)
-->
```
root@ip-172-31-4-160:/etc/kamailio# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.5 LTS
Release: 14.04
Codename: trusty
root@ip-172-31-4-160:/etc/kamailio# uname -a
Linux ip-172-31-4-160 3.13.0-143-generic #192-Ubuntu SMP Tue Feb 27 10:45:36 UTC 2018 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/1737
This will allow us to point https://www.kamailio.org/wiki/features/new-in-devel to the file and "force" developers to update that file with the new features when they are introduced in the repository
Remaining developers to upgrade the wiki seems pointless and anyone can create a PR for changes
---
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/668
### Description
Consuming messages without message body fails due to a JSON parsing error:
```
ERROR: kazoo [kz_json.c:287]: kz_json_parse(): Error parsing json: unexpected end of data
ERROR: kazoo [kz_json.c:288]: kz_json_parse():
ERROR: kazoo [kz_amqp.c:2960]: kz_amqp_send_worker_event(): error parsing json body
```
This makes it unable to consume messages from RabbitMQ's event exchange plugin ( https://www.rabbitmq.com/event-exchange.html ), as the documentatin states: **"The message body is always blank."**
### Possible Solutions
As a possible fix I tried following change in kz_amqp.c:
```
void kz_amqp_send_worker_event(kz_amqp_server_ptr server_ptr, amqp_envelope_t* envelope, kz_amqp_bind_ptr bind)
{
char buffer[100];
kz_amqp_cmd_ptr cmd = NULL;
kz_amqp_consumer_delivery_ptr ptr = NULL;
json_obj_ptr json_obj = NULL;
json_object* JObj = NULL;
str* message_id = NULL;
int idx = envelope->channel-1;
int worker = 0;
int _kz_server_id = server_ptr->id;
int msg_size = envelope->message.body.len;
//begin of changes
int routingkey_size = envelope->routing_key.len;
if (msg_size == 0 && routingkey_size > 0 ) {
char *routingkey_data = pkg_malloc(routingkey_size + 1);
memset(routingkey_data, 0, routingkey_size + 1);
memcpy(routingkey_data, (char*)envelope->routing_key.bytes, routingkey_size);
LM_DBG("Message size: %d\n", msg_size);
LM_DBG("Routing Key: %s\n", routingkey_data);
char *pos = strchr(routingkey_data,'.');
while (pos){
*pos = '_';
pos = strchr(pos,'.');
}
LM_DBG("New Routing Key: %s\n", routingkey_data);
sprintf(buffer, "kazoo:%s", routingkey_data);
if(kz_amqp_consumer_fire_event(buffer) != 0) {
LM_ERR("kazoo:%s not found", routingkey_data);
}
pkg_free(routingkey_data);
return;
}
char *json_data = pkg_malloc(msg_size + 1);
if(!json_data) {
LM_ERR("no more package memory available. needed %d\n", msg_size + 1);
return;
}
char *json_data = pkg_malloc(msg_size + 1);
//end of changes
if(!json_data) {
LM_ERR("no more package memory available. needed %d\n", msg_size + 1);
return;
}
```
The change is rather simple: If there is no message-body supplied, the event-route _kazoo:<binding_key>_ is called (after replacing any '.' with '_' in the routing_key).
--
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/1837
**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
Currently, the `geoip2` module loads the IP database at startup and keeps it in cache and there is no way to tell Kamailio to reload the database without a full restart.
### Possible Solutions
To keep this module inline with other modules that use external datasources, I would suggest to implement a new RPC command and a new geoip2 function to reload the database defined in the `path` geoip2 modparam without the need of a restart.
I'm not aware of the effort required for implementing either of them, but only having an RPC command would effectively solve this issue as you can call RPC commands from within Kamailio conf, thus, the reload function would not be something strictly required but more of a nice-to-have.
### Examples:
Function:
```
geoip2_reload()
```
RPC command:
```
kamctl rpc gip2.reload / kamctl rpc geoip2.reload
```
Kamcmd command:
```
kamcmd geoip2.reload
```
--
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/2029