You must provision in the destinations table with all prefixes for PSTN destinations (at least all country codes). The software will find the longest match from that table.
>>>>>>
Trying cdrtool prepaid rating, got stuck with something.
always return "0", no matter what amount of balance is available in
prepaid table. This is what I see in syslog:
"CDRTool rating[5759]: Error: cannot figure out the destination id
Cdrtool version is 6.3.2. Apparently rating engine needs the variable
$CDR->DestinationID set (rating_lib.phtml, line #5926), but this is
not happening. It isn't clear to me how this is initialised (In weak
defense, I'm totally clueless about php), and it doesn't work even if
DestinationID parameter is added in the above stated request.