<p>I have made some progress, I can reach now 65535.</p>

<p>I have no pdb client module running now, it's just the server and I am testing with pdbt:</p>

<pre><code> pdbt -r XX.XX.XX.XX:10001 query 0778667682
</code></pre>

<p>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:</p>

<p>pdbt.c:</p>

<pre><code>  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 */
</code></pre>

<p>common.h:</p>

<pre><code>  #define MAX_PDB_CARRIERID 99999
  #define MAX_CARRIERID 99999
  …
  typedef uint32_t carrier_t;
</code></pre>

<p>My server has only this two lines :</p>

<pre><code>  0778667682;65535
  0781541867;65536
</code></pre>

<p>The results of 2 querys are:</p>

<pre><code>  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
</code></pre>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href="https://github.com/kamailio/kamailio/issues/433#issuecomment-162885166">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AF36ZVc6GZBM-viGB2oJbLyGrRutNpwBks5pNtf_gaJpZM4Gw2Iw.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/kamailio/kamailio/issues/433#issuecomment-162885166"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>