Module: kamailio
Branch: master
Commit: 0857fdd4314ef98ff0f83258e310f344d790e644
URL:
https://github.com/kamailio/kamailio/commit/0857fdd4314ef98ff0f83258e310f34…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2017-01-04T23:29:38+01:00
carrierroute: more log messages for error cases in rpc dump command
---
Modified: src/modules/carrierroute/cr_fifo.c
---
Diff:
https://github.com/kamailio/kamailio/commit/0857fdd4314ef98ff0f83258e310f34…
Patch:
https://github.com/kamailio/kamailio/commit/0857fdd4314ef98ff0f83258e310f34…
---
diff --git a/src/modules/carrierroute/cr_fifo.c b/src/modules/carrierroute/cr_fifo.c
index 20733ce..6e0a7a2 100644
--- a/src/modules/carrierroute/cr_fifo.c
+++ b/src/modules/carrierroute/cr_fifo.c
@@ -1180,6 +1180,7 @@ void cr_rpc_dump_routes(rpc_t* rpc, void* ctx)
for (i = 0; i < rd->carrier_num; i++) {
if (rd->carriers[i]) {
if (rpc->array_add(ih, "{", &dh)<0) {
+ LM_ERR("add carrier data failure at count %d\n", i);
rpc->fault(ctx, 500, "Response failure - carrier data");
goto error;
}
@@ -1188,6 +1189,7 @@ void cr_rpc_dump_routes(rpc_t* rpc, void* ctx)
"id", (rd->carriers[i] ? rd->carriers[i]->id : 0),
"domains", &eh)<0)
{
+ LM_ERR("add carrier structure failure at count %d\n", i);
rpc->fault(ctx, 500, "Internal error - carrier structure");
goto error;
}
@@ -1195,6 +1197,7 @@ void cr_rpc_dump_routes(rpc_t* rpc, void* ctx)
for (j=0; j<rd->carriers[i]->domain_num; j++) {
if (rd->carriers[i]->domains[j] &&
rd->carriers[i]->domains[j]->tree) {
if (rpc->array_add(eh, "{", &fh)<0) {
+ LM_ERR("add domain data failure at count %d/%d\n", i, j);
rpc->fault(ctx, 500, "Response failure - domain data");
goto error;
}
@@ -1203,12 +1206,15 @@ void cr_rpc_dump_routes(rpc_t* rpc, void* ctx)
"id", rd->carriers[i]->domains[j]->id,
"data", &gh)<0)
{
+ LM_ERR("add domain structure failure at count %d/%d\n", i, j);
rpc->fault(ctx, 500, "Internal error - domain structure");
goto error;
}
if (cr_rpc_dump_tree_recursor (rpc, ctx, gh,
- rd->carriers[i]->domains[j]->tree, "") < 0)
+ rd->carriers[i]->domains[j]->tree, "") < 0) {
+ LM_ERR("dump tree recursor failure at count %d/%d\n", i, j);
goto error;
+ }
}
}
}