manugmedia wrote:
Joe,
Say when calling UK mobile 079********* What about creating a trunk that will remove prefix 0 and add 0044 then create a rate card say named local UK, Dial prefix 07 and add the rate card to the call plan. When a customer dails 079******, the trunk will strip 0 and add 0044 passing 004479*******. I remember i did this and it worked.
The only disadvantage to this solution is that it requires yet another ratesheet in the system. For example - for the UK we already have 3 rate sets: normal, 0800, 0800 + PAL.
That said, this is the way I solved it, and it seems to be working fine:
Code:
function apply_rules ($phonenumber) {
if (is_array($this->agiconfig['international_prefixes']) && (count($this->agiconfig['international_prefixes'])>0)) {
foreach ($this->agiconfig['international_prefixes'] as $testprefix) {
if (substr($phonenumber,0,strlen($testprefix))==$testprefix) {
$this->myprefix = $testprefix;
return substr($phonenumber,strlen($testprefix));
}
}
}
if ((substr($phonenumber, 0, 1) == '0') && (substr($phonenumber, 1, 1) != '0'))
return '44' . substr($phonenumber, 1);
$this->myprefix='';
return $phonenumber;
}
Please note: this assumes that all the international calls have to be prefixed with a 00, so be sure to edit your a2billing.conf accordingly.