A fix for apt install asterisk on Ubuntu 18.04

After using "apt install asterisk" on Ubuntu 18.04.2, I noticed when running "service asterisk status" that there was a problem with the radius radcli configuration. It looked like this:

radcli: rc_read_config: rc_read_config: can't open /etc/radiusclient-ng/radiusclient.conf: No such file or directory

The full stack trace looks like this:

root@:/etc/asterisk# service asterisk status
? asterisk.service - Asterisk PBX
Loaded: loaded (/lib/systemd/system/asterisk.service; enabled; vendor preset: enabled)
Active: active (running) since Fri 2019-04-12 11:03:11 CDT; 32s ago
Docs: man:asterisk(8)
Main PID: 9319 (asterisk)
Tasks: 77 (limit: 4915)
CGroup: /system.slice/asterisk.service
+-9319 /usr/sbin/asterisk -g -f -U asterisk
Apr 12 11:03:11  asterisk[9319]: radcli: rc_read_config: rc_read_config: can't open /etc/radiusclient-ng/radiusclient.conf: No such file or directory
Apr 12 11:03:11  asterisk[9319]: [Apr 12 11:03:11] NOTICE[9319]: cdr_radius.c:278 load_module: Cannot load radiusclient-ng configuration file /etc/radiusclient-ng/radiusclient.conf
Apr 12 11:03:11  asterisk[9319]: radcli: rc_read_config: rc_read_config: can't open /etc/radiusclient-ng/radiusclient.conf: No such file or directory
Apr 12 11:03:11  asterisk[9319]: [Apr 12 11:03:11] NOTICE[9319]: cel_radius.c:250 load_module: Cannot load radiusclient-ng configuration file /etc/radiusclient-ng/radiusclient.conf
Apr 12 11:03:11  asterisk[9319]: [Apr 12 11:03:11] NOTICE[9319]: cel_tds.c:452 tds_load_module: cel_tds has no global category, nothing to configure.
Apr 12 11:03:11  asterisk[9319]: [Apr 12 11:03:11] WARNING[9319]: cel_tds.c:557 load_module: cel_tds module had config problems; declining load
Apr 12 11:03:11  asterisk[9319]: [Apr 12 11:03:11] WARNING[9319]: channel.c:570 ast_channel_register: Already have a handler for type 'Console'
Apr 12 11:03:11  asterisk[9319]: [Apr 12 11:03:11] ERROR[9319]: chan_oss.c:1515 load_module: Unable to register channel type 'OSS'
Apr 12 10:17:30  systemd[1]: asterisk.service: Got notification message from PID 5309, but reception only permitted for main PID 5243
Apr 12 11:03:11  systemd[1]: Started Asterisk PBX.

I traced the issue to a couple lines in cdr.conf and cel.conf.

I fixed it by running the following 3 lines at the bash prompt:

sed -i 's";\[radius\]"\[radius\]"g' /etc/asterisk/cdr.conf
sed -i 's";radiuscfg => /usr/local/etc/radiusclient-ng/radiusclient.conf"radiuscfg => /etc/radcli/radiusclient.conf"g' /etc/asterisk/cdr.conf
sed -i 's";radiuscfg => /usr/local/etc/radiusclient-ng/radiusclient.conf"radiuscfg => /etc/radcli/radiusclient.conf"g' /etc/asterisk/cel.conf

Then I did a "service asterisk status"

root@:/etc/asterisk# service asterisk status
? asterisk.service - Asterisk PBX
Loaded: loaded (/lib/systemd/system/asterisk.service; enabled; vendor preset: enabled)
Active: active (running) since Fri 2019-04-12 11:44:58 CDT; 4s ago
Docs: man:asterisk(8)
Main PID: 10139 (asterisk)
Tasks: 85 (limit: 4915)
CGroup: /system.slice/asterisk.service
+-10139 /usr/sbin/asterisk -g -f -U asterisk
+-10202 /usr/bin/pulseaudio --start --log-target=syslog
Apr 12 11:44:58 asterisk[10139]: [Apr 12 11:44:58] NOTICE[10139]: chan_skinny.c:8442 config_load: Configuring skinny from skinny.conf
Apr 12 11:44:58 asterisk[10139]: [Apr 12 11:44:58] NOTICE[10139]: confbridge/conf_config_parser.c:2095 verify_default_profiles: Adding default_menu menu to app_confbridge
Apr 12 11:44:58 asterisk[10139]: [Apr 12 11:44:58] WARNING[10139]: cel_pgsql.c:460 process_my_load_module: CEL pgsql config file missing global section.
Apr 12 11:44:58 asterisk[10139]: [Apr 12 11:44:58] NOTICE[10139]: cdr_pgsql.c:538 config_module: cdr_pgsql configuration contains no global section, skipping module load.
Apr 12 11:44:58 asterisk[10139]: [Apr 12 11:44:58] NOTICE[10139]: cel_custom.c:97 load_config: No mappings found in cel_custom.conf. Not logging CEL to custom CSVs.
Apr 12 11:44:58 asterisk[10139]: [Apr 12 11:44:58] NOTICE[10139]: cel_tds.c:452 tds_load_module: cel_tds has no global category, nothing to configure.
Apr 12 11:44:58 asterisk[10139]: [Apr 12 11:44:58] WARNING[10139]: cel_tds.c:557 load_module: cel_tds module had config problems; declining load
Apr 12 11:44:58 asterisk[10139]: [Apr 12 11:44:58] WARNING[10139]: channel.c:570 ast_channel_register: Already have a handler for type 'Console'
Apr 12 11:44:58 asterisk[10139]: [Apr 12 11:44:58] ERROR[10139]: chan_oss.c:1515 load_module: Unable to register channel type 'OSS'
Apr 12 11:44:58 systemd[1]: Started Asterisk PBX.

Note, this also resolved the issue with the error highlighted in blue above. I'm less worried about the OSS error and other warnings, so ignoring them for now. Hope this helps someone.

[Edit to add] Well this page rapidly became the top Google search item for some of these errors.

This was unexpected, so to be helpful I researched the OSS error. It's a simple fix. Go to /etc/asterisk/modules.conf and uncomment the following line by removing the semicolon. Save the file, then restart/reload asterisk. I won't be using OSS so that's what I did. See below:

;noload => chan_oss.so

The remaining items are notices and warnings so I'm truly not worried about em.

Add a comment

Fields followed by * are mandatory

HTML code is displayed as text and web addresses are automatically converted.

Page top