Hi guys,
I am trying to 'search&replace' some patterns in message body but
unfortunately with no result (but bunch of errors).
First of all I am trying to perform regex substitution as one that can be
seen at https://regex101.com/r/vF1kZ7/1
Since I have regular expression I am trying to convert it so it will work
with `sub_str` function from re.h
Here is my attempt:
https://gist.github.com/ivanbarlog/1b552b57e89bf4670872#file-test-c-L12
I had quite lot of errors but last error I am getting is that
`subst_parser` cannot find separator
https://github.com/kamailio/kamailio/blob/master/re.c#L240
Since the `struct subst_expr` is not parsed right the next error is
segfault in `subst_str` function.
If someone can explain me how exactly I should use `subst_str` function
with my regex I'll be really grateful. Little example code would be also
great.
Thanks in advance
Module: kamailio
Branch: master
Commit: 3b5633de56c2367d19122f0f3c01698af34a21e9
URL: https://github.com/kamailio/kamailio/commit/3b5633de56c2367d19122f0f3c01698…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2015-03-11T09:42:02+01:00
ctl: use uid/gid from the core if not set for the module
- otherwise it cannot do clean created files at shut down
---
Modified: modules/ctl/ctl.c
---
Diff: https://github.com/kamailio/kamailio/commit/3b5633de56c2367d19122f0f3c01698…
Patch: https://github.com/kamailio/kamailio/commit/3b5633de56c2367d19122f0f3c01698…
---
diff --git a/modules/ctl/ctl.c b/modules/ctl/ctl.c
index 2a05435..f630f8a 100644
--- a/modules/ctl/ctl.c
+++ b/modules/ctl/ctl.c
@@ -264,6 +264,9 @@ static int mod_init(void)
goto error;
}
}
+ /* get the uid/gid from core if not set for the module */
+ if(usock_uid==-1 && sock_uid!=-1) usock_uid = sock_uid;
+ if(usock_gid==-1 && sock_gid!=-1) usock_gid = sock_gid;
/* open socket now, before suid */
if (init_ctrl_sockets(&ctrl_sock_lst, listen_lst, DEFAULT_CTL_PORT,
usock_mode, usock_uid, usock_gid)<0){