Support A2Billing :

provided by Star2Billing S.L.

Support A2Billing :
It is currently Thu Apr 25, 2024 4:46 pm
VoIP Billing solution


All times are UTC




Post new topic Reply to topic  [ 14 posts ] 
Author Message
 Post subject: RateEngine problem
PostPosted: Thu Feb 14, 2013 3:54 pm 
Offline

Joined: Thu May 17, 2012 7:40 am
Posts: 14
Hi everybody,
I don't know where I can write this post... I hope that I'm not in the wrong section...
My problem is that (I don't know why and when...) suddenly the procedure that I follow to create a ratecard, import a csv and then apply the rate card to the call plan fails.
Into the web panel I don't see error messages but when I try to make a call with the new ratecard applied, this is what I see in asterisk logs:

Code:
[2013-02-08 17:12:10] VERBOSE[8250] res_agi.c:  a2billing.php,2: file:Class.A2Billing.php - line:1017 - uniqueid:1360339918.41471 - ERROR ::> RateEngine didnt succeed to match the dialed number over the ratecard (Please check : id the ratecard is well create ; if the removeInter_Prefix is set according to your prefix in the ratecard ; if you hooked the ratecard to the Call Plan)


I didn't change anything on this machine for a long time. And the latest ratecard that I imported and that regulary works is the Jan 17 2013 one.
My A2Billing version is A2Billing 1.9.3 (Cuprum).

Can you give me some suggestion? I've tried the Simulator but no numbers match with the rates... and I'm absolutely sure that the import procedure that I follow is correct because I did it so many times!

Thank you very much for all the help that you kindly decide to give me!
Have a nice day!

Guido


Top
 Profile  
 
 Post subject: Re: RateEngine problem
PostPosted: Thu Feb 14, 2013 7:29 pm 
Offline

Joined: Mon Mar 02, 2009 8:56 pm
Posts: 271
Hi Guido,

Can you find the individual rate that you think should be matching? Does it look OK?

If nothing else has changed I would guess that either ...

- the rate card has not been assigned to the call plan you are using
- possibly the call provider started putting commas ',' in some of the destination names. I saw this recently with a provider where there were no errors, but rates were not getting imported correctly


Top
 Profile  
 
 Post subject: Re: RateEngine problem
PostPosted: Fri Feb 15, 2013 8:17 am 
Offline

Joined: Thu May 17, 2012 7:40 am
Posts: 14
Hi bucasia! Thank you for your answer!
It's really strange because I can find the rate that should be matching. When I see that error for the first time in my log, I looked to Rates -> Rates and I search the destination that logs say that no match... and I find it and looks ok.
The rate card is correctly assigned to the call plan that I'm using. I made the procedure many times... and I check many times that my new rate card is in the "ratecard list" into my call plans.
I also check for changes in my provider's file but I don't find commas ',' or ';' or something different respect to the old files.
I suppose that an A2B file could be corrupted but I don't know wich is the file that I can try to overwrite... (and I don't know where to find the files of A2Billing 1.9.3 Cuprum).
Do you think that the line

Quote:
a2billing.php,2: file:Class.A2Billing.php - line:1017 - uniqueid:1360339918.41471


could help us to understand where is the problem?
Thank you so much for your help! Have a nice day!


Top
 Profile  
 
 Post subject: Re: RateEngine problem
PostPosted: Fri Feb 15, 2013 10:03 am 
Offline

Joined: Fri Feb 15, 2013 9:09 am
Posts: 4
I'm experiencing this same problem. My older ratecard works fine but it is obsolete and i'm completely unable to make the new ratecard rate calls. ratecard upload is smooth but as soon as i activate it i get
---------------------------------------------------------------------------------------------
VERBOSE "file:Class.A2Billing.php - line:1015 - uniqueid:1360921658.2439 - ERROR ::> The phone number (XXXXXXXXXXXX) cannot be dialed by the Rate engine, check that the Ratecard and Call Plan are well configured!" 1
---------------------------------------------------------------------------------------------
Any help appreciated!
JKM


Top
 Profile  
 
 Post subject: Re: RateEngine problem
PostPosted: Fri Feb 15, 2013 11:01 am 
Offline

Joined: Thu May 17, 2012 7:40 am
Posts: 14
Yes! It's the same for me! I'm using a rate card dated 17 Jan 2013. Every rate card that I've tried to import after that date fails. For me the error is little different...

Code:
RateEngine didnt succeed to match the dialed number over the ratecard


