[Asterisk-Dev] Algorithm to parse country code

Florian Overkamp florian at obsimref.com
Wed May 12 06:05:03 MST 2004


Hi, 

> -----Original Message-----
> Thanks for the help with the country code parsing algorithm - 
> I decided 
> in the end to do as little as possible in my own code and just let 
> MySQL do all the dirty work. I was hoping all along actually 
> that there 
> would be a way to do it with MySQL - but I notice the man pages 
> regarding SELECT statements on mysql.com aren't very detailed 
> - doesn't 
> document many of the things suggested to me by this group.
> 
> Anyhow, my script works the way I want it to now (in this respect 
> anyway), though there is a bit more fine tuning required in other 
> respects. I notice there are no decent usable prepaid 
> callingcard apps 
> available on the wiki at the moment, so once mine works nicely i'll 
> release it and see what comments everyone has.

Here is an approach that has been discussed on the list a long long time
ago:

select *, length(destination) from rates_pointers where destination =
left(\"$reqexten\", length(destination)) order by length(destination) desc
limit 1

But the nastier issue is how to differentiate on time (peak-hours or
off-hours). I have a ridiculously complex approach for this, and would love
other people's ideas on how to do it.


Florian




More information about the asterisk-dev mailing list