[OpenSIPS-Users] CDRtool freeradius mysql error

osiris123d duane.larson at gmail.com
Tue Dec 22 20:58:29 CET 2009


Ok.  I did a clean install of CDRTool 7.0.0 on a new virtual image of Debian
5.0.3.

I installed freeradius via
apt-get install freeradius-xs freeradius-xs-mysql


my /etc/freeradius/sql.conf still looks exactly the same.  I followed the
INSTALL.txt file and did the following


b. To automatically create a table for each calendar month radacctYYYYMM:

   cp /var/www/CDRTool/setup/radius/OpenSIPS/radius_accounting.conf
/etc/freeradius/sql.conf

   Load the MySQL stored procedures that create the monthly tables:
   
   mysql -u root radius <
/var/www/CDRTool/setup/radius/OpenSIPS/radius_accounting.proc



Here is what the radius database has in it
mysql> desc radacct;
+-------------------------+----------------------+------+-----+---------------------+----------------+
| Field                   | Type                 | Null | Key | Default            
| Extra          |
+-------------------------+----------------------+------+-----+---------------------+----------------+
| RadAcctId               | bigint(21)           | NO   | PRI | NULL               
| auto_increment | 
| AcctSessionId           | varchar(255)         | NO   | MUL |                    
|                | 
| AcctUniqueId            | varchar(255)         | NO   | MUL |                    
|                | 
| UserName                | varchar(64)          | NO   | MUL |                    
|                | 
| Realm                   | varchar(64)          | YES  | MUL |                    
|                | 
| NASIPAddress            | varchar(15)          | NO   | MUL |                    
|                | 
| NASPortId               | varchar(50)          | NO   |     |                    
|                | 
| NASPortType             | varchar(255)         | NO   |     |                    
|                | 
| AcctStartTime           | datetime             | NO   | MUL | 0000-00-00
00:00:00 |                | 
| AcctStopTime            | datetime             | NO   | MUL | 0000-00-00
00:00:00 |                | 
| AcctSessionTime         | int(12)              | YES  |     | NULL               
|                | 
| AcctAuthentic           | varchar(32)          | YES  |     | NULL               
|                | 
| ConnectInfo_start       | varchar(32)          | YES  |     | NULL               
|                | 
| ConnectInfo_stop        | varchar(32)          | YES  |     | NULL               
|                | 
| AcctInputOctets         | bigint(12)           | YES  |     | NULL               
|                | 
| AcctOutputOctets        | bigint(12)           | YES  |     | NULL               
|                | 
| CalledStationId         | varchar(50)          | NO   | MUL |                    
|                | 
| CallingStationId        | varchar(50)          | NO   | MUL |                    
|                | 
| AcctTerminateCause      | varchar(32)          | NO   |     |                    
|                | 
| ServiceType             | varchar(32)          | YES  |     | NULL               
|                | 
| ENUMtld                 | varchar(64)          | YES  |     | NULL               
|                | 
| FramedIPAddress         | varchar(15)          | NO   |     |                    
|                | 
| AcctStartDelay          | int(12)              | YES  |     | NULL               
|                | 
| AcctStopDelay           | int(12)              | YES  |     | NULL               
|                | 
| SipMethod               | varchar(50)          | NO   |     |                    
|                | 
| SipResponseCode         | smallint(5) unsigned | NO   |     | 0                  
|                | 
| SipToTag                | varchar(128)         | NO   |     |                    
|                | 
| SipFromTag              | varchar(128)         | NO   |     |                    
|                | 
| SipTranslatedRequestURI | varchar(255)         | NO   | MUL |                    
|                | 
| SipUserAgents           | varchar(255)         | NO   |     |                    
|                | 
| SipApplicationType      | varchar(255)         | NO   |     |                    
|                | 
| SipCodecs               | varchar(255)         | NO   |     |                    
|                | 
| SipRPID                 | varchar(255)         | NO   |     |                    
|                | 
| SipRPIDHeader           | varchar(255)         | NO   |     |                    
|                | 
| SourceIP                | varchar(255)         | NO   | MUL |                    
|                | 
| SourcePort              | varchar(255)         | NO   |     |                    
|                | 
| CanonicalURI            | varchar(255)         | NO   | MUL |                    
|                | 
| DelayTime               | varchar(5)           | NO   |     |                    
|                | 
| Timestamp               | bigint(20)           | NO   |     | 0                  
|                | 
| DestinationId           | varchar(15)          | NO   | MUL |                    
|                | 
| Rate                    | text                 | NO   |     | NULL               
|                | 
| Price                   | double(20,4)         | YES  |     | NULL               
|                | 
| Normalized              | enum('0','1')        | YES  | MUL | 0                  
|                | 
| BillingId               | varchar(255)         | NO   | MUL |                    
|                | 
| MediaInfo               | varchar(32)          | YES  | MUL | NULL               
|                | 
| RTPStatistics           | text                 | NO   |     | NULL               
|                | 
| FromHeader              | varchar(128)         | NO   |     |                    
|                | 
| UserAgent               | varchar(128)         | NO   |     |                    
|                | 
| Contact                 | varchar(128)         | NO   |     |                    
|                | 
+-------------------------+----------------------+------+-----+---------------------+----------------+
49 rows in set (0.01 sec)




