changes:
in a2billing.php find
Code:
//if ($A2B->agiconfig['ivr_voucher']==1){
// $res_dtmf = $agi->get_data('prepaid-refill_card_with_voucher', 5000, 1);
// $A2B -> debug( VERBOSE | WRITELOG, $agi, __FILE__, __LINE__, "RES REFILL CARD VOUCHER DTMF : ".$res_dtmf ["result"]);
// $A2B-> ivr_voucher = $res_dtmf ["result"];
// if ((isset($A2B-> ivr_voucher)) && ($A2B-> ivr_voucher == $A2B->agiconfig['ivr_voucher_prefixe']))
// {
// $vou_res = $A2B->refill_card_with_voucher($agi, $i);
// //if ($vou_res==1)$A2B->fct_say_balance ($agi, $A2B->add_credit, 1);
// }
//}
and replace to
Code:
if ($A2B->agiconfig['ivr_voucher']==1 && ($A2B-> credit < $A2B->agiconfig['ivr_voucher_min_credit'])){
$res_dtmf = $agi->get_data('prepaid-refill_card_with_voucher', $A2B->agiconfig['ivr_voucher_waiting_time'], 1);
$A2B -> debug( VERBOSE | WRITELOG, $agi, __FILE__, __LINE__, "RES REFILL CARD VOUCHER DTMF : ".$res_dtmf ["result"]);
$A2B-> ivr_voucher = $res_dtmf ["result"];
if ((isset($A2B-> ivr_voucher)) && ($A2B-> ivr_voucher == $A2B->agiconfig['ivr_voucher_prefixe']))
{
$vou_res = $A2B->refill_card_with_voucher($agi, $i);
//if ($vou_res==1)$A2B->fct_say_balance ($agi, $A2B->add_credit, 1);
}
}
in Class.A2billing.php find
Code:
//$QUERY = "SELECT cc_card.credit FROM cc_card WHERE username = '".$this->cardnumber."'";
//$this->cardnumber, $this->credit
//
// if ($this->agiconfig['say_balance_after_auth']==1 ){
// $this -> debug( VERBOSE | WRITELOG, $agi, __FILE__, __LINE__, "[A2Billing] SAY BALANCE : $this->credit \n");
// $this -> fct_say_balance ($agi, $this->credit);
//}
//
and replace to
Code:
$say_min_balance = 1;
if ($this->agiconfig['say_balance_after_auth']==1 ){
$this -> debug( VERBOSE | WRITELOG, $agi, __FILE__, __LINE__, "[A2Billing] SAY BALANCE : $this->credit \n");
$this -> fct_say_balance ($agi, $this->credit);
$say_min_balance = 0;
}
if ($this->credit <= $this->agiconfig['ivr_voucher_min_credit'] && $say_min_balance){
$this -> debug( VERBOSE | WRITELOG, $agi, __FILE__, __LINE__, "[A2Billing] SAY BALANCE : $this->credit \n");
$this -> fct_say_balance ($agi, $this->credit);
}
in agi-conf you must to add 2 parameters :
ivr_voucher_waiting_time=3000 ; ms for waiting to refill
ivr_voucher_min_credit=0.50 ; min balance to here ivr voucher refill menu
if more of 50 cents simple call , if less system says : if you want to refill .... after waiting 3000 ms and going to enter destination where you wish to call .
thanks to Snake !!!
banzajus thanks for this but i have search in Class.A2billing.php and i can not find theat code which you say to replace ? what version of A2Billing did you use ?