<div dir="ltr"><div>Hi Efelin,</div><div><br></div><div>I've just done the same, moved "rating engine only" from CDRTool to another location. </div><div>I have moved folders: library, phplib and scripts also have changed init script and global.inc and set path to new locations. </div>
<div>Everything work just fine.</div><div><br></div><div>I use CDRTool 9.0.1 source tarball. </div><div><br></div><div>DebitBalanceAudio function is defined in the RatingEngine class (/library/rating.php) in the same class in the constructor function you can find init db statement:</div>
<div> // init database</div><div> $this->db = new DB_CDRTool;</div><div><br></div><div>Hope this can give you some idea.. <br></div><div><br></div><div>Regards,</div><div>Arsen.</div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Mon, Oct 14, 2013 at 11:46 AM, Efelin Novak <span dir="ltr"><<a href="mailto:efelin.novak@gmail.com" target="_blank">efelin.novak@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div><div><div>Hi folks,<br><br></div>I have a problem with the installation of the rating_engine. I don't want to have whole CDRTool project installed on my machine. The only part I need in my installation for now is the rating_engine system. I installed the php packages on my debian system, configured global.inc file, removed all deprecated & from the code and run the ratingEngine.php. MaxSesisonTime for any rates I'm calling with my prepaid account works. The time is counted correctly. However when the DebitBalance is called from call-controll application and the ratingEngine.php tries to update the prepaid table it runs the query in the wrong database (DB_opensips insted of DB_CDRTool)<br>
<br></div><div>I have call-controll 2.0.15 and CDRTool 9.0.1<br><br></div><div>Is this a problem of an implementation or the problem is in my "solo ratingEngine.php" configuration/installation?<br><br></div><div>
Thanks<br><br></div><div>Efelin<br></div><div></div><div><br></div><div><br></div>My config goes as follow:<br><br></div><div>//paths, provider, normalize and anti-fraud settings are ommited.<br></div><div><br>$RatingEngine=array("socketIP" => "127.0.0.1",<br>
"socketPort" => "9024",<br> "cdr_source" => "opensips_radius",<br> "log_delay" => 0.05,<br>
"split_rating_table" => false, <br> "csv_delimiter" => ",",<br> "priceDenominator" => 1,<br> "priceDecimalDigits" => 4,<br>
"durationPeriodRated" => 60,<br> "trafficSizeRated" => 1024,<br> "reportMissingRates" => 1,<br> "rate_longer_than" => 0, <br>
"allow" => array ('127.0.0.1'),<br> "MaxSessionTime" => 14400,<br> "rate_on_net_calls" => false<br>
);<br><br>class DB_CDRTool extends DB_Sql {<br> var $Host = "IP";<br> var $Database = "cdrtool";<br> var $User = "cdradmin";<br> var $Password = "xxxxx";<br>
var $Halt_On_Error ="yes";<br>}<br><br>class DB_radius extends DB_Sql {<br> var $Host = "IP";<br> var $Database = "cdrtool_radius";<br> var $User = "cdradmin";<br> var $Password = "xxxxx";<br>
var $Halt_On_Error ="no";<br>}<br><br>class DB_opensips extends DB_Sql {<br> var $Host = "IP";<br> var $Database = "cdrtool_opensips";<br> var $User = "cdradmin";<br> var $Password = "xxxxx";<br>
var $Halt_On_Error ="yes";<br>}<br><br><br>"opensips_radius"=>array(<br> "name" => "OpenSIPS",<br> "class" => "CDRS_opensips",<br>
"db_class" => "DB_radius",<br> "table" => "radacct",<br> "normalizedField" => "Normalized",<br>
"rating" => "1",<br> "db_subscribers" => "DB_opensips",<br> "db_registrar" => "DB_opensips",<br>
"daily_quota" => "0",<br> "UserQuotaNotify" => "0")<br><br></div><br><div><br></div></div>
<br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Regards,<br>Arsen.<br>
</div>