Module: kamailio
Branch: 5.6
Commit: 831b832916083900d1426e53518f34ed77aa28ad
URL:
https://github.com/kamailio/kamailio/commit/831b832916083900d1426e53518f34e…
Author: Stefan-Cristian Mititelu <stefan-cristian.mititelu(a)1and1.ro>
Committer: Stefan-Cristian Mititelu <stefan-cristian.mititelu(a)1and1.ro>
Date: 2024-03-18T13:20:09+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/831b832916083900d1426e53518f34e…
Patch:
https://github.com/kamailio/kamailio/commit/831b832916083900d1426e53518f34e…
---
diff --git a/src/modules/pdb/pdb.c b/src/modules/pdb/pdb.c
index bfe31b4e8eb..e310d43acae 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;
}