Here is the mysql function status
mysql> use radius;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> show function status;
+--------+------------------------+----------+----------------+---------------------+---------------------+---------------+---------+
| Db     | Name                   | Type     | Definer        | Modified           
| Created             | Security_type | Comment |
+--------+------------------------+----------+----------------+---------------------+---------------------+---------------+---------+
| radius | set_radacct_table_name | FUNCTION | root at localhost | 2009-12-22
13:45:54 | 2009-12-22 13:45:54 | DEFINER       |         | 
+--------+------------------------+----------+----------------+---------------------+---------------------+---------------+---------+
1 row in set (0.00 sec)


Here is the mysql procedure status
mysql> SHOW PROCEDURE STATUS
    -> ;
+--------+---------------------------------------+-----------+----------------+---------------------+---------------------+---------------+---------+
| Db     | Name                                  | Type      | Definer       
| Modified            | Created             | Security_type | Comment |
+--------+---------------------------------------+-----------+----------------+---------------------+---------------------+---------------+---------+
| radius | create_radacct_table                  | PROCEDURE |
root at localhost | 2009-12-22 13:45:54 | 2009-12-22 13:45:54 | DEFINER       |        
| 
| radius | insert_radacct_record                 | PROCEDURE |
root at localhost | 2009-12-22 13:45:54 | 2009-12-22 13:45:54 | DEFINER       |        
| 
| radius | proc_update_raddact_record_mediaproxy | PROCEDURE |
root at localhost | 2009-12-22 13:45:54 | 2009-12-22 13:45:54 | DEFINER       |        
| 
| radius | update_radacct_record                 | PROCEDURE |
root at localhost | 2009-12-22 13:45:54 | 2009-12-22 13:45:54 | DEFINER       |        
| 
| radius | update_raddact_record_mediaproxy      | PROCEDURE |
root at localhost | 2009-12-22 13:45:54 | 2009-12-22 13:45:54 | DEFINER       |        
| 
+--------+---------------------------------------+-----------+----------------+---------------------+---------------------+---------------+---------+
5 rows in set (0.00 sec)

My /etc/freeradius/sql.conf still looks exactly the same.

So how should my /etc/freeradius/sql.conf file look?  The one that comes
with CDRTool 7.0.0 (var/www/CDRTool/setup/radius/OpenSIPS) is exactly the
same.  Please verify that CDRTool server should be the one that has the
following databases
cdrtool
radius
mediaproxy


For my /etc/cdrtool/global.inc I point to my CDRTool server for all the
databases except for DB_opensips which is the IP of my OpenSIPS server. 
This is correct right?


Sorry for all the trouble but something isn't right.




osiris123d wrote:
> 
> hmmmmmm, I started playing with CDRTool last week and I think CDRTool
> version 7 came out last week when I was playing with version 6.9.9.
> 
> I am going to spin up a Virtual Machine of Debian 5.0.2 and try to install
> everything again with version 7 and see whats up.
> 
> 
> 
> Adrian Georgescu wrote:
>> 
>> Looking at your configuration you are not using the latest  
>> configuration files or you did not read the changelog that comes with  
>> each update to keep your previously installed versions up to date.
>> 
>> For example the sql.conf you have does not match the ones form our  
>> latest packages, if you look at CDRTool latest sample configuration  
>> for Freaaradius the number of fields differ from yours. I am not able  
>> to tell what other things you did not update properly.
>> 
>> Regarding the table auto-creation, the radcctYYYYMM table is created  
>> by the stored procedure that you are calling in sql.conf:
>> 
>>     accounting_start_query      = "\
>>            CALL insert_radacct_record( \
>>                  'radius', \
>> 
>> The latest stored procedure is found in CDRTool setup directory you  
>> must update that as well.
>> 
>> --
>> Adrian
>> 
>> 
>> 
>> 
>> 
>> 
>> _______________________________________________
>> Users mailing list
>> Users at lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>> 
>> 
> 
> 

-- 
View this message in context: http://n2.nabble.com/CDRtool-freeradius-mysql-error-tp4200490p4205419.html
Sent from the OpenSIPS - Users mailing list archive at Nabble.com.



More information about the Users mailing list