When using hep(0x003) and hep(0x004) the extracted ip address would be written to the local ipstr buffer but when returning to the script the buffer would already be partially overwritten.
Keep the data around long enough by storing the result in a static buffer. You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/896
-- Commit Summary --
* hep: Store ipstr in a static buffer for exporting to cfg
-- File Changes --
M src/modules/sipcapture/hep.c (2)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/896.patch https://github.com/kamailio/kamailio/pull/896.diff
Dear @adubovikov, please have a look if that is the right way to fix it and if not tell what a proper fix would look lile.
for me it looks ok. But make it more sense copy all data to local pseudo variables in the kamailio.cfg and proceed it ?
Thank you for the super quick reply. The data is already "corrupted" before it is assigned to the variable in the script.
``` $var(src_ip) = $(hep(0x003){sql.val}); ```
Already causes the data to be corrupted at the 9th byte. Storing it statically seemed the most straight forward way.
ok. lets do it this way! Please merge!
Thank you!
Merged #896.