Support A2Billing :

provided by Star2Billing S.L.

Support A2Billing :
It is currently Tue Oct 22, 2019 5:03 pm
VoIP Billing solution


All times are UTC




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: Bug fixes + improvements A2B 1.9.4
PostPosted: Sun Nov 13, 2011 1:06 am 
Offline

Joined: Mon Jan 08, 2007 6:56 pm
Posts: 345
If POSTPAID peer calls a local non-free DID user and the credit is already in negative, the timeout value is not calculated correctly and therefore sends an incorrect timeout value in the dial string.

For example if the postpaid balance is -10.00 and the credit limit is 7 the credit is calculated to be -3.00
This user is not supposed to make calls. This is the current code to check this condition. As you can see it will pass because -3 is not less than -7 (note the minus sign before $this-credit limit)

Code:
if ($this->credit <= -$this->creditlimit) {


This code fixes the problem by resolving to true to enter the if block in the case of no credit.
Code:
if ($this->credit <= 0) {


This same peer is always able to call the local DID user once the credit is negative and there is a credit limit configured.

After fixing this problem and giving the user some credit, you find that the peer cannot make any calls because it has a parallel bug later in the code.

There are some other fixes in the included attached file for sign up form to preserve the values entered when they get the captcha wrong.

How to install this code:

1. Extract a fresh copy of version 1.9.4 to a folder.
2. Download this patch below and put it in the same folder
3. Change to the folder , eg; cd Star2Billing
4. Execute the patch command: patch -p1 < star194.txt


You can then use this patched copy of 1.9.4. If you move or copy this folder you must be aware of the symbolic links to the lib directory.


Attachments:
File comment: Install this patch second
star194b.txt [1.14 KiB]
Downloaded 468 times
File comment: Install this patch first
star194.txt [6.97 KiB]
Downloaded 472 times


Last edited by vulcan on Tue Jan 24, 2012 6:43 am, edited 6 times in total.
Top
 Profile  
 
 Post subject: Re: Bug fixes + improvements A2B 1.9.4
PostPosted: Fri Jan 13, 2012 7:38 am 
Offline

Joined: Sun Nov 07, 2010 10:00 pm
Posts: 253
Hi Vulcan,

This thread as 9308 is after the thread http://forum.asterisk2billing.org/viewtopic.php?f=35&t=9302 where you have patched a2billing to control the balance.
I don't see this script including that patch, so, after patching hear, have to follow the other as another update, right?

Just wanted to be sure, as I don't see the reference to that issue in this patch!

Regards,


Top
 Profile  
 
 Post subject: Re: Bug fixes + improvements A2B 1.9.4
PostPosted: Fri Jan 13, 2012 9:51 am 
Offline

Joined: Mon Jan 08, 2007 6:56 pm
Posts: 345
This thread 9308 patch fixes all the bugs I've found so far in a2b. That is all you need. It must be installed to a fresh copy of A2B 1.9.4 before any other changes to the code. I understand you have already patched a fresh copy of A2B. Use that patched copy. This patch, in addition to fixing the bugs, does a few minor enhancements.

9302 viewtopic.php?f=35&t=9302 is not necessary. It just acts as a cop to make sure the credit limit is not exceeded by running as a cron job and constantly checking on asterisk. I did not create a patch for this change. It has to be done manually based on the instructions.


Top
 Profile  
 
 Post subject: Re: Bug fixes + improvements A2B 1.9.4
PostPosted: Tue Jan 24, 2012 7:09 am 
Offline

Joined: Mon Jan 08, 2007 6:56 pm
Posts: 345
UPDATE!!
Uploaded a second patch that fixes the first patch. Patches are to be installed in the sequence given.


Reason:
The first patch did not fix the problem with postpaid credit verification entirely. The solution was to simply compare the credit. eg;
Code:
if ( $this->credit <= 0) {


Top
 Profile  
 
 Post subject: Re: Bug fixes + improvements A2B 1.9.4
PostPosted: Mon Jan 30, 2012 2:25 pm 
Offline

Joined: Sun Nov 07, 2010 10:00 pm
Posts: 253
Hi Vulcan,
After this patch, I'm just looking into our system, and I just found some accounts with negative balance 50 or 60 cents making some calls in the last few days, where last call was within 2 or 3 cents per minutes, I mean, the call wasn't interrupted, even within 20 mints after going into negative balance...
I'm just checking the cron, it's working and running each 30 seconds, no errors, but calls wasn't interrupted, strangely...

Regards,


Last edited by ubunter on Tue Jan 31, 2012 11:45 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Bug fixes + improvements A2B 1.9.4
PostPosted: Mon Jan 30, 2012 3:50 pm 
Offline

Joined: Mon Jan 08, 2007 6:56 pm
Posts: 345
you mentioned four subjects. Consider the first three.


Patch - which one(s)?
credit overun - when , what date?
Cron - which name and version?


Top
 Profile  
 
 Post subject: Re: Bug fixes + improvements A2B 1.9.4
PostPosted: Tue Jan 31, 2012 1:06 am 
Offline

Joined: Sun Nov 07, 2010 10:00 pm
Posts: 253
Sorry, I mean, the previous patch, referring in this thread, patching Class.A2Billing.php...:)


Top
 Profile  
 
 Post subject: Re: Bug fixes + improvements A2B 1.9.4
PostPosted: Tue Jan 31, 2012 3:50 am 
Offline

Joined: Mon Jan 08, 2007 6:56 pm
Posts: 345
Can you be more specific? there are two pacthes posted. Can you also answer the other two questions? You had a bad dial string up until recently. Your bad dial string did not produce a timeout value.


Top
 Profile  
 
 Post subject: Re: Bug fixes + improvements A2B 1.9.4
PostPosted: Tue Jan 31, 2012 11:44 am 
Offline

Joined: Sun Nov 07, 2010 10:00 pm
Posts: 253
vulcan wrote:
Can you be more specific? there are two pacthes posted. Can you also answer the other two questions? You had a bad dial string up until recently. Your bad dial string did not produce a timeout value.



Hello again Vulcan,
I'm referring to the first patch, into the prepaid service, i haven't implemented your last proposition for the postpaid as we don't use it...

Regarding to the dialcommand, I turn to this:
Quote:
|60|IWXoL(%timeout%:60000:30000)


As you recommend, and the negative balance, was reproduced after this modification...

Even, i'm thinking, and looking around to modify this dialcommand, as the agi script is failing in handle the DIALSTATUS application, and not sending on time the missed calls to the voice mail... but this is other issue far away from billing which we're discussing in this thread...

Regards,


Top
 Profile  
 
 Post subject: Re: Bug fixes + improvements A2B 1.9.4
PostPosted: Tue Jan 31, 2012 7:37 pm 
Offline

Joined: Mon Jan 08, 2007 6:56 pm
Posts: 345
Both patches relate to postpaid credit verification. Prepaid is unchanged.

When you make a claim, you should provide call logs as proof or a way to reproduce it. Show the dial string sent to asterisk with the timeout value, call log and credit remaining.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 
Voice Broadcast System


All times are UTC


Who is online

Users browsing this forum: No registered users and 2 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