[OpenSER-Users] CDRTool question - ShowPrice command changes

Adrian Georgescu ag at ag-projects.com
Wed May 28 18:29:34 CEST 2008


Dan, you are right and I found the problem. The fix will be available  
with the next CDRTool release due next week together with Mediaproxy 2.0

Adrian

If you need a fix now for your 6.4.1:

--- rating_lib-6.4.1.phtml      2008-05-28 18:25:18.000000000 +0200
+++ rating_lib.phtml    2008-05-28 18:27:00.000000000 +0200
@@ -6078,26 +6078,28 @@
                 $timestamp=time();
              }

-            $application="audio";
-            if ($NetFields['application']) $application=$NetFields 
['application'];
+            $CDRStructure=array (
+                              $this->CDRS->CDRFields 
['callId']         => $NetFields['callid'],
+                              $this->CDRS->CDRFields 
['aNumber']        => $NetFields['from'],
+                              $this->CDRS->CDRFields 
['CanonicalURI']   => $NetFields['to'],
+                              $this->CDRS->CDRFields 
['duration']       => $NetFields['duration'],
+                              $this->CDRS->CDRFields 
['timestamp']      => time()
+                              );
+
+            $CDR = new $this->CDRS->CDR_class(&$this->CDRS, & 
$CDRStructure);
+            $CDR->normalize();

              $Rate    = new Rate($this->settings, $this->db);

              $RateDictionary=array(
-                                  'callId'          => $NetFields 
['callid'],
-                                  'timestamp'       => $timestamp,
-                                  'duration'        => $NetFields 
['duration'],
-                                  'inputTraffic'    => $NetFields 
['inputtraffic'],
-                                  'outputTraffic'   => $NetFields 
['outputtraffic'],
-                                  'DestinationId'   => $NetFields 
['destinationid'],
-                                  'BillingPartyId'  => $NetFields 
['from'],
-                                  'domain'          => $NetFields 
['domain'],
-                                  'gateway'         => $NetFields 
['gateway'],
-                                  'aNumber'         => $NetFields 
['from'],
-                                  'cNumber'         => $NetFields 
['to'],
-                                  'ENUMtld'         => $NetFields 
['enumtld'],
-                                  'applicationType' => $application,
-                                  'RatingTables'    => &$this->CDRS- 
 >RatingTables,
+                                  'duration'        => $CDR->duration,
+                                  'callId'          => $CDR->callId,
+                                  'timestamp'       => $CDR->timestamp,
+                                  'DestinationId'   => $CDR- 
 >DestinationId,
+                                  'domain'          => $CDR->domain,
+                                  'BillingPartyId'  => $CDR- 
 >BillingPartyId,
+                                  'ENUMtld'         => $CDR->ENUMtld,
+                                  'RatingTables'    => &$this->CDRS- 
 >RatingTables
                                    );

              $Rate->calculate($RateDictionary);









More information about the sr-users mailing list