What you're trying to accomplish can be easily done with an SQL query. You need to create a table of all the prefixes (international dial+country code+city/carrier) and join by that prefix.<br><br><br><br><br><div><span class="gmail_quote">
On 1/27/06, <b class="gmail_sendername">Damon Estep</b> <<a href="mailto:damon@suburbanbroadband.net">damon@suburbanbroadband.net</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Can anyone shed some light on "rules" that might make the task of<br>parsing the country code and city codes from a dialed number in the<br>CDRs?<br><br>I know that there is almost never a case where a concatenated country
<br>and city code could overlap with another country code, but what about<br>city codes and local numbers? Is it possible for a concatenated city<br>code and local number to match another city code in the same country?<br>
<br>I already have the table of country and city codes built.<br><br>Are there holes in this theory;<br><br>1. Starting after the international dialing code, find the longest match<br>for country code.<br>2. Starting after the country code from step 1, find the longest match
<br>for city code within that countries table of city codes.<br>3. The rest is the local number.<br><br>Are there known exceptions?<br><br>Am I reinventing the wheel rather than finding the right already<br>existing resource?
<br><br><br>_______________________________________________<br>--Bandwidth and Colocation provided by <a href="http://Easynews.com">Easynews.com</a> --<br><br>Asterisk-Users mailing list<br>To UNSUBSCRIBE or update options visit:
<br> <a href="http://lists.digium.com/mailman/listinfo/asterisk-users">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br></blockquote></div><br>