[sr-dev] git:master:2cb4ca9c: cfgt: group RPC commands using module name
Daniel-Constantin Mierla
miconda at gmail.com
Tue Dec 3 13:18:23 CET 2019
Hello,
while not strictly enforced, the first group of letters in the rpc
command name is the module name, so it would be better to use
"cfgt.dbg.mask" instead of "dbg.cfgt.mask".
Cheers,
Daniel
On 03.12.19 12:41, Victor Seva wrote:
> Module: kamailio
> Branch: master
> Commit: 2cb4ca9c436f1e6e21a21b100f7a79a25e023865
> URL: https://github.com/kamailio/kamailio/commit/2cb4ca9c436f1e6e21a21b100f7a79a25e023865
>
> Author: Victor Seva <linuxmaniac at torreviejawireless.org>
> Committer: Victor Seva <linuxmaniac at torreviejawireless.org>
> Date: 2019-12-03T12:24:33+01:00
>
> cfgt: group RPC commands using module name
>
> ---
>
> Modified: src/modules/cfgt/cfgt_int.c
>
> ---
>
> Diff: https://github.com/kamailio/kamailio/commit/2cb4ca9c436f1e6e21a21b100f7a79a25e023865.diff
> Patch: https://github.com/kamailio/kamailio/commit/2cb4ca9c436f1e6e21a21b100f7a79a25e023865.patch
>
> ---
>
> diff --git a/src/modules/cfgt/cfgt_int.c b/src/modules/cfgt/cfgt_int.c
> index b8a6456fc4..5d29fdb870 100644
> --- a/src/modules/cfgt/cfgt_int.c
> +++ b/src/modules/cfgt/cfgt_int.c
> @@ -328,7 +328,7 @@ void cfgt_save_node(cfgt_node_p node)
> dest.s[dir] = '\0';
> LM_DBG("dir [%s]\n", dest.s);
> if(stat(dest.s, &sb) == 0 && S_ISDIR(sb.st_mode)) {
> - LM_DBG("dir [%s] already existing\n", dest.s);
> + LM_DBG("dir [%s] already exists\n", dest.s);
> } else if(mkdir(dest.s, S_IRWXO | S_IXGRP | S_IRWXU) < 0) {
> LM_ERR("failed to make directory: %s\n", strerror(errno));
> return;
> @@ -725,8 +725,12 @@ static void cfgt_rpc_mask(rpc_t *rpc, void *ctx)
> rpc->add(ctx, "s", "200 ok");
> }
>
> +/* clang-format off */
> rpc_export_t cfgt_rpc[] = {
> - {"dbg.mask", cfgt_rpc_mask, cfgt_rpc_mask_doc, 0}, {0, 0, 0, 0}};
> + {"dbg.cfgt.mask", cfgt_rpc_mask, cfgt_rpc_mask_doc, 0},
> + {0, 0, 0, 0}
> +};
> +/* clang-format on */
>
> int cfgt_init(void)
> {
>
>
> _______________________________________________
> Kamailio (SER) - Development Mailing List
> sr-dev at lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
--
Daniel-Constantin Mierla -- www.asipto.com
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio World Conference - April 27-29, 2020, in Berlin -- www.kamailioworld.com
More information about the sr-dev
mailing list