Module: kamailio
Branch: 5.7
Commit: e8150f78630f7991ea31a385c899c32c0e330a26
URL:
https://github.com/kamailio/kamailio/commit/e8150f78630f7991ea31a385c899c32…
Author: Stefan-Cristian Mititelu <stefan-cristian.mititelu(a)1and1.ro>
Committer: Stefan-Cristian Mititelu <stefan-cristian.mititelu(a)1and1.ro>
Date: 2024-03-18T13:23:29+02:00
pdb: Return negative carrierid for failures
(cherry picked from commit bf78b619ae28924361fb2c757a4d09eb1a39f5cd)
---
Modified: src/modules/pdb/pdb.c
---
Diff:
https://github.com/kamailio/kamailio/commit/e8150f78630f7991ea31a385c899c32…
Patch:
https://github.com/kamailio/kamailio/commit/e8150f78630f7991ea31a385c899c32…
---
diff --git a/src/modules/pdb/pdb.c b/src/modules/pdb/pdb.c
index 75013cccb7a..3c37e5971ea 100644
--- a/src/modules/pdb/pdb.c
+++ b/src/modules/pdb/pdb.c
@@ -386,20 +386,20 @@ static int pdb_query(struct sip_msg *_msg, struct multiparam_t
*_number,
goto found;
}
break;
- case PDB_CODE_NOT_NUMBER:
- LM_NOTICE("Number %s has letters in it\n",
- number.s);
- carrierid = 0;
- goto found;
case PDB_CODE_NOT_FOUND:
LM_NOTICE("Number %s pdb_id not found\n",
number.s);
- carrierid = 0;
+ carrierid = -1;
+ goto found;
+ case PDB_CODE_NOT_NUMBER:
+ LM_NOTICE("Number %s has letters in it\n",
+ number.s);
+ carrierid = -2;
goto found;
default:
LM_NOTICE("Invalid code %d received\n",
msg.hdr.code);
- carrierid = 0;
+ carrierid = -3;
goto found;
}