Support A2Billing :

provided by Star2Billing S.L.

Support A2Billing :
It is currently Wed Dec 12, 2018 2:27 pm
Auto Dialer Software


All times are UTC




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: Why Card go in negative balance
PostPosted: Sat Mar 03, 2007 9:58 am 
Offline

Joined: Tue Aug 08, 2006 4:00 pm
Posts: 117
Location: Bitola,Macedonia
Hi

I notice theat a large number of my Calling Cards go in negative balance did someone have some patch for this ?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 03, 2007 6:24 pm 
Offline
Moderator
User avatar

Joined: Tue Jun 06, 2006 12:14 pm
Posts: 685
Location: florida
That's been answered on here somewhere, you'll have to do a search for it.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 04, 2007 6:31 am 
Offline

Joined: Mon May 29, 2006 7:07 pm
Posts: 287
Location: Denver
this is the topic
http://forum.asterisk2billing.org/viewtopic.php?t=178

looks like what works is to change line in a2billing.conf to
dialcommand_param="|30|HL(%timeout%:61000:00000)"

i will try it too to see if that helps to fix this problem.


Top
 Profile  
 
 Post subject: solution of negative balance
PostPosted: Sun May 06, 2007 6:12 am 
Offline
User avatar

Joined: Sun Apr 29, 2007 4:08 am
Posts: 14
Folder :agi-bin/libs_a2billing
File :Class.RateEngine.php

On function rate_engine_updatesystem ...
after the lines ( if ($A2B->agiconfig['debug']>=1) $agi->verbose('line:'.__LINE__.' - '.$QUERY);
$A2B -> write_log("[CC_asterisk_stop 1.2: SQL: $QUERY]");
$result = $A2B->instance_table -> SQLExec ($A2B -> DBHandle, $QUERY, 0); )

add these lines :
=============================================
$QUERY = "select credit from cc_card WHERE username='".$A2B->username."'";

$result = $A2B -> instance_table -> SQLExec ($A2B->DBHandle, $QUERY);
$agi->verbose('Result..................'.$result[0][0]);

//check negetive

if( $result[0][0] < 0 )
{
$agi->verbose('in negetive balance');
$QUERY = "update cc_card set credit=0 WHERE username='".$A2B->username."'";

$result = $A2B -> instance_table -> SQLExec ($A2B->DBHandle, $QUERY);


}

===============================================
and finish these upto
these lines ( $QUERY = "UPDATE cc_trunk SET secondusedreal = secondusedreal + $sessiontime WHERE id_trunk='$id_trunk'";
if ($A2B->agiconfig['debug']>=1) $agi->verbose('line:'.__LINE__.' - '.$QUERY);
$result = $A2B->instance_table -> SQLExec ($A2B -> DBHandle, $QUERY, 0); )

------------------------------------------------------------------------------

I think this changes on mensioned AGI file will work.

Thanks


Top
 Profile  
 
 Post subject: Re: solution of negative balance
PostPosted: Sun May 06, 2007 7:47 am 
Offline

Joined: Thu Oct 19, 2006 9:56 am
Posts: 300
Location: Athens, Greece
Mutaherul wrote:
$QUERY = "update cc_card set credit=0 WHERE username='".$A2B->username."'";


Are you suggesting that we should explicitly reset the credit to 0, when it has gone negative?
No, my friend, I disagree. I would rather search the reason the credit was negative in the first place. For example, as suggested, if the timeout doesn't work, the call may last longer than allowed.


Top
 Profile  
 
 Post subject: Only change on time out value can't solve Negative value pro
PostPosted: Sun May 06, 2007 9:33 am 
Offline
User avatar

Joined: Sun Apr 29, 2007 4:08 am
Posts: 14
on a2billing.cong

dialcommand_param="|30|HL(%timeout%:61000:5000)"

i made this to 5 second .....though some case it make negative balance .so
beside making the time out value less ,my proposed change on AGI is needed.Otherwise it still insert negative value sometime.

so
step 1:
dialcommand_param="|30|HL(%timeout%:61000:5000)"
step 2: AGI change .

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 07, 2007 3:27 pm 
Offline
Moderator
User avatar

Joined: Tue Jun 06, 2006 12:14 pm
Posts: 685
Location: florida
Svetur gave the correct link that I have used to solve the issue. In the dialcommand parameter the last parameter make it 0 should solve your issue.


Top
 Profile  
 
 Post subject: No call termination when credit limit reached
PostPosted: Fri Jul 06, 2007 5:48 am 
Offline
User avatar

Joined: Sat Jun 02, 2007 5:59 am
Posts: 63
Location: Orlando, Fl
I have read the forum but I can not find a solution to my problem. Calls being made to a specific destination are running way past the credit limit, to the tune of $4 to $6 US. Please help!

This is my dial command...
dialcommand_param="|90|HRrL(1800000:61000:30000)"


Top
 Profile  
 
 Post subject: Re: Why Card go in negative balance
PostPosted: Sun Sep 30, 2012 12:18 am 
Offline

Joined: Sun Sep 30, 2012 12:08 am
Posts: 4
Hi all,

I'm new on using a2billing and I remark that there is a problem or a bug in negative balance when there are many calls at the same time so we are searching for a solution never gone to negative.I ve understood that we have to change or to add some lines on Class.RateEngine.php.
Is there any help please?


Top
 Profile  
 
 Post subject: Re: Why Card go in negative balance
PostPosted: Thu Feb 21, 2013 7:41 am 
Offline

Joined: Thu Feb 21, 2013 6:59 am
Posts: 1
Location: Beighton,South Yorkshire, England, United Kingdom
As per my experience, I think you would have to add some lines on class.RateEngine.php , But I am not sure abut this.

business internet services


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 
Auto Dialer Software


All times are UTC


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group