The filter has a regex looking for a literal '{' in the beginning of a line. Some awk implementations interpret this as a meta character, so the regex is deemed broken. Example with busybox awk (POSIX):
`root@hank2:~# kamctl ps` `awk: bad regex '^{.+"id"[ ]*:[ ]*[0-9]+[ ]*}$': Invalid contents of {}` `root@hank2:~#`
To fix this enclose the character in square brackets. This always matches for a literal '{' and is portable.
Signed-off-by: Sebastian Kemper sebastian_ml@gmx.net
#### 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: - [x] PR should be backported to stable branches - [x] Tested changes locally - [x] Related to issue #1429
#### Description
Hi all,
I was trying to run kamctl on OpenWrt and the regex failed. I found a (closed) issue and the remedy was to use gawk. But it's actually easy to fix in the regex and when I can run busybox awk I can't save the space which would be needed for gawk. OpenWrt is usually run on embedded so space is often an issue :)
Thanks for looking at this!
Kind regards, Seb You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/1669
-- Commit Summary --
* kamctl: make jsonrpc filter portable
-- File Changes --
M utils/kamctl/kamctl.base (2)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/1669.patch https://github.com/kamailio/kamailio/pull/1669.diff