Support A2Billing :

provided by Star2Billing S.L.

Support A2Billing :
It is currently Tue Apr 16, 2024 6:07 am
VoIP Billing solution


All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: 'prepaid-no-enough-credit' played before a call
PostPosted: Thu Jun 05, 2014 8:21 am 
Offline

Joined: Fri Apr 11, 2014 5:14 am
Posts: 13
Good morning!

I am experimenting the following issue. When the credit is low, the call goes through but still 'prepaid-no-enough-credit' is played before the call, I wonder if there is a way to prevent this from happening. See the output from asterisk below.

Thanks in advance,

carlos

Code:
a2billing.php,1: file:Class.RateEngine.php - line:97 - uniqueid:1401955076.26 - [CC_asterisk_rate-engine: (1, 0769863633)]
a2billing.php,1: file:Class.RateEngine.php - line:118 - uniqueid:1401955076.26 - [CC_asterisk_rate-engine - CALLERID : asterisk]
a2billing.php,1: file:Class.RateEngine.php - line:179 - uniqueid:1401955076.26 - [rate-engine: Count Total result 1]
a2billing.php,1: file:Class.RateEngine.php - line:344 - uniqueid:1401955076.26 - [CC_asterisk_rate-engine: Count Total result 1]
a2billing.php,1: file:Class.RateEngine.php - line:345 - uniqueid:1401955076.26 - [CC_asterisk_rate-engine: number_trunk 1]
a2billing.php,1: file:Class.A2Billing.php - line:1041 - uniqueid:1401955076.26 - OK - RESFINDRATE::> 1
a2billing.php,1: file:Class.RateEngine.php - line:358 - uniqueid:1401955076.26 - [CC_RATE_ENGINE_ALL_CALCULTIMEOUT (0.05000)]
a2billing.php,1: file:Class.RateEngine.php - line:364 - uniqueid:1401955076.26 - [CC_RATE_ENGINE_ALL_CALCULTIMEOUT: k=0 - res_calcultimeout:6]
a2billing.php,1: file:Class.A2Billing.php - line:1054 - uniqueid:1401955076.26 - RES_ALL_CALCULTIMEOUT ::> 1
a2billing.php,1: file:Class.A2Billing.php - line:1987 - uniqueid:1401955076.26 - TIMEOUT::> 6 : minutes=0 - seconds=6
    -- Playing 'prepaid-no-enough-credit' (escape_digits=#) (sample_offset 0)
a2billing.php,1: file:a2billing.php - line:562 - uniqueid:1401955076.26 - ANSWER fct callingcard_ivr authorize:> 1
a2billing.php,1: file:Class.RateEngine.php - line:1312 - uniqueid:1401955076.26 - app_callingcard: Dialing 'SIP/bitco_out/0769863633|60|HRrL(6000:61000:30000)' with timeout of '6'.
a2billing.php,1:
a2billing.php,1: file:Class.RateEngine.php - line:1332 - uniqueid:1401955076.26 - app_callingcard: CIDGROUPID='-1' OUTBOUND CID SELECTED IS '0'.
a2billing.php,1: file:Class.RateEngine.php - line:1228 - uniqueid:1401955076.26 - [TRUNK STATUS UPDATE : UPDATE cc_trunk SET inuse = inuse + 1 WHERE id_trunk = '2']
    -- AGI Script Executing Application: (DIAL) Options: (SIP/bitco_out/0769863633,60,HRrL(6000:61000:30000))
       > Limit Data for this call:
       > timelimit      = 6000 ms (6.000 s)
       > play_warning   = 1000 ms (1.000 s)
       > play_to_caller = yes
       > play_to_callee = no
       > warning_freq   = 30000 ms (30.000 s)
       > start_sound    =
       > warning_sound  = timeleft
       > end_sound      =
  == Using SIP RTP CoS mark 5
    -- Called SIP/bitco_out/0769863633
    -- SIP/bitco_out-0000001b is making progress passing it to SIP/6613813819-0000001a
    -- SIP/bitco_out-0000001b is ringing


Top
 Profile  
 
 Post subject: Re: 'prepaid-no-enough-credit' played before a call
PostPosted: Mon Jun 09, 2014 8:48 am 
Offline

Joined: Fri Jun 23, 2006 3:56 pm
Posts: 4065
Hi

Adjust the AGI-conf to suit your requirements. If this is a VoIP rather than a calling card, you should not be answering the call, or playing audio.

Joe


Top
 Profile  
 
 Post subject: Re: 'prepaid-no-enough-credit' played before a call
PostPosted: Fri Oct 31, 2014 9:07 am 
Offline

Joined: Tue Feb 04, 2014 7:48 pm
Posts: 6
Hi,

My problem is the opposite. I would like 'prepaid-no-enough-credit' to be played to the caller if there is not enough credit in the account. Currently, the call will just fail but the caller will be unaware that the issue is their credit balance.

My logs show that the caller should be hearing this notification but nothing is heard:

-- Launched AGI Script /var/lib/asterisk/agi-bin/a2billing.php
-- Playing 'prepaid-no-enough-credit' (escape_digits=#) (sample_offset 0)

P.S. This is a Voip call.


TK


Top
 Profile  
 
 Post subject: Re: 'prepaid-no-enough-credit' played before a call
PostPosted: Fri Oct 31, 2014 9:35 am 
Offline

Joined: Fri Jun 23, 2006 3:56 pm
Posts: 4065
Hi

There is no function to do this in A2Billing as it stands, and the disadvantage of this to your end customer is that if the call is answered to play, "not enough credit", then the customer's equipment will not go on to try another one of their failover carriers.

If you need this functionality, then you would need to write some dialplan to look up the customer's balance first before calling a2billing.php, then if not enough balance to call, then answer the call and play a message, or put them through to you.

If you need assistance with this, Star2billing offer consultancy services, and we can write this dialplan for you.

Joe


Top
 Profile  
 
 Post subject: Re: 'prepaid-no-enough-credit' played before a call
PostPosted: Sun Nov 02, 2014 12:03 am 
Offline

Joined: Mon Mar 28, 2011 10:49 pm
Posts: 23
Hello,

I'm creating a piece of dialplan for this. First you have to create a connection to A2Billing database with ODBC (normally done if you use Asterisk Realtime). You have to configure odbcinst.ini and odbc.ini. On my CentOS 6.5 64 bit look like:

odbcinst.ini

[MySQL]
Description = ODBC for MySQL
Driver = /usr/lib64/libmyodbc5.so
Setup = /usr/lib64/libodbcmyS.so
FileUsage = 1

odbc.ini

[a2billing]
Description = MySQL a2billing-voztovoice
Driver = MySQL
Database = a2billing
Server = 192.168.147.186
User = a2user
Password = password
Port = 3306
Option = 3

then configure res_odbc.conf and func_odbc.conf on Asterisk:

res_odbc.conf

[a2b]
enabled => yes
dsn => a2billing
;username => haroot
username => a2user
password => password
pre-connect => yes
sanitysql => select 1
idlecheck => 3600
connect_timeout => 300

func_odbc.conf

[credito]
dsn=a2b
readsql=select credit from cc_card where username='${SQL_ESC(${ARG1})}'

with this query you can extract customer credit from database.

The last operation is change the diallplan. On the context where you receive customers calls:

exten => _X.,1,NoOP(CALLERID ${CALLERID(num)})
same => n,Set(credito=${ODBC_credito(${CDR(accountcode)})})
same => n,Set(dolares=${CUT(credito,.,1)})
same => n,Set(centavos=${CUT(credito,.,2)})
same => n,NoOp(Credito ${dolares} ${centavos:0:1})
same => n,GotoIf($[${dolares} < 1 & ${centavos:0:1} < 5]?nocredito,s,1)

If the customer credit is less than 0.5 dollars go to context nocredito, extension s, priority 1, where:

[nocredito]
exten => s,1,NoOp(NoCredito)
same => n,Progress
same => n,Playback(youraudioprompt,noanswer)
same => n,Hangup(603)

Regards


Top
 Profile  
 
 Post subject: Re: 'prepaid-no-enough-credit' played before a call
PostPosted: Tue Jan 13, 2015 8:04 am 
Offline

Joined: Tue Jan 13, 2015 7:50 am
Posts: 1
if not enough balance to call, then answer the call and play a message, or put them through to you.


Top
 Profile  
 
 Post subject: Re: 'prepaid-no-enough-credit' played before a call
PostPosted: Mon Apr 13, 2015 11:52 am 
Offline

Joined: Mon Apr 13, 2015 11:50 am
Posts: 2
then if not enough balance to call, then answer the call and play a message, or put them through to you.
__________________
solitaire card game free


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 14 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:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group