I have made some progress, I can reach now 65535.
I have no pdb client module running now, it's just the server and I am testing with
pdbt:
pdbt -r XX.XX.XX.XX:10001 query 0778667682
Now I have changed the int16_t to uint32_t and the short int to uint32_t also but I get
the same result eventhough is unsigned:
pdbt.c:
bufsize = slen + 1 + 1 + 5 + 1 + 1; // line buffer (telephone number + colon + white
space + carrier ID + newline + \0)
ret = snprintf(p, 7, "%d\n", node->carrier);
if (ret < 1 || ret > 6) {
…
uint32_t carrierid;
…
carrierid=ntohs(*((uint32_t *)&(buf[reqlen]))); /* convert to host byte order */
common.h:
#define MAX_PDB_CARRIERID 99999
#define MAX_CARRIERID 99999
…
typedef uint32_t carrier_t;
My server has only this two lines :
0778667682;65535
0781541867;65536
The results of 2 querys are:
processing command line parameters...
got an answer in 0.180000 ms
0778667682: 65535: comment=''
processing command line parameters...
got an answer in 0.155000 ms
0781541867:not_found:unknown carrier
---
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/433#issuecomment-162885166