Module: kamailio
Branch: 5.6
Commit: 16f053f5eb3a36992225c1a72db3575165bb68a8
URL:
https://github.com/kamailio/kamailio/commit/16f053f5eb3a36992225c1a72db3575…
Author: Stefan-Cristian Mititelu <stefan-cristian.mititelu(a)1and1.ro>
Committer: Stefan-Cristian Mititelu <stefan-cristian.mititelu(a)1and1.ro>
Date: 2024-03-18T13:21:18+02:00
pdb server: Return negative carrierid for failures. Clang format
(cherry picked from commit 88b698e0f62c39ed60af9f0a4fb3ca2dc6867d8f)
---
Modified: utils/pdbt/pdb_server.c
Modified: utils/pdbt/pdb_server_backend.c
---
Diff:
https://github.com/kamailio/kamailio/commit/16f053f5eb3a36992225c1a72db3575…
Patch:
https://github.com/kamailio/kamailio/commit/16f053f5eb3a36992225c1a72db3575…
---
diff --git a/utils/pdbt/pdb_server.c b/utils/pdbt/pdb_server.c
index 6ce32557cc7..2de2ba789d7 100644
--- a/utils/pdbt/pdb_server.c
+++ b/utils/pdbt/pdb_server.c
@@ -151,7 +151,7 @@ int udp_server(int so)
carrierid = lookup_number(msg.bdy.payload);
/* check if not found pdb_id */
- if(carrierid == 0) {
+ if(carrierid == -1) {
pdb_msg_format_send(&msg, PDB_VERSION_1, PDB_TYPE_REPLY_ID,
PDB_CODE_NOT_FOUND, htons(msg.hdr.id), NULL, 0);
goto msg_send;
diff --git a/utils/pdbt/pdb_server_backend.c b/utils/pdbt/pdb_server_backend.c
index dc4028bee19..931e28d7603 100644
--- a/utils/pdbt/pdb_server_backend.c
+++ b/utils/pdbt/pdb_server_backend.c
@@ -44,8 +44,8 @@ carrier_t lookup_number(char *number)
carrier_t carrierid;
int nmatch = dtm_longest_match(mroot, number, strlen(number), &carrierid);
if(nmatch <= 0) {
- /* nothing found - return id 0 */
- carrierid = 0;
+ /* nothing found - return id -1 */
+ carrierid = -1;
}
LINFO("request='%s', nmatch=%ld, carrier=%ld\n", number, (long
int)nmatch,
(long int)carrierid);