Support A2Billing :

provided by Star2Billing S.L.

Support A2Billing :
It is currently Tue Apr 16, 2024 8:18 pm
Hosted Voice Broadcast


All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Problem with extracharge
PostPosted: Tue Sep 02, 2008 3:04 am 
Offline

Joined: Sun May 11, 2008 7:28 pm
Posts: 23
Hi, I have a problem with the extracharge that I need to add for the use of a Toll Free number when working with the a2billing traditional prepaid phonecard application. I am using PBX in a Flash, my Toll Free number is from PhonePeople.com, my local DID number and non-hosted SIP Trunking from Aretta, and my Termination from VoIPJet.

When there is an incoming call made with the Toll Free Number, a2billing does not add the extracharge I set in a2billing.conf for the Toll Free Number. On the other hand, when I test by adding an extracharge for the local DID to which the Toll Free is forwarded, a2billing adds that extracharge. For example:

With a Buying Rate of 0.02 and a Selling Rate of 0.05, and my extensions_custom.conf like this:

Code:
[from-pstn-custom]
exten _X.,1,Answer
exten _X.,2,Set(CALLERID(DNID)=${EXTEN})
exten _X.,3,Noop(The DNID is ${CALLERID(dnid)})
exten _X.,4,Wait,2
exten _X.,5,DeadAGI,a2billing.php
exten _X.,6,Hangup



I make call #1: I dial 18664874872 with the following values in a2billing.conf :

Code:
sip_iax_friends = NO

extracharge_did = 8585699800,18664874872 ; TollFreeCallerID, TollFreeNumber
extracharge_fee = 0.50,0.60 ; test extra-charges


The call logs show the following values:
Code:
Source      Duration    Buy     Sell
8585699800  01:01       0.020  0.051


In other words, it does not add the extracharge, but...

I make call #2: I dial 18664874872 again, but with the following values in a2billing.conf to include an extracharge for the local DID number that the Toll Free Number is forwarded to (a nonsense, just to test the "extracharge"):
Code:
extracharge_did = 8585699800,18664874872,16785347853 ; TollFreeCallerID, TollFreeNumber, LocalDIDNumber
extracharge_fee = 0.50,0.60,0.70 ; test extra-charges


The call logs show the following values:
Code:
Source      Duration     Buy     Sell
8585699800  01:01        0.020  0.763


In other words, the system only adds the extracharge to the local DID number that the Toll Free Number is forwarded to. Which makes no sense to me, of course, because I want the Toll Free and not the local DID to have the extracharge.

Why is this happening? Does this have anything to do with my trunking or trunk secuence? Do I have to setup an extra thing in my SIP Trunk? Do I need a separate Trunk for the Toll Free Number?

Thank you in advance for any help.

