Support A2Billing :

provided by Star2Billing S.L.

Support A2Billing :
It is currently Thu Mar 28, 2024 9:19 pm
Hosted Voice Broadcast


All times are UTC




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: billing error using local channels
PostPosted: Tue Feb 05, 2008 10:50 pm 
Offline

Joined: Tue Aug 07, 2007 6:46 pm
Posts: 19
hi there,

I am using FreePBX with A2Billing. The idea is only bill international calls and use the power of FreePBX for the rest (voicemail, transfer, etc)

I've configured a custom trunk in FreePBX to send international calls to A2B:

local/$OUTNUM$@a2billing

the calls are routed to a2billing without any problemas and are authenticated using the FreePBX extension CID (for example, 100). Once in a2billing, I have defined a trunk to send back the call to freepbx

Provider tech: local
Provider IP: %dialingnumber%@from-internal/n

In this way I can control the outbound calls more efficiently.

So everything is ok, the call is processing ok, but when the call is answered, A2B the shows

-- Called voicetrading/00034699889560
-- SIP/voicetrading-09666768 is making progress passing it to Local/34699889560@from-internal-5581,2
-- Local/34699889560@from-internal-5581,1 is making progress passing it to Local/0034699889560@a2billing-3e8b,2
-- Local/0034699889560@a2billing-3e8b,1 is making progress passing it to SIP/100-0968a070
-- SIP/voicetrading-09666768 answered Local/34699889560@from-internal-5581,2
-- Local/34699889560@from-internal-5581,1 answered Local/0034699889560@a2billing-3e8b,2
-- Local/0034699889560@a2billing-3e8b,1 answered SIP/100-0968a070
a2billing.php|1: file:Class.RateEngine.php - line:1152 - -> dialstatus : ANSWER, answered time is 0
a2billing.php|1:
a2billing.php|1: file:Class.RateEngine.php - line:1156 - [USEDRATECARD=0]
a2billing.php|1: file:Class.RateEngine.php - line:913 - [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 ('1202248947.64', 'Local/0034699889560@a2billing-3e8b,2', '74751', '', CURRENT_TIMESTAMP - INTERVAL 0 SECOND , '0', '0034699889560', 'ANSWER', now(), '0.2', '-0', '', '', 'todo', '1', '1', '1', '2', '100', '0', '0.1', '0', '0')]
a2billing.php|1: file:Class.RateEngine.php - line:916 - [CC_asterisk_stop 1.1: SQL: DONE : result=1]
a2billing.php|1: file:a2billing.php - line:310 - [a2billing account stop]
a2billing.php|1: file:Class.A2Billing.php - line:649 - [CARD STATUS UPDATE : UPDATE cc_card SET inuse=inuse-1 WHERE username='74751']
-- AGI Script a2billing.php completed, returning 0


So the call is answered, but a2billing is always considering a duration of 0 seconds!!!

I am using 1.3.1 and 1.3.2...

any idea??


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 05, 2008 11:06 pm 
Offline
Moderator
User avatar

Joined: Thu Jun 22, 2006 2:19 pm
Posts: 2890
Location: Devon, UK
Presumably A2B is billing correctly for standard calls? If not you're suffering one of several common issues, covered ad nauseam on this forum.
These folks are doing something similar with FreePBX and reporting success. Perhaps you can glean a little insight from them.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 05, 2008 11:16 pm 
Offline

Joined: Tue Aug 07, 2007 6:46 pm
Posts: 19
stavros wrote:
Presumably A2B is billing correctly for standard calls? If not you're suffering one of several common issues, covered ad nauseam on this forum.
These folks are doing something similar with FreePBX and reporting success. Perhaps you can glean a little insight from them.


hi stavros,

A2B is billing correctly as allways, in the standard mode :) If you define a customer and a sip friend, everything is perfect...

The link you provided was the first one I saw, but it is a bit different what I am experiencing. Anyway, they are modifying FreePBX itself, while I'm not doing that at all!!!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 05, 2008 11:33 pm 
Offline

Joined: Fri Jun 23, 2006 3:56 pm
Posts: 4065
Quote:
The link you provided was the first one I saw, but it is a bit different what I am experiencing. Anyway, they are modifying FreePBX itself, while I'm not doing that at all!!!


