Hey All,<div>I was just wanting to get some feedback from the community on how you may handle this. I have a number of clients who like to use &quot;prefixes&quot; in the dialed number coupled with IP address authentication to link calls to a specific account..</div>
<div><br class="webkit-block-placeholder"></div><div>It starts out simple.. Customer A sends me calls from 1.2.3.4.. Great. I have a table that links IP to account.. So now I can account those calls..</div><div><br class="webkit-block-placeholder">
</div><div>But now customer A, has subcustomer A.1, or A.2 They still send calls from 1.2.3.4, but they&#39;ll send prefix 001234 before the dialed number (like 00123415125551212). In this case, I want to identify the 1.2.3.4 + prefix of 001234 as being customer A.1, then strip off 001234.</div>
<div><br class="webkit-block-placeholder"></div><div>So in general, I do an avp_db_query (to be replaced by a cache_fetch) for $si + substr($rU)... Which works fine.. BUT if the prefix is not of a fixed length.. I&#39;m not even really sure hwo to go about it..</div>
<div><br class="webkit-block-placeholder"></div><div>(pardon the messy sql, it&#39;s really just to prove a point)</div><div>with the avp_db_query, I can simply do a &quot;like&quot; select ala: select account from customertrunks where ip=$si and to_did like concat($rU,&#39;%&#39;)</div>
<div><br class="webkit-block-placeholder"></div><div>But if I do a cache_fetch, I can&#39;t do the pattern  match..</div><div><br class="webkit-block-placeholder"></div><div>So how do you guys do this? or do you do it at all. :) I see a lot of clients asking for some sort of call prefixes.. usually a fixed length will make them happy, but I&#39;ve got some now that don&#39;t have a fixed length.</div>
<div><br class="webkit-block-placeholder"></div><div>Thanks,</div><div>Brett</div><div><br class="webkit-block-placeholder"></div>