Asterisk Radius CDR
Hi,
I’ve recently setup Asterisk with Radius CDR by following the document:
https://wiki.asterisk.org/wiki/display/AST/RADIUS+CDR+Backend.
The issue currently I’m facing is after turning on the debug getting message: cdr_radius.c:208 radius_log: Unable to create RADIUS record. CDR
not recorded!
I’ve checked and grant access 666 to radiusclient config files: servers &
dictionary.digium and 777 to ‘/var/run/radius.seq’. I’ve noticed that
/var/run/radius.seq is not getting updated.
Further added, in asterisk CLI while running command: cdr show status getting results below;
Call Detail Record (CDR) settings
——————————–
9 thoughts on - Asterisk Radius CDR
Hello Ahmed,
I cannot advice you about steps you might have missed, probably none. To my experience, the documentation is not sufficient.
I can tell you that freeradius can be run in debug mode: radiusd -X Do this and have a close look to the output.
If you cannot find any attempt to connect to the freeradius server you need to have a close look to the asterisk log files as well. Figure out what is going wrong. There should be some clue.
I don’t understand the grant access settings. Figure out the user which is running asterisk and set the setting appropriately! I remember that I
needed the following access setting:
-rw-r—– 1 root asterisk /usr/local/etc/radiusclient-ng/servers
So read access for asterisk to the servers file. This was not documented at all, but somehow logical, if you figured it out.
I did radius client status testing with radius server, able to access the radius server. However, still getting radius CDR issue after setting debug level 8 even granting 666 access to radiusclient-ng config files.
message: cdr_radius.c:208 radius_log: Unable to create RADIUS record. CDR
not recorded!
Please advise if I missed out anything.
Date: Mon, 26 Sep 2016 12:09:34 +0200
Hi Ahmed,
I ran into similar problems. freeradius-client returns the same error code for numerous failure cases, so Asterisk doesn’t get an opportunity to log anything useful. If you look here:
https://github.com/FreeRADIUS/freeradius-client/blob/master/lib/buildreq.c
You’ll see many instances where it returns ERROR_RC. You are almost certainly running into one of these. I ended up putting in print debug into that file and recompiling. I think in my case it was as simple as a hostname not resolving.
Hello Ahmed, Andrew, and asterisk friends,
Some time ago, I ran into similar problems as well 🙂 I can confirm the statement of Andrew: Turn on the logging facilities and you will find your issue most likely. However, you need also a strategy. “Radius client testing” as you mentioned, can mean anything. The point is, can asterisk talk to the freeradius server via the client settings? To my opinion, this is easy to test. Maybe the message: “cdr_radius.c:208 radius_log: Unable to create RADIUS record. CDR not recorded” already implies that this is not possible. I cannot judge it. You can by turning on radiusd -X and have a close look to the output.
Hi Andrew and Willy,
Thanks for sharing the info.
As for enabling radius server debugging ‘radiusd -X’, made some test calls don’t see the radiusclient sending data to radius server. However, using radtest or radiusclient testing, able to send data to radius server (after enabling debug).
For further testing, on my other server using OpenSIPs, setup the radiusclient and data was able to send over to radius server without any issue i.e. using same radiusclient config that I’m using for Asterisk radiusclient.
Btw, will try to work on Andrew advise and will update you if I make any progress.
Date: Wed, 28 Sep 2016 10:09:51 +0200
Hi Ahmed and asterisk friends,
So asterisk cannot contact the radius server.
The radiusclient __can__ contact the radius server.
Check in the asterisk log files why asterisk cannot contact the radius server! Be also aware of the user, who is running the daemons. This user might need read access to certain configuration files.
You don’t get anything in the Asterisk logs because freeradius-client
(formerly radiusclient-ng) returns a single failure code for any failure when building a radius request.
Andrew
On 29 September 2016 at 15:55, Willy Offermans
You won’t see anything in the Asterisk logs because there’s nothing to log. The error happens in the freeradius-client library and returns an integer. asterisk@offermans.rompen.nl using any any the find client opinion, this and error almost a ahmedmunir007@gmail.com>
files.
. files:
noticed show radiusd out user http://www.api-digital.com
27-29,
2016
Hi Willy & Andrew,
After doing alot of hits and tries, the issue found at the dictionary.digium at radius client end. For the solution, I used the dictionary.digium that comes with asterisk source file, restarted asterisk services and able to send CDR data over to radius server.
Thanks guys for your help.