[sr-dev] [kamailio/kamailio] redis_cmd with more than 3 %s insertions causes parse error (#2457)

Daniel I Greenwald notifications at github.com
Tue Aug 25 21:57:06 CEST 2020


### Description

<!--
Explain what you did, what you expected to happen, and what actually happened.
-->

### Troubleshooting
3 insertions works:

`redis_cmd("kam_redis", "SET %s %s-%s", "test_key", "foo", "bar", "r");`

4 does not:

`redis_cmd("kam_redis", "SET %s %s-%s-%s", "test_key", "foo", "bar", "bar2", "r");`

#### Reproduction
add this to cfg, run `kamailio -c`
`redis_cmd("kam_redis", "SET %s %s-%s-%s", "test_key", "foo", "bar", "bar2", "r");`

#### Log Messages

```
 0(30690) CRITICAL: <core> [core/cfg.y:3517]: yyerror_at(): parse error in config file /etc/kamailio/kamailio.cfg, line 433, column 83: Too many arguments

 0(30690) CRITICAL: <core> [core/cfg.y:3517]: yyerror_at(): parse error in config file /etc/kamailio/kamailio.cfg, line 433, column 83: '('')' expected (function call)
 0(30690) CRITICAL: <core> [core/cfg.y:3517]: yyerror_at(): parse error in config file /etc/kamailio/kamailio.cfg, line 433, column 83: bad command: missing ';'?
 0(30690) ERROR: <core> [core/cfg.y:3363]: yyparse(): function used inside params of another function: xlog
 0(30690) CRITICAL: <core> [core/cfg.y:3517]: yyerror_at(): parse error in config file /etc/kamailio/kamailio.cfg, line 435, column 9: use of function execution inside params not allowed

```

### Additional Information

  * **Kamailio Version** - output of `kamailio -v`

```
version: kamailio 5.2.7 (x86_64/linux) 
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: unknown 
compiled with gcc 5.4.0
root at vagrant-ubuntu-xenial-64
```

* **Operating System**:

Ubuntu 16.04



-- 
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/2457
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20200825/07c3b620/attachment.htm>


More information about the sr-dev mailing list