And the strange thing is that, if I look at the rate card records after the import operation, I find all the prefixes that are necessary to match the ratecard!! :(


Top
 Profile  
 
 Post subject: Re: RateEngine problem
PostPosted: Fri Feb 15, 2013 1:58 pm 
Offline

Joined: Mon Mar 02, 2009 8:56 pm
Posts: 271
If you look a little bit farther up the debug you posted (you may need debug level 4 for this) you can see a select statement where it's trying to match the rate -

FROM cc_tariffgroup
RIGHT JOIN cc_tariffgroup_plan ON cc_tariffgroup_plan.idtariffgroup=cc_tariffgroup.id
INNER JOIN cc_tariffplan ON (cc_tariffplan.id=cc_tariffgroup_plan.idtariffplan )
LEFT JOIN cc_ratecard ON cc_ratecard.idtariffplan=cc_tariffplan.id
LEFT JOIN cc_trunk AS rt_trunk ON cc_ratecard.id_trunk=rt_trunk.id_trunk
LEFT JOIN cc_trunk AS tp_trunk ON cc_tariffplan.id_trunk=tp_trunk.id_trunk

WHERE cc_tariffgroup.id=1 AND ((dialprefix='447XXXXXXXXX' OR dialprefix='447XXXXXXXX' OR dialprefix='447XXXXXXX' OR dialprefix='447XXXXXXX' OR dialprefix='447XXXXX' OR dialprefix='447XXXX' OR dialprefix='447XXX' OR dialprefix='447XX'

Does that look OK? Is it matching the number you're expecting it to?


Top
 Profile  
 
 Post subject: Re: RateEngine problem
PostPosted: Fri Feb 15, 2013 2:00 pm 
Offline

Joined: Mon Mar 02, 2009 8:56 pm
Posts: 271
You could also check the database is OK with -

mysqlcheck -A

I'd suggest doing a backup and checking the documentation for this though before blindly running it.


Top
 Profile  
 
 Post subject: Re: RateEngine problem
PostPosted: Fri Feb 15, 2013 2:17 pm 
Offline

Joined: Thu May 17, 2012 7:40 am
Posts: 14
Do you refer to this?
http://dev.mysql.com/doc/refman/5.0/en/mysqlcheck.html
Do you think that could be a database problem?
Thanks!


Top
 Profile  
 
 Post subject: Re: RateEngine problem
PostPosted: Fri Feb 15, 2013 2:27 pm 
Offline

Joined: Mon Mar 02, 2009 8:56 pm
Posts: 271
Yes, that's the command I'm reffering too. You do see MySQL table corruption that can cause problem, but I don't think it's so in the case. It often happens in the CDR table that it written to a lot.

But from the logs above it really sounds as though a rate is not matching. I would try and see the SQL statement that is running when it's trying to match the rate.


Top
 Profile  
 
 Post subject: Re: RateEngine problem
PostPosted: Fri Feb 15, 2013 2:36 pm 
Offline

Joined: Thu May 17, 2012 7:40 am
Posts: 14
Quote:
I would try and see the SQL statement that is running when it's trying to match the rate.

Thank you so much.
Now I backup the database.


Top
 Profile  
 
 Post subject: Re: RateEngine problem
PostPosted: Sun Feb 17, 2013 12:00 am 
Offline

Joined: Fri Feb 15, 2013 9:09 am
Posts: 4
a2billing.php,2: file:Class.A2Billing.php - line:878 - uniqueid:1361056577.2699 - [CALL 2 DID]
<SIP/XXXXXX-00000a17>AGI Tx >> 200 result=1
<SIP/XXXXXX-00000a17>AGI Rx << VERBOSE "file:Class.A2Billing.php - line:887 - uniqueid:1361056577.2699 - 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 = 'XXXXXXXXXXXXXXX' 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')" 1
a2billing.php,2: file:Class.A2Billing.php - line:887 - uniqueid:1361056577.2699 - 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 = 'XXXXXXXXXXXXXXX' 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')
<SIP/XXXXXX-00000a17>AGI Tx >> 200 result=1
<SIP/XXXXXX-00000a17>AGI Rx << VERBOSE "file:Class.A2Billing.php - line:893 - uniqueid:1361056577.2699 - DESTINATION ::> XXXXXXXXXXXXXXX" 1
a2billing.php,2: file:Class.A2Billing.php - line:893 - uniqueid:1361056577.2699 - DESTINATION ::> XXXXXXXXXXXXXXX
<SIP/XXXXXX-00000a17>AGI Tx >> 200 result=1
<SIP/XXXXXX-00000a17>AGI Rx << VERBOSE "file:Class.A2Billing.php - line:900 - uniqueid:1361056577.2699 - RULES APPLY ON DESTINATION ::> XXXXXXXXXXXXXXX" 1
a2billing.php,2: file:Class.A2Billing.php - line:900 - uniqueid:1361056577.2699 - RULES APPLY ON DESTINATION ::> XXXXXXXXXXXXXXX
<SIP/XXXXXX-00000a17>AGI Tx >> 200 result=1
<SIP/XXXXXX-00000a17>AGI Rx << VERBOSE "file:Class.A2Billing.php - line:3699 - uniqueid:1361056577.2699 - [SAVING DESTINATION FOR REDIAL: SQL: UPDATE cc_card SET redial = 'XXXXXXXXXXXXXXX' WHERE username = 'ZZZZZZZZZZZZZZ']:[result: 1]" 1
a2billing.php,2: file:Class.A2Billing.php - line:3699 - uniqueid:1361056577.2699 - [SAVING DESTINATION FOR REDIAL: SQL: UPDATE cc_card SET redial = 'XXXXXXXXXXXXXXX' WHERE username = 'ZZZZZZZZZZZZZZ']:[result: 1]
<SIP/XXXXXX-00000a17>AGI Tx >> 200 result=1
<SIP/XXXXXX-00000a17>AGI Rx << VERBOSE "file:Class.RateEngine.php - line:97 - uniqueid:1361056577.2699 - [CC_asterisk_rate-engine: (6, XXXXXXXXXXXXXXX)]" 1
a2billing.php,2: file:Class.RateEngine.php - line:97 - uniqueid:1361056577.2699 - [CC_asterisk_rate-engine: (6, XXXXXXXXXXXXXXX)]---LOOKS CORRECT
<SIP/XXXXXX-00000a17>AGI Tx >> 200 result=1
<SIP/XXXXXX-00000a17>AGI Rx << VERBOSE "file:Class.RateEngine.php - line:118 - uniqueid:1361056577.2699 - [CC_asterisk_rate-engine - CALLERID : YYYYYYYYYYYYYYYYY]" 1
a2billing.php,2: file:Class.RateEngine.php - line:118 - uniqueid:1361056577.2699 - [CC_asterisk_rate-engine - CALLERID : YYYYYYYYYYYYYYYYY]
<SIP/XXXXXX-00000a17>AGI Tx >> 200 result=1
<SIP/XXXXXX-00000a17>AGI Rx << VERBOSE "file:Class.A2Billing.php - line:1015 - uniqueid:1361056577.2699 - ERROR ::> The phone number (XXXXXXXXXXXXXXX) cannot be dialed by the Rate engine, check that the Ratecard and Call Plan are well configured!" 1
a2billing.php,2: file:Class.A2Billing.php - line:1015 - uniqueid:1361056577.2699 - ERROR ::> The phone number (XXXXXXXXXXXXXXX) cannot be dialed by the Rate engine, check that the Ratecard and Call Plan are well configured!
<SIP/XXXXXX-00000a17>AGI Tx >> 200 result=1
<SIP/XXXXXX-00000a17>AGI Rx << STREAM FILE prepaid-dest-unreachable "#" 0
-- Playing 'prepaid-dest-unreachable' (escape_digits=#) (sample_offset 0)


Top
 Profile  
 
 Post subject: Re: RateEngine problem
PostPosted: Sun Feb 17, 2013 12:02 am 
Offline

Joined: Fri Feb 15, 2013 9:09 am
Posts: 4
The problem however persists
Quote:
a2billing.php,2: file:Class.A2Billing.php - line:1015 - uniqueid:1361056577.2699 - ERROR ::> The phone number (XXXXXXXXXXXXXXX) cannot be dialed by the Rate engine, check that the Ratecard and Call Plan are well configured!


Top
 Profile  
 
 Post subject: Re: RateEngine problem
PostPosted: Sun Feb 17, 2013 5:34 pm 
Offline

Joined: Fri Feb 15, 2013 9:09 am
Posts: 4
Resolved! The issue has to do with a Bug. The new ratecards i was creating were saving with an expiry date 0000-00-00 00:00, this needed to be manually modified to a future data. Many thanks Joe.


Top
 Profile  
 
 Post subject: Re: RateEngine problem
PostPosted: Wed Mar 13, 2013 11:26 pm 
Offline

Joined: Thu Nov 10, 2011 5:40 am
Posts: 4
Thanks jkamula ! I was going nuts with this same issue.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ] 
VoIP Billing solution


All times are UTC


Who is online

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