Module: kamailio
Branch: 5.8
Commit: 6410f375cd6d1e357afeb9e100bd3a3c51321280
URL:
https://github.com/kamailio/kamailio/commit/6410f375cd6d1e357afeb9e100bd3a3…
Author: Stefan-Cristian Mititelu <stefan-cristian.mititelu(a)1and1.ro>
Committer: Stefan-Cristian Mititelu <stefan-cristian.mititelu(a)1and1.ro>
Date: 2024-03-18T13:35:05+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/6410f375cd6d1e357afeb9e100bd3a3…
Patch:
https://github.com/kamailio/kamailio/commit/6410f375cd6d1e357afeb9e100bd3a3…
---
diff --git a/src/modules/pdb/pdb.c b/src/modules/pdb/pdb.c
index 6889e63b915..1398f7574f8 100644
--- a/src/modules/pdb/pdb.c
+++ b/src/modules/pdb/pdb.c
@@ -393,20 +393,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;
}