Following is the a2billing_agi.log for a call like #2 :
Code:
WHERE cc_tariffgroup.id=1 AND (dialprefix='16788866359' OR dialprefix='1678886635' OR dialprefix='167888663' OR dialprefix='16788866' OR dialprefix='1678886' OR dialprefix='167888' OR dialprefix='16788' OR dialprefix='1678' OR dialprefix='167' OR dialprefix='16' OR dialprefix='1' OR dialprefix='defaultprefix')
AND startingdate<= CURRENT_TIMESTAMP AND (expirationdate > CURRENT_TIMESTAMP OR expirationdate IS NULL OR LENGTH(expirationdate)<5)
AND startdate<= CURRENT_TIMESTAMP AND (stopdate > CURRENT_TIMESTAMP OR stopdate IS NULL OR LENGTH(stopdate)<5)
AND (starttime <= 1357 AND endtime >=1357)
AND idtariffgroup='1'
AND ( dnidprefix=SUBSTRING('16785347853',1,length(dnidprefix)) OR (dnidprefix='all' AND 0 = 0))
AND ( calleridprefix=SUBSTRING('8585699800',1,length(calleridprefix)) OR (calleridprefix='all' AND 0 = 0))
ORDER BY LENGTH(dialprefix) DESC
]
[01/09/2008 22:37:39]:[file:Class.RateEngine.php - line:192]:[CallerID:8585699800]:[CN:3380885796]:[[rate-engine: Count Total result 1]]
[01/09/2008 22:37:39]:[file:Class.RateEngine.php - line:258]:[CallerID:8585699800]:[CN:3380885796]:[[CC_asterisk_rate-engine: Extracharge DID found: 16785347853, extra fee: 0.70, extra buy fee: ]]
[01/09/2008 22:37:39]:[file:Class.RateEngine.php - line:267]:[CallerID:8585699800]:[CN:3380885796]:[[CC_asterisk_rate-engine: Count Total result 1]]
[01/09/2008 22:37:39]:[file:Class.RateEngine.php - line:268]:[CallerID:8585699800]:[CN:3380885796]:[[CC_asterisk_rate-engine: number_trunk 1]]
[01/09/2008 22:37:39]:[file:Class.A2Billing.php - line:741]:[CallerID:8585699800]:[CN:3380885796]:[OK - RESFINDRATE::> 1]
[01/09/2008 22:37:39]:[file:Class.RateEngine.php - line:280]:[CallerID:8585699800]:[CN:3380885796]:[[CC_RATE_ENGINE_ALL_CALCULTIMEOUT (8.33590)]]
[01/09/2008 22:37:39]:[file:Class.RateEngine.php - line:286]:[CallerID:8585699800]:[CN:3380885796]:[[CC_RATE_ENGINE_ALL_CALCULTIMEOUT: k=0 - res_calcultimeout:666]]
[01/09/2008 22:37:39]:[file:Class.A2Billing.php - line:763]:[CallerID:8585699800]:[CN:3380885796]:[RES_ALL_CALCULTIMEOUT ::> 1]
[01/09/2008 22:37:39]:[file:Class.A2Billing.php - line:780]:[CallerID:8585699800]:[CN:3380885796]:[TIMEOUT::> 666  : minutes=11 - seconds=6]
[01/09/2008 22:37:44]:[file:Class.RateEngine.php - line:1012]:[CallerID:8585699800]:[CN:3380885796]:[app_callingcard: Dialing 'IAX2/15689@voipjet/16788866359|60|HRgrL(666000:61000:30000)' with timeout of '666'.
]
[01/09/2008 22:37:44]:[file:Class.RateEngine.php - line:1037]:[CallerID:8585699800]:[CN:3380885796]:[app_callingcard: CIDGROUPID='-1' OUTBOUND CID SELECTED IS '0'.]
[01/09/2008 22:38:52]:[file:Class.RateEngine.php - line:1042]:[CallerID:8585699800]:[CN:3380885796]:[DIAL IAX2/15689@voipjet/16788866359|60|HRgrL(666000:61000:30000)]
[01/09/2008 22:38:52]:[file:Class.RateEngine.php - line:1139]:[CallerID:8585699800]:[CN:3380885796]:[-> dialstatus : ANSWER, answered time is 62
]
[01/09/2008 22:38:52]:[file:Class.RateEngine.php - line:1143]:[CallerID:8585699800]:[CN:3380885796]:[[USEDRATECARD=0]]
[01/09/2008 22:38:52]:[file:Class.RateEngine.php - line:820]:[CallerID:8585699800]:[CN:3380885796]:[ft2c_package_offer : 0 ;  ; 0]
[01/09/2008 22:38:52]:[file:Class.RateEngine.php - line:646]:[CallerID:8585699800]:[CN:3380885796]:[[CC_RATE_ENGINE_CALCULCOST: K=0 - CALLDURATION:62 - freetimetocall_used=0]]
[01/09/2008 22:38:52]:[file:Class.RateEngine.php - line:685]:[CallerID:8585699800]:[CN:3380885796]:[[TEMP - CC_RATE_ENGINE_CALCULCOST: 1. COST: -0.775]:[ (62/60) * 0.75 ]]
[01/09/2008 22:38:52]:[file:Class.RateEngine.php - line:762]:[CallerID:8585699800]:[CN:3380885796]:[[CC_RATE_ENGINE_CALCULCOST: K=0 - BUYCOST: -0.020666666666667 - SELLING COST: -0.775]]
[01/09/2008 22:38:52]:[file:Class.RateEngine.php - line:875]:[CallerID:8585699800]:[CN:3380885796]:[[CC_RATE_ENGINE_UPDATESYSTEM: usedratecard K=0 - (sessiontime=62 :: dialstatus=ANSWER :: buycost=0.020666666666667 :: cost=-0.775 : signe_cc_call=+: signe=-)]]
[01/09/2008 22:38:52]:[file:Class.RateEngine.php - line:899]:[CallerID:8585699800]:[CN:3380885796]:[[CC_asterisk_stop  QUERY = INSERT INTO cc_call (uniqueid,sessionid,username,nasipaddress,starttime,sessiontime, calledstation,  terminatecause, stoptime, calledrate, sessionbill, calledcountry, calledsub, destination, id_tariffgroup, id_tariffplan, id_ratecard, id_trunk, src, sipiax, buyrate, buycost, id_card_package_offer) VALUES ('1220323018.25', 'SIP/216.235.152.236-08b74fd8',  '3380885796', '', CURRENT_TIMESTAMP - INTERVAL 62 SECOND , '62', '16788866359', 'ANSWER', now(), '0.75', '+0.775',  '', '', 'default', '1', '1', '1', '2', '8585699800', '0', '0.02', '0.020666666666667', '0')]]
[01/09/2008 22:38:52]:[file:Class.RateEngine.php - line:902]:[CallerID:8585699800]:[CN:3380885796]:[[CC_asterisk_stop 1.1: SQL: DONE : result=1]]
[01/09/2008 22:38:52]:[file:Class.RateEngine.php - line:920]:[CallerID:8585699800]:[CN:3380885796]:[[CC_asterisk_stop 1.2: SQL: UPDATE cc_card SET credit= credit-0.775  , redial='16788866359' ,  lastuse=now(), nbused=nbused+1 WHERE username='3380885796']]
[01/09/2008 22:38:52]:[file:Class.RateEngine.php - line:925]:[CallerID:8585699800]:[CN:3380885796]:[UPDATE cc_trunk SET secondusedreal = secondusedreal + 62 WHERE id_trunk='2']
[01/09/2008 22:38:52]:[file:Class.RateEngine.php - line:929]:[CallerID:8585699800]:[CN:3380885796]:[UPDATE cc_tariffplan SET secondusedreal = secondusedreal + 62 WHERE id='1']
[01/09/2008 22:38:52]:[file:a2billing.php - line:312]:[CallerID:8585699800]:[CN:3380885796]:[[a2billing account stop]]
[01/09/2008 22:38:52]:[file:a2billing.php - line:172]:[CallerID:8585699800]:[CN:3380885796]:[[CHANNEL STATUS : 6 = Line is up]]
[01/09/2008 22:38:52]:[file:a2billing.php - line:173]:[CallerID:8585699800]:[CN:3380885796]:[[CREDIT : 7.5609][CREDIT MIN_CREDIT_2CALL : 0]]
[01/09/2008 22:38:52]:[file:Class.A2Billing.php - line:676]:[CallerID:8585699800]:[CN:3380885796]:[0 &&  && 11&& 1]
[01/09/2008 22:38:57]:[file:Class.A2Billing.php - line:683]:[CallerID:8585699800]:[CN:3380885796]:[RES DTMF : -1]
[01/09/2008 22:38:57]:[file:Class.A2Billing.php - line:701]:[CallerID:8585699800]:[CN:3380885796]:[DESTINATION ::> -1]
[01/09/2008 22:38:57]:[file:Class.A2Billing.php - line:703]:[CallerID:8585699800]:[CN:3380885796]:[RULES APPLY ON DESTINATION ::> -1]
[01/09/2008 22:38:57]:[file:a2billing.php - line:172]:[CallerID:8585699800]:[CN:3380885796]:[[CHANNEL STATUS : 6 = Line is up]]
[01/09/2008 22:38:57]:[file:a2billing.php - line:173]:[CallerID:8585699800]:[CN:3380885796]:[[CREDIT : 7.5609][CREDIT MIN_CREDIT_2CALL : 0]]
[01/09/2008 22:38:57]:[file:Class.A2Billing.php - line:676]:[CallerID:8585699800]:[CN:3380885796]:[0 &&  && 11&& 2]
[01/09/2008 22:38:57]:[file:Class.A2Billing.php - line:683]:[CallerID:8585699800]:[CN:3380885796]:[RES DTMF : -1]
[01/09/2008 22:38:57]:[file:Class.A2Billing.php - line:701]:[CallerID:8585699800]:[CN:3380885796]:[DESTINATION ::> -1]
[01/09/2008 22:38:57]:[file:Class.A2Billing.php - line:703]:[CallerID:8585699800]:[CN:3380885796]:[RULES APPLY ON DESTINATION ::> -1]
[01/09/2008 22:38:57]:[file:Class.A2Billing.php - line:654]:[CallerID:8585699800]:[CN:3380885796]:[[CARD STATUS UPDATE : UPDATE cc_card SET inuse=inuse-1 WHERE username='3380885796']]
[01/09/2008 22:38:57]:[CallerID:8585699800]:[CN:3380885796]:[[exit]]


Top
 Profile  
 
 Post subject: Re: Problem with extracharge
PostPosted: Tue Sep 02, 2008 12:15 pm 
Offline
Moderator
User avatar

Joined: Thu Jun 22, 2006 2:19 pm
Posts: 2890
Location: Devon, UK
habreu wrote:
the local DID to which the Toll Free is forwarded
Presumably it's your telco doing the forwarding. Surely this is why you must specify the local number, as by the time the call is delivered to you the original toll-free number isn't presented to you at all. You can't work around this in Asterisk or A2B; you must forward the toll free calls to a different number if you want to apply extra charges to them (or have the toll-free delivered directly to you, rather than being forwarded).


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


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