Module: kamailio
Branch: master
Commit: 0fd1516b9519f84a0f24b3c9a2c643e74f1dc527
URL:
https://github.com/kamailio/kamailio/commit/0fd1516b9519f84a0f24b3c9a2c643e…
Author: Stefan-Cristian Mititelu <stefan-cristian.mititelu(a)1and1.ro>
Committer: Stefan Mititelu <stefan.mititelu(a)govoip.ro>
Date: 2024-03-18T10:55:24+02:00
pdb: Return negative carrierid for failures
---
Modified: src/modules/pdb/pdb.c
---
Diff:
https://github.com/kamailio/kamailio/commit/0fd1516b9519f84a0f24b3c9a2c643e…
Patch:
https://github.com/kamailio/kamailio/commit/0fd1516b9519f84a0f24b3c9a2c643e…
---
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;
}