Support A2Billing :

provided by Star2Billing S.L.

Support A2Billing :
It is currently Thu Apr 25, 2024 11:28 am
Predictive Dialer


All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject:
PostPosted: Sun Feb 24, 2008 12:21 am 
Offline

Joined: Mon Oct 01, 2007 10:44 pm
Posts: 230
Location: Bovey, Devon, UK
I've been looking into why the low balance cron job isn't working. Well that's not true, I'm using the cron job as a template to send alerts for my post paid customers when they approach their credit limit, but anyway.

In the cron job, check account, the select statment is thus:
Quote:
// CHECK AMOUNT OF CARD ON WHICH APPLY THE CHECK ACCOUNT SERVICE
$QUERY = "SELECT count(*) FROM cc_card WHERE activated='1' AND credit < $min_credit";


However, when I look at my data in the CC_CARD table, activated = 't' which I'm sure is the 'TRUE' value, but it doesn't tie in with the select statement

I'm not sure what else checks this column value so I'm wary of changing anything else.

Regards

Added after 1 hours 47 minutes:

It's worse than I thought. The check account scripts are brain dead. I'm working on them and will post rewrites shortly. Surprised no one's complained about this before. Customers get really upset if their accounts get suspended without notice


regards


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 25, 2008 4:04 am 
Offline
Moderator
User avatar

Joined: Thu Jun 22, 2006 2:19 pm
Posts: 2890
Location: Devon, UK
I think the correct way to solve this would be to store this and other similar fields as booleans, as the SQL server should evaluate 't', 'true', 'y' and 'yes' to '1'.
I think the path of least resistance for you would be:
Code:
$QUERY = "SELECT count(*) FROM cc_card WHERE (activated='1' OR activated='t') AND credit < $min_credit";
but it would obviously be better to track down where it's being set to a bad value.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 25, 2008 5:27 am 
Offline
User avatar

Joined: Mon Apr 30, 2007 6:43 am
Posts: 1060
Location: Canada
Code:
grep activated /var/lib/asterisk/agi-bin/libs_a2billing/crontjob/*


This grep shows that a2billing_bill_diduse.php is also affected. But people have been reporting that the did cronjob works well. Maybe it isn't working as well as it should or maybe they is more causes behing the a2billing_check_account.php problem.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 19, 2008 1:30 pm 
Offline

Joined: Thu Sep 13, 2007 12:46 pm
Posts: 254
Location: Naples, Fl ( USA )
stavros wrote:
I think the correct way to solve this would be to store this and other similar fields as booleans, as the SQL server should evaluate 't', 'true', 'y' and 'yes' to '1'.
I think the path of least resistance for you would be:
Code:
$QUERY = "SELECT count(*) FROM cc_card WHERE (activated='1' OR activated='t') AND credit < $min_credit";
but it would obviously be better to track down where it's being set to a bad value.


I have been trying to get low balance mailed to people. so far I have not been successful. I must be doing something wrong. I got to /tmp I do not see a log for cront_check_account.log and no mail is sent I get a system mail

From [email protected] Wed Mar 19 06:00:02 2008
Return-Path: <[email protected]>
Received: from asterisk1.local (localhost [127.0.0.1])
by asterisk1.local (8.13.1/8.13.1) with ESMTP id m2JA01fD019842
for <[email protected]>; Wed, 19 Mar 2008 06:00:02 -0400
Received: (from asterisk@localhost)
by asterisk1.local (8.13.1/8.13.1/Submit) id m2JA01n0019841;
Wed, 19 Mar 2008 06:00:01 -0400
Date: Wed, 19 Mar 2008 06:00:01 -0400
Message-Id: <[email protected]>
From: [email protected] (Cron Daemon)
To: [email protected]
Subject: Cron <asterisk@asterisk1> php /var/lib/asterisk/agi-bin/libs_a2billing/crontjob/a2billing_check_account.php
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/var/lib/asterisk>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=asterisk>
X-Cron-Env: <USER=asterisk>

Content-type: text/html
X-Powered-By: PHP/4.3.11
that is all I get from the system is there something wrong with that part

the othere ones work fine only this one has problem.

any help would be appreciated.

thanks


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 19, 2008 8:22 pm 
Offline
Moderator
User avatar

Joined: Thu Jun 22, 2006 2:19 pm
Posts: 2890
Location: Devon, UK
Try commenting out the 'exit(0)' on line 25. Beware, it seems you're the first to use this code in anger so there may be bugs lurking.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 20, 2008 6:24 pm 
Offline

Joined: Mon Oct 01, 2007 10:44 pm
Posts: 230
Location: Bovey, Devon, UK
I've completely re-writen this module for post pay and prepay customers. I haven't had a chance to figure out how to make the includes generic yet, in that you need to hard code the paths. The new code uses the updated sendmail functions that tell you if the message bouces as well.

I can post the code if you'd like

regards


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 20, 2008 8:53 pm 
Offline
Moderator
User avatar

Joined: Thu Jun 22, 2006 2:19 pm
Posts: 2890
Location: Devon, UK
Hey Nik. There's some code in another thread on this topic. I'm sure we'd all like to see what progress you've made.


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


All times are UTC


Who is online

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