Support A2Billing :

provided by Star2Billing S.L.

Support A2Billing :
It is currently Sun Apr 28, 2024 3:33 am
VoIP Billing solution


All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Call still dialed even not enough credit
PostPosted: Sun Jun 12, 2011 9:39 am 
Offline

Joined: Sat Sep 16, 2006 1:17 pm
Posts: 14
Looks to me a bug or I am doing something wrong. I have setup a rate for a route high enough from the user's balance. The call is still being dialed after announcing prepaid-no-enough-credit.
Code:
./a2billing.php -v
A2Billing - Version 1.9.4 (Cuprum)

Code:
[Jun 12 09:31:14]     -- <SIP/3418800878-0000008c> Playing 'prepaid-enter-dest.gsm' (language 'en')
[Jun 12 09:31:17]  a2bill.php,1: file:Class.A2Billing.php - line:791 - uniqueid:1307871074.140 - RES DTMF : 92300
[Jun 12 09:31:17]  a2bill.php,1: file:Class.A2Billing.php - line:828 - uniqueid:1307871074.140 - [CALL 2 DID]
[Jun 12 09:31:17]  a2bill.php,1: file:Class.A2Billing.php - line:837 - uniqueid:1307871074.140 - SELECT cc_did.id, iduser FROM cc_did, cc_card  WHERE cc_card.status=1 and cc_card.id=iduser  and cc_did.activated=1 and did='92300'  AND cc_did.startingdate<= CURRENT_TIMESTAMP AND (cc_did.expirationdate > CURRENT_TIMESTAMP OR cc_did.expirationdate IS NULL OR cc_did.expirationdate = '0000-00-00 00:00:00')
[Jun 12 09:31:17]  a2bill.php,1: file:Class.A2Billing.php - line:843 - uniqueid:1307871074.140 - DESTINATION ::> 92300
[Jun 12 09:31:17]  a2bill.php,1: file:Class.A2Billing.php - line:850 - uniqueid:1307871074.140 - RULES APPLY ON DESTINATION ::> 92300
[Jun 12 09:31:17]  a2bill.php,1: file:Class.A2Billing.php - line:3408 - uniqueid:1307871074.140 - [SAVING DESTINATION FOR REDIAL: SQL: UPDATE cc_card SET redial = '92300' WHERE username='2425050481']:[result: 1]
[Jun 12 09:31:17]  a2bill.php,1: file:Class.RateEngine.php - line:98 - uniqueid:1307871074.140 - [CC_asterisk_rate-engine: (1, 92300)]
[Jun 12 09:31:17]  a2bill.php,1: file:Class.RateEngine.php - line:120 - uniqueid:1307871074.140 - [CC_asterisk_rate-engine - CALLERID : 3418800878]
[Jun 12 09:31:17]  a2bill.php,1: file:Class.RateEngine.php - line:182 - uniqueid:1307871074.140 - [rate-engine: Count Total result 1]
[Jun 12 09:31:17]  a2bill.php,1: file:Class.RateEngine.php - line:270 - uniqueid:1307871074.140 - [CC_asterisk_rate-engine: Count Total result 1]
[Jun 12 09:31:17]  a2bill.php,1: file:Class.RateEngine.php - line:271 - uniqueid:1307871074.140 - [CC_asterisk_rate-engine: number_trunk 1]
[Jun 12 09:31:17]  a2bill.php,1: file:Class.A2Billing.php - line:876 - uniqueid:1307871074.140 - OK - RESFINDRATE::> 1
[Jun 12 09:31:17]  a2bill.php,1: file:Class.RateEngine.php - line:285 - uniqueid:1307871074.140 - [CC_RATE_ENGINE_ALL_CALCULTIMEOUT (0.10000)]
[Jun 12 09:31:17]  a2bill.php,1: file:Class.RateEngine.php - line:291 - uniqueid:1307871074.140 - [CC_RATE_ENGINE_ALL_CALCULTIMEOUT: k=0 - res_calcultimeout:2]
[Jun 12 09:31:17]  a2bill.php,1: file:Class.A2Billing.php - line:887 - uniqueid:1307871074.140 - RES_ALL_CALCULTIMEOUT ::> 1
[Jun 12 09:31:17]  a2bill.php,1: file:Class.A2Billing.php - line:1709 - uniqueid:1307871074.140 - TIMEOUT::> 2 : minutes=0 - seconds=2
[Jun 12 09:31:17]     -- Playing 'prepaid-no-enough-credit' (escape_digits=#) (sample_offset 0)
[Jun 12 09:31:21]  a2bill.php,1: file:a2billing.php - line:540 - uniqueid:1307871074.140 - ANSWER fct callingcard_ivr authorize:> 1
[Jun 12 09:31:21]  a2bill.php,1: file:Class.RateEngine.php - line:1245 - uniqueid:1307871074.140 - app_callingcard: Dialing 'SIP/188.138.113.115/92300,60,RL(2000:61000:30000)' with timeout of '2'.
[Jun 12 09:31:21]  a2bill.php,1:
[Jun 12 09:31:21]  a2bill.php,1: file:Class.RateEngine.php - line:1265 - uniqueid:1307871074.140 - app_callingcard: CIDGROUPID='-1' OUTBOUND CID SELECTED IS '0'.
[Jun 12 09:31:21]  a2bill.php,1: file:Class.RateEngine.php - line:1157 - uniqueid:1307871074.140 - [TRUNK STATUS UPDATE : UPDATE cc_trunk SET inuse=inuse+1 WHERE id_trunk='2']
[Jun 12 09:31:21]     -- AGI Script Executing Application: (DIAL) Options: (SIP/xxx.xxx.xxx.xxx/92300,60,RL(2000:61000:30000))


Is this true or I am missing something?


Top
 Profile  
 
 Post subject: Re: Call still dialed even not enough credit
PostPosted: Sun Jun 12, 2011 10:00 am 
Offline

Joined: Sat Sep 16, 2006 1:17 pm
Posts: 14
Any idea even on not enough credit, why it is returning
Code:
file:Class.A2Billing.php - line:1709 - uniqueid:1307870862.136 - TIMEOUT::> 2 : minutes=0 - seconds=2


Top
 Profile  
 
 Post subject: Re: Call still dialed even not enough credit
PostPosted: Sun Jun 12, 2011 10:22 am 
Offline

Joined: Sat Sep 16, 2006 1:17 pm
Posts: 14
A quick hack seems to be working fine:

Code:
                $this -> fct_say_time_2_call($agi,$timeout,$RateEngine->ratecard_obj[0][12]);
                if ($fct_say_time_2_call){
                        return -1;
                }


Not sure why, but when fct_say_time_2_call is returning -1 on not-enough-credit, it is not being validated properly. So simply adding an if condition works. Can someone validate it please?


Top
 Profile  
 
 Post subject: Re: Call still dialed even not enough credit
PostPosted: Tue Jun 14, 2011 11:55 pm 
Offline

Joined: Mon Jan 08, 2007 6:56 pm
Posts: 345
What is the rate for route and what is customer balance. It is giving a call time of 2 secs as you can see.


Top
 Profile  
 
 Post subject: Re: Call still dialed even not enough credit
PostPosted: Wed Jun 15, 2011 7:59 am 
Offline

Joined: Sat Sep 16, 2006 1:17 pm
Posts: 14
vulcan wrote:
What is the rate for route and what is customer balance. It is giving a call time of 2 secs as you can see.

Just for the sake or argument, even if it is giving 2 secs. It is not supposed to make the call. See the code:

Code:
if the following function definition in Class.A2Billing.php:
function fct_say_time_2_call()


Code:
        if (!($minutes>0) && !($seconds>10)) {
            $prompt="prepaid-no-enough-credit";
            $agi-> stream_file($prompt, '#');
            return -1;
        }

So even if the return seconds are less than 10, it will always return -1 with not enough credit. The quick hack above fixed the issue, but really needs to be verified by some expert programmer.


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


All times are UTC


Who is online

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