<!--
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
When trying to iterate over a semi-colon separated string list, the s.select transformation seems to be returning empty string instead of null, so the suggested idea from here does not work -> https://www.kamailio.org/wiki/tutorials/faq/main#how_to_iterate_through_the…
It is expected that the access to an invalid index would return null.
### Troubleshooting
avp and var variables were tried and both had the same result.
### Reproduction
Original piece of code is below. The while loop will run until the max_while_loops is reached.
The "DEBUG" log line will print the loop iterator value and an empty string for nonexistent values.
```
$var(allowed_headers) = "X-header1; X-header2;";
if (not_empty("$var(allowed_headers)")) {
xlog("L_NOTICE","Forwarding headers: $avp(allowed_headers)\n");
$var(i) = 0;
while($(var(allowed_headers){s.select,$var(i),;}) != $null)
{
xlog("L_NOTICE","DEBUG: $var(i) - $(var(allowed_headers){s.select,$var(i),;})\n");
$var(hdr) = $(var(allowed_headers){s.select,$var(i),;}{s.trim});
if (not_empty("$var(hdr)") &&
not_empty("$(hdr($var(hdr)))")) {
xlog("L_NOTICE","Header: $var(hdr): $(hdr($var(hdr))) allowed\n");
append_hf("$var(hdr): $(hdr($var(hdr)))\r\n");
}
$var(i) = $var(i) + 1;
}
}
```
It is also possible to simulate it by simply doing this:
```
$var(allowed_headers) = "X-header1; X-header2;";
if ($(var(allowed_headers){s.select,100,;}) != $null) {
xlog("L_ERR","THIS IS WRONG :(");
}
```
### Possible Solutions
Other while conditions can be done. but this is the most elegant and is not working.... For example, checking with "not_empty" works, but then we can't actually have empty values in the semi-colon separated list because it would stop the loop and entries after that would not be reached....
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
# kamailio -v
version: kamailio 5.2.2 (x86_64/linux) 67f967
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_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: 67f967
compiled on 11:40:41 Mar 11 2019 with gcc 4.8.5
```
* **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 voice-conn-kamailio-1 3.10.0-514.21.2.el7.x86_64 #1 SMP Tue Jun 20 12:24:47 UTC 2017 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/2128
### Description
On `Fedora 31` dist master build log contains this warnings
```
make --no-print-directory -C ./squirrel/squirrel SQMARCH64="-m64" CC_EXTRA_FLAGS="-fPIC" \
OUT="../../libsquirrel.a" sq64
gcc -O2 -m64 -D_SQ64 -fno-exceptions -fno-rtti -Wall -fno-strict-aliasing -c sqapi.cpp sqbaselib.cpp sqfuncstate.cpp sqdebug.cpp sqlexer.cpp sqobject.cpp sqcompiler.cpp sqstate.cpp sqtable.cpp sqmem.cpp sqvm.cpp sqclass.cpp -I../include -I. -Iinclude -fPIC
In file included from sqobject.h:5,
from sqpcheader.h:17,
from sqapi.cpp:4:
squtils.h: In instantiation of 'void sqvector::remove(SQUnsignedInteger) [with T = SQObjectPtr; SQUnsignedInteger = long long unsigned int]':
sqarray.h:83:27: required from here
squtils.h:97:20: warning: 'void* memmove(void*, const void*, size_t)' writing to an object of type 'struct SQObjectPtr' with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Wclass-memaccess]
97 | memmove(&_vals[idx], &_vals[idx+1], sizeof(T) * (_size - idx - 1));
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from sqpcheader.h:17,
from sqapi.cpp:4:
sqobject.h:205:8: note: 'struct SQObjectPtr' declared here
205 | struct SQObjectPtr : public SQObject
| ^~~~~~~~~~~
In file included from sqobject.h:5,
from sqpcheader.h:17,
from sqbaselib.cpp:4:
squtils.h: In instantiation of 'void sqvector::remove(SQUnsignedInteger) [with T = SQObjectPtr; SQUnsignedInteger = long long unsigned int]':
sqarray.h:83:27: required from here
squtils.h:97:20: warning: 'void* memmove(void*, const void*, size_t)' writing to an object of type 'struct SQObjectPtr' with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Wclass-memaccess]
97 | memmove(&_vals[idx], &_vals[idx+1], sizeof(T) * (_size - idx - 1));
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from sqpcheader.h:17,
from sqbaselib.cpp:4:
sqobject.h:205:8: note: 'struct SQObjectPtr' declared here
205 | struct SQObjectPtr : public SQObject
| ^~~~~~~~~~~
In file included from sqobject.h:5,
from sqpcheader.h:17,
from sqobject.cpp:4:
squtils.h: In instantiation of 'void sqvector::remove(SQUnsignedInteger) [with T = SQObjectPtr; SQUnsignedInteger = long long unsigned int]':
sqarray.h:83:27: required from here
squtils.h:97:20: warning: 'void* memmove(void*, const void*, size_t)' writing to an object of type 'struct SQObjectPtr' with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Wclass-memaccess]
97 | memmove(&_vals[idx], &_vals[idx+1], sizeof(T) * (_size - idx - 1));
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from sqpcheader.h:17,
from sqobject.cpp:4:
sqobject.h:205:8: note: 'struct SQObjectPtr' declared here
205 | struct SQObjectPtr : public SQObject
| ^~~~~~~~~~~
In file included from sqobject.h:5,
from sqpcheader.h:17,
from sqstate.cpp:4:
squtils.h: In instantiation of 'void sqvector::remove(SQUnsignedInteger) [with T = SQObjectPtr; SQUnsignedInteger = long long unsigned int]':
sqarray.h:83:27: required from here
squtils.h:97:20: warning: 'void* memmove(void*, const void*, size_t)' writing to an object of type 'struct SQObjectPtr' with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Wclass-memaccess]
97 | memmove(&_vals[idx], &_vals[idx+1], sizeof(T) * (_size - idx - 1));
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from sqpcheader.h:17,
from sqstate.cpp:4:
sqobject.h:205:8: note: 'struct SQObjectPtr' declared here
205 | struct SQObjectPtr : public SQObject
| ^~~~~~~~~~~
In file included from sqobject.h:5,
from sqpcheader.h:17,
from sqvm.cpp:4:
squtils.h: In instantiation of 'void sqvector::remove(SQUnsignedInteger) [with T = SQObjectPtr; SQUnsignedInteger = long long unsigned int]':
sqarray.h:83:27: required from here
squtils.h:97:20: warning: 'void* memmove(void*, const void*, size_t)' writing to an object of type 'struct SQObjectPtr' with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Wclass-memaccess]
97 | memmove(&_vals[idx], &_vals[idx+1], sizeof(T) * (_size - idx - 1));
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from sqpcheader.h:17,
from sqvm.cpp:4:
sqobject.h:205:8: note: 'struct SQObjectPtr' declared here
205 | struct SQObjectPtr : public SQObject
| ^~~~~~~~~~~
ar rc ../../libsquirrel.a *.o
```
--
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/2135
Hello,
I will be in about 2 weeks in Istanbul and in Cairo a few days later.
I am thinking of organizing a Kamailio/SIP/VoIP social networking event (perhaps a dinner or a pub meeting). Possible dates are the 19th- 20th November in Istanbul and the 23th - 24th November in Cairo. Are people from the community interested in joining such event?
If yes, write me your preferred date -- based on feedback in the next days, it will be decided whether it is going to happen and when.
Best regards,
Henning
--
Henning Westerholt - https://skalatan.de/blog/
Kamailio services - https://skalatan.de/services
**Version** : kamailio 4.2
**platform** : linux
**Description**
Currently I am using **ims_charging** module ...so from the script we are calling **RO_CCR(6 param)** function ..Until this point it is working fine But the problem occurs when i am passing extra parameter in **RO_CCR(7 param)** function,we are getting **Too many arguments error** from the script **BUT** we made appropriate changes in ims_charging for this.please see the below code changes for more info.
**static int **w_ro_ccr****(struct sip_msg *msg, str* route_name, str* direction, str* charge_type, str* unit_type, int reservation_units, char *_d,char *cpaas);
static cmd_export_t cmds[] = {
{ "Ro_CCR", (cmd_function) **w_ro_ccr**,7, ro_fixup, 0, REQUEST_ROUTE },
{ 0, 0, 0, 0, 0, 0}
};
--
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/2138
### Description
**Use case**
Kamailio installed in AWS cloud.
Exist phones located in internet and exist phones connected via VPN.
As option, also may exist phones connected via docker VxLAN or any other Kubernetes providers.
I want use same `listen` for all this connections types.
Need to `advertise` different IP for each connection type.
Could you add ability advertise different IP using ACL info.
As example
```
listen=udp:eth0:5060 advertise 192.168.34.34:5060 for_acl 0
listen=udp:eth0:5060 advertise 172.16.20.41:5060 for_acl 1
listen=udp:eth0:5060 advertise 10.14.11.4:5060 for_acl 2
listen=udp:eth0:5060 advertise 52.24.22.57:5060
```
### Expected behavior
Kamailio will apply different `advertise` option dependent of source IP of incoming packet.
#### Actual observed behavior
Listener support only one `advertise` param.
--
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/2131