MeetMe doesn't work without root permissions

Hello,

I’m trying to make Asterisk work without using the root account.
Everything works fine, except from the MeetMe application. I’m trying paging calls (with or without automatic answer) ; it works when Asterisk runs as root.

When Asterisk runs as “asterisk”, I call the paging extension, I hear a beep while the targets ring for approximately 1/2 second, and then everything stops : my phone is hanged up, then targets stop ringing (otherwise, Asterisk works well and other calls aren’t affected, in this case “everything” doesn’t mean “the whole Asterisk instance”).

It seems Asterisk cannot access the DAHDI pseudo-device. On the Asterisk console and in the logs, I get :
[Oct 28 11:08:07] WARNING[5172]: app_meetme.c:864 build_conf: Unable to open pseudo device
(this line appears exactly when “everything stops”).

When I activate all options (debug,notice,warning,error,verbose,dtmf) for messages in logger.conf, I get these lines in the logs :

==> 05198101 automatically answers :
[Oct 28 11:31:24] VERBOSE[6588] netsock.c: == Using SIP RTP CoS mark 5
[Oct 28 11:31:24] VERBOSE[6636] pbx.c: – Executing [05198902@from_postes_maitres_198:1] Page(“SIP/05198000-13fb9888”, “SIP/05198101&SIP/05198202”) in new stack
[Oct 28 11:31:24] VERBOSE[6636] netsock.c: == Using SIP RTP CoS mark 5
[Oct 28 11:31:24] VERBOSE[6636] dial.c: – Called 05198101
[Oct 28 11:31:24] VERBOSE[6636] netsock.c: == Using SIP RTP CoS mark 5
[Oct 28 11:31:24] VERBOSE[6636] dial.c: – Called 05198202
[Oct 28 11:31:24] VERBOSE[6636] file.c: – <SIP/05198000-13fb9888> Playing ‘beep.gsm’ (language ‘en’)
[Oct 28 11:31:24] VERBOSE[6637] dial.c: – SIP/05198101-13fba4f8 is ringing
[Oct 28 11:31:24] VERBOSE[6638] dial.c: – SIP/05198202-13fc2238 is ringing
[Oct 28 11:31:24] VERBOSE[6637] dial.c: – SIP/05198101-13fba4f8 answered
[Oct 28 11:31:24] WARNING[6637] app_meetme.c: Unable to open pseudo device
[Oct 28 11:31:25] WARNING[6636] app_meetme.c: Unable to open pseudo device
[Oct 28 11:31:25] VERBOSE[6636] pbx.c: == Spawn extension (from_postes_maitres_198, 05198902, 1) exited non-zero on ‘SIP/05198000-13fb9888’

==> 05198101 is disconnected :
[Oct 28 11:32:04] VERBOSE[6588] netsock.c: == Using SIP RTP CoS mark 5
[Oct 28 11:32:04] VERBOSE[6673] pbx.c: – Executing [05198902@from_postes_maitres_198:1] Page(“SIP/05198000-13fc7f88”, “SIP/05198101&SIP/05198202”) in new stack
[Oct 28 11:32:04] VERBOSE[6673] netsock.c: == Using SIP RTP CoS mark 5
[Oct 28 11:32:04] VERBOSE[6673] dial.c: – Called 05198101
[Oct 28 11:32:04] VERBOSE[6673] netsock.c: == Using SIP RTP CoS mark 5
[Oct 28 11:32:04] VERBOSE[6673] dial.c: – Called 05198202
[Oct 28 11:32:04] VERBOSE[6673] file.c: – <SIP/05198000-13fc7f88> Playing ‘beep.gsm’ (language ‘en’)
[Oct 28 11:32:04] VERBOSE[6675] dial.c: – SIP/05198202-13fc1e48 is ringing
[Oct 28 11:32:04] WARNING[6673] app_meetme.c: Unable to open pseudo device
[Oct 28 11:32:04] VERBOSE[6673] pbx.c: == Spawn extension (from_postes_maitres_198, 05198902, 1) exited non-zero on ‘SIP/05198000-13fc7f88’

