I would like to charge immediately when user enter PIN number,
before he enter destination number.
Please see my operating flow
My flow:
1. User call to access no. (1800-xxx-xxxx for outside area, 123-xxx-xxxx for local area)
2. System play sound file language menu and user choose language
3. System play sound file for asking pin no. and user enter PIN (Card number in Asterisk2Billing web interface)
4. System will charge 10 cent for outside area and tell credit balance which is charged already
now, I use Asterisk2Billing version 1.2.3 (BrainCoral)
I saw in source code yesterday and I think this feature is unavailable.
so, I add this feature by myself.
I change method
callingcard_ivr_authenticate, class
A2Billing in
Class.A2Billing.php,
add key
surcharge_no and
surcharge_fee in
a2billing.conf
but I have another problem, Could you tell me how I can know the access number which user make a call?
Code:
...
if (($retries < 3) && $res==0) {
//ast_cdr_setaccount(chan, username);
/***** Start: Check toll fee no. number *****/
if (is_array($this->agiconfig['surcharge_no'])) {
foreach ($this->agiconfig['surcharge_no'] as $i => $surcharge_no) {
$agi->verbose('line:'.__LINE__.' - '."Surcharge number ".$surcharge_no." fee ".$this->agiconfig['surcharge_fee'][$i]);
// if access number have fee:
// $this->credit -= $surcharge_fee;
}
//Update credit
$QUERY = "UPDATE cc_card SET credit=".$this->credit." WHERE username='".$this->username."'";
$result = $this->instance_table -> SQLExec ($this->DBHandle, $QUERY, 0);
}
/***** End: Check toll fee no. number *****/
if ($this->agiconfig['say_balance_after_auth']==1){
if ($this->agiconfig['debug']>=1) $agi->verbose('line:'.__LINE__.' - '."[A2Billing] SAY BALANCE (".$this->agiconfig['say_balance_after_auth'].")\n");
$this -> fct_say_balance ($agi, $this->credit);
}
}
...
now, it work fine if I surcharge for every access no. but I want only outside no. will be charged.
Thank you for replying