Support A2Billing :

provided by Star2Billing S.L.

Support A2Billing :
It is currently Tue Apr 07, 2020 4:54 pm
Predictive Dialer


All times are UTC




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: RateEngine modifications
PostPosted: Wed Jul 09, 2008 10:03 am 
Offline

Joined: Wed Jul 09, 2008 9:44 am
Posts: 2
H!

I have a task to rewrite rate_engine_findrates() function in Class.RateEngine.php file (I believe that this function handle these actions). The main problem is that there are a lot of trunks and their ratecard dial prefixes are diferent lenght, so, script takes only the longest one and dont add any alternative ratecard to the array of other trunks.

So, what I'm looking for:
1) someone who knows how to solve or already solved this problem. (at least person with some kind of experience in a2billing)
2) a2billing class diagram would be perfect.
3) any technical documentation for a2billing.
4) any other technical documentation which is related to this topic.

Thaks in advance,
Mindaugas

Ps: I'm not sure about all the actions in a2billing so if I'm wrong please correct my.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 09, 2008 6:40 pm 
Offline
Moderator
User avatar

Joined: Thu Jun 22, 2006 2:19 pm
Posts: 2890
Location: Devon, UK
A good man named Sergey was one step ahead of you. When v1.4 is released it will almost certainly be included, but if you want it in v1.3 you'll have to apply his patch yourself.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 10, 2008 5:23 am 
Offline

Joined: Wed Jul 09, 2008 9:44 am
Posts: 2
I think this is what I'm looking for. Thanks.


Top
 Profile  
 
 Post subject: A2B charges caller the lower rate
PostPosted: Fri Aug 01, 2008 6:38 am 
Offline

Joined: Sat May 10, 2008 4:19 pm
Posts: 132
Location: Wilmington, DE
Hello All.

I think the problem I have found is a little different from what I'm seeing and the patch by sokhapkin may not solve this problem. Here we go.

I have a Callplan with 2 Ratecards attached. Ratecard "a" has a buy rate of 0.08 and a sell rate of 0.15. Ratecard "b" has a buy rate of 0.19 and a sell rate of 0.25. Both for the same destination. The ratecards use different trunks ("A" and "B" respectively)

When a customer makes a call, the Rate engine selects Ratecard "a" and tries to send the call out through trunk "A", which is great. The problem is, if trunk "A" is not available it would try trunk "B" which is also good.

The BAD part is that it does not change the rate charged to the customer. The customer is charged the lower rate from trunk "A", Ratecard "a" (0.15) when the call cost 0.19 and should be charged 0.25.

Thankfully, I'm still testing, but this could be very costly.

Any ideas on how to fix this?

Thanks,

RobinA.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 01, 2008 6:26 pm 
Offline

Joined: Fri Jul 11, 2008 6:54 pm
Posts: 39
Location: Armenia, Yerevan
Hello

In my situation is normal, the rate_engineering is working fine for me, and the situation that you have write hire is not happened.

what version are you use?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 01, 2008 8:28 pm 
Offline

Joined: Sat May 10, 2008 4:19 pm
Posts: 132
Location: Wilmington, DE
Hello Varnar,

Thanks for your response. The version I'm using is 1.3.3 with PIAF 1.2 and FreePBX 2.4.0. All on top of Asterisk 1.4.20.1

I don't know enough PHP to go messing with the code. I haven't applied any of the patches out there either.


Thanks again,

RobinA


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 01, 2008 11:14 pm 
Offline

Joined: Thu Oct 19, 2006 9:56 am
Posts: 300
Location: Athens, Greece
I believe those problems have already been spotted/mentioned at this forum, before Dec 2007..

In particular, having multiple sell rates doesn't seem right (business-wise) anyway:
You cannot charge the client different rates according to which trunk actually works. Say, if you are calling Canada, you must pay the "Canada" rate.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 02, 2008 12:31 am 
Offline

Joined: Sat May 10, 2008 4:19 pm
Posts: 132
Location: Wilmington, DE
xrg,

I looked all over before posting this issue. I just couldn't find it anywhere. There are several posts about A2B choosing the wrong rate based on the length of the prefix. Anyhow, if it was already dealt with, I apologize. I would appreciate someone sending me that link.

Under most circumstances you would be correct. It wouldn't make good business sense to have multiple sell rates, but many companies offer gray routes at substantial discounts over white routes with a disclaimer. Therefore the customer is warned and would or should not expect the best quality or even the connection to be up 24 X 7. Therefore as a reseller, it is now a question of ethics. Do you sell a gray route at the price of a white route or do you give your customers the same option? Thus the reason for different sell rates.

Thanks for the response.

RobinA.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 02, 2008 10:05 am 
Offline

Joined: Fri Jul 11, 2008 6:54 pm
Posts: 39
Location: Armenia, Yerevan
Hello again
please change the following line in rateeng
$A2B -> debug( WRITELOG, $agi, __FILE__, __LINE__, "[USEDRATECARD=".$this->usedratecard."]");
to
$A2B -> debug( VERBOSE | WRITELOG, $agi, __FILE__, __LINE__, "[USEDRATECARD=".$this->usedratecard."]");
then
$A2B -> debug( WRITELOG, $agi, __FILE__, __LINE__, "[CC_RATE_ENGINE_ALL_CALCULTIMEOUT: k=$k - res_calcultimeout:$res_calcultimeout]");
to
$A2B -> debug( VERBOSE | WRITELOG, $agi, __FILE__, __LINE__, "[CC_RATE_ENGINE_ALL_CALCULTIMEOUT: k=$k - res_calcultimeout:$res_calcultimeout]");


and then put this output to forum

and then, change name of your first (low price) trunk to some one another, that he cannt make call, and then the call must go via second trunk.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 03, 2008 6:09 pm 
Offline

Joined: Sat May 10, 2008 4:19 pm
Posts: 132
Location: Wilmington, DE
varnar,

Sorry I got tied up yesterday. I ran the report but didn't get time to send it. However, it is attached.

I only had to change one line. The "USEDRATECARD" had the VERBOSE directive in it.

Thanks again for your help.

RobinA


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 03, 2008 6:40 pm 
Offline

Joined: Fri Jul 11, 2008 6:54 pm
Posts: 39
Location: Armenia, Yerevan
Can you try this rateeng file, and send the logs with the same situation


Attachments:
Class.RateEngine.zip [10.9 KiB]
Downloaded 204 times
Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 
Hosted Voice Broadcast


All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


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