And that is why you are getting 0 durations from FreePBX to A2Billing. It is actually recording the length of time from FreePBX to dial to A2Billing to dial.

It is the double dial that causes the problems.

Joe


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 06, 2008 7:53 am 
Offline

Joined: Tue Aug 07, 2007 6:46 pm
Posts: 19
jroper wrote:
Quote:
The link you provided was the first one I saw, but it is a bit different what I am experiencing. Anyway, they are modifying FreePBX itself, while I'm not doing that at all!!!


And that is why you are getting 0 durations from FreePBX to A2Billing. It is actually recording the length of time from FreePBX to dial to A2Billing to dial.

It is the double dial that causes the problems.

Joe


So, what do I need to change..??? FreePBX?? A2Billing?? Is it more complicated than in appeareance?

any idea, please??

regards, paco


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 06, 2008 8:13 am 
Offline

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

You will have to follow the post mentioned above to achieve this, but don't upgrade anything, cos you will break it.

Alternatively, wait until I have been to the FreePBX (http://freepbx.org/open-telephony-training-seminar-0001) course and see if I can discover a more elegant way of doing it.


Joe


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 06, 2008 9:22 am 
Offline

Joined: Tue Aug 07, 2007 6:46 pm
Posts: 19
jroper wrote:
Hi

You will have to follow the post mentioned above to achieve this, but don't upgrade anything, cos you will break it.


:)... The problem is that the other post shows a way that there is not avalaible any more: macro-dialout-trunk is now in extensions_additional.conf.
It seems that changes must be done in macro-dialout-trunk-custom this time!!!

Update: In FreePBX 2.4, macro-dialout-trunk is in extensions_additional.conf, but in 2.3.x is in extensions.conf


let's investigate...

paco


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 06, 2008 5:58 pm 
Offline

Joined: Mon Oct 01, 2007 10:44 pm
Posts: 230
Location: Bovey, Devon, UK
The local channel should not be used for billing!!! The reason is that the variables passed to A2B are volatile. This is why you are getting a zero duration value

regards


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 06, 2008 9:33 pm 
Offline

Joined: Tue Aug 07, 2007 6:46 pm
Posts: 19
middletn wrote:
The local channel should not be used for billing!!! The reason is that the variables passed to A2B are volatile. This is why you are getting a zero duration value

regards


umhhh, you kill me!!! So local channel is not suitable to use with A2B!!!

ok, i will try to re-arrange the code proposed by cyberglobe.

thanks for the info...

paco


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 06, 2008 11:34 pm 
Offline

Joined: Fri Jun 23, 2006 3:56 pm
Posts: 4065
I spoke to Philippe Lindeheimer (FreePBX lead developer) a while ago, here are a few relavent snippets of his email regarding integration of A2Billing and FreePBX: -

"The routing/trunking code in FreePBX is about the most archaic. One of those ugly areas that we’ve been wanting to gut for a long time. (Still operates much like in AMP).

As far as a current solution though – you could simply use the macro-dialout-trunk-predial-hook which is a hook that is called in macro-dialout-trunk, just prior to doing the dial command. It allows you to do anything you want, including the setting of a return code to skip the current trunk – which would not be necessary since upon exit you are hung up. You can create your custom trunk as you do today, but instead of allowing the call to go through, you can detect that it is the desired and then make your agi call in that hook."


So those are Philippe's suggestions, your quick and easy alternative of course is to set up a second box for A2Billing.

Joe


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 07, 2008 12:15 am 
Offline
Moderator
User avatar

Joined: Thu Jun 22, 2006 2:19 pm
Posts: 2890
Location: Devon, UK
plindeheimer wrote:
you could simply use the macro-dialout-trunk-predial-hook which is a hook that is called in macro-dialout-trunk, just prior to doing the dial command.
Good on you, Joe. That sounds very promising.
jroper wrote:
quick and easy alternative of course is to set up a second box for A2Billing.
It would be even quicker and easier, and more economical of energy and space, to use virtualisation such as Linux-VServer. Whichever route (physical or virtual) you choose, enabling Asterisk's 'canreinvite' will eliminate any RTP overheads during the call.


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


All times are UTC


Who is online

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