Module: kamailio
Branch: master
Commit: 7feb38651970fc1f3cfd90769685c46804ab25ae
URL:
https://github.com/kamailio/kamailio/commit/7feb38651970fc1f3cfd90769685c46…
Author: Olle E. Johansson <oej(a)edvina.net>
Committer: Olle E. Johansson <oej(a)edvina.net>
Date: 2022-01-03T16:36:46+01:00
secfilter: Convert error messages to error responses in secf_rpc_add_dst()
---
Modified: src/modules/secfilter/secfilter_rpc.c
---
Diff:
https://github.com/kamailio/kamailio/commit/7feb38651970fc1f3cfd90769685c46…
Patch:
https://github.com/kamailio/kamailio/commit/7feb38651970fc1f3cfd90769685c46…
---
diff --git a/src/modules/secfilter/secfilter_rpc.c
b/src/modules/secfilter/secfilter_rpc.c
index cea9d400e8..2f763e4732 100644
--- a/src/modules/secfilter/secfilter_rpc.c
+++ b/src/modules/secfilter/secfilter_rpc.c
@@ -63,7 +63,7 @@ void secf_rpc_add_dst(rpc_t *rpc, void *ctx)
char *text = NULL;
if(rpc->scan(ctx, "d", &number) < 1) {
- rpc->fault(ctx, 0,
+ rpc->fault(ctx, 500,
"Invalid Parameters. Usage: secfilter.add_dst "
"number\n Example: secfilter.add_dst "
"555123123");
@@ -73,7 +73,7 @@ void secf_rpc_add_dst(rpc_t *rpc, void *ctx)
data.s = pkg_malloc(data.len * sizeof(char));
if(!data.s) {
PKG_MEM_ERROR;
- rpc->rpl_printf(ctx, "Error insert values in the blacklist");
+ rpc->fault(ctx, 500, "Error insert values in the blacklist");
return;
}
memcpy(data.s, text, data.len);
@@ -82,7 +82,7 @@ void secf_rpc_add_dst(rpc_t *rpc, void *ctx)
rpc->rpl_printf(ctx,
"Values (%s) inserted into blacklist destinations", data);
} else {
- rpc->rpl_printf(ctx, "Error insert values in the blacklist");
+ rpc->fault(ctx, 500, "Error insert values in the blacklist");
}
lock_release(&secf_data->lock);
if(data.s)