However, the permissions are ok on the device files :
[asterisk@pamplemus ~]$ ls -lh /dev/dahdi/
total 0
crw-rw-rw- 1 asterisk asterisk 196, 254 Aug 24 11:45 channel
crw-rw-rw- 1 asterisk asterisk 196, 0 Aug 24 11:45 ctl
crw-rw-rw- 1 asterisk asterisk 196, 255 Aug 24 11:45 pseudo
crw-rw-rw- 1 asterisk asterisk 196, 253 Aug 24 11:45 timer
crw-rw-rw- 1 asterisk asterisk 196, 250 Aug 24 11:45 transcode
(I have also tried a “chmod a+x” on them but it doesn’t change anything)

The tested extension is the following :
exten => 05198902,1,Page(SIP/05198101&SIP/05198202)
Phones connected with 05198101 and 05198202 work correctly otherwise.

I’m using Asterisk 1.6.1.6 with DAHDI 2.2.0.2, both compiled from sources, on a x86_64 RHEL 5.4 server.

Line 864 of app_meetme.c corresponds to the “unable to open pseudo device” error related the the /dev/dahdi/pseudo file opening and an ioctl on this file.

Trying cat or echo on /dev/dahdi/pseudo doesn’t give a “permission denied” error, I assume the file is correctly opened, and the error comes from the ioctl. My skills don’t go that far, and I don’t know which further investigations I can do, that’s why I post this message.

Could someone help me investigate this problem ? Thanks

Have a look at the files in /dev/dahdi. If you are running asterisk under the userid asterisk, it should look something like this:

ls -l /dev/dahdi/ total 0 crw-rw---- 1 asterisk asterisk 196, 1 2009-09-22 07:36 1 crw-rw---- 1 asterisk asterisk 196, 2 2009-09-22 07:36 2 crw-rw---- 1 asterisk asterisk 196, 3 2009-09-22 07:36 3 crw-rw---- 1 asterisk asterisk 196, 4 2009-09-22 07:36 4 crw-rw---- 1 asterisk asterisk 196, 254 2009-09-22 07:36 channel crw-rw---- 1 asterisk asterisk 196, 0 2009-09-22 07:36 ctl crw-rw---- 1 asterisk asterisk 196, 255 2009-09-22 07:36 pseudo crw-rw---- 1 asterisk asterisk 196, 253 2009-09-22 07:36 timer

You can see that the file are owned by asterisk, but nobody not in the asterisk group, with the exception of root of course, can access the files. If you have have different permissions/ownership, try changing the files so it looks like the above and see if it works. If it does, that is your problem. However, the file ownership and permissions will revert back to the default when the device files are generated on system boot. To permanently change them, you have to edit the rules file for building the devices. This will depend on your version of Linux, but on mine (debian) you have to edit /etc/udev/rules.d/50-udev.rules, or create a separate file, say dahdi.rules in the same directory, to include the following lines:

[code]KERNEL==“dahdictl”, NAME="dahdi/ctl"
KERNEL==“dahditranscode”, NAME="dahdi/transcode"
KERNEL==“dahditimer”, NAME="dahdi/timer"
KERNEL==“dahdichannel”, NAME="dahdi/channel"
KERNEL==“dahdipseudo”, NAME="dahdi/pseudo"
KERNEL==“dahdi[0-9]*”, NAME=“dahdi/%n”

DAHDI devices with ownership/permissions for running as non-root

SUBSYSTEM==“dahdi”, OWNER=“asterisk”, GROUP=“asterisk”, MODE=“0660”
[/code]

You probably already have the first part, as these should have been added when you installed dahdi. It’s the last line that creates the rule so that device files will be created and owned by the asterisk userid.

Hope this works
Ian

Hello

Thanks for your answer. But unfortunately, asterisk already owns these files, as I mentioned it. The udev rules are there, including the last one.

I can use “cat” and “echo” on these files without any error with the “asterisk” user.

Okay, after many checks, installation on another system, etc, I’ve solved the problem :

When upgrading Asterisk and DAHDI, the system engineer didn’t reload the new DAHDI drivers.
Asterisk was compiled against DAHDI 2.2.0.2, but DAHDI 2.1.0.2 was loaded.