Make udev ZAP devices look like devfs devices.
authorMichael Geddes <openwrt@frog.wheelycreek.net>
Wed, 14 Jan 2009 01:38:28 +0000 (01:38 +0000)
committerMichael Geddes <openwrt@frog.wheelycreek.net>
Wed, 14 Jan 2009 01:38:28 +0000 (01:38 +0000)
contrib/package/asterisk-xip/files/uci/asteriskuci

index 1fd8f99b9d9bbe185ea1528c7757c84a100555aa..b948692d64366c98497dfc434f47d0e1ef58d5e6 100755 (executable)
@@ -293,6 +293,7 @@ reload_asterisk() {
                ( sleep 5; reboot_hardware ) &
        fi
 }
+
 startup_asterisk() {
        DEST="${1%/}"
        DEFAULT=$DEST/etc/default/asterisk
@@ -302,6 +303,7 @@ startup_asterisk() {
        [ -d ${asterisk_spooldir} ] || mkdir -p ${asterisk_spooldir}
        [ -d /var/spool/asterisk ] || mkdir -p /var/spool/asterisk
        [ -h $DEST/usr/lib/asterisk/astdb ] || ln -sf /var/spool/asterisk/astdb $DEST/usr/lib/asterisk/astdb
+       [ -e /dev/zappseudo ] && [ ! -d /dev/zap -o ! -e /dev/zap/pseudo ] && mkdir -p /dev/zap && ln -s /dev/zappseudo /dev/zap/pseudo
 
        $DEST/usr/sbin/asterisk -C /tmp/asterisk/asterisk.conf $UCIOPTIONS -f 2>&1 > ${asterisk_logdir}/asterisk_proc &
        # Wait a bit then reboot the hardware
@@ -353,6 +355,8 @@ reload_uci_asterisk() {
        DEFAULT=$DEST/etc/default/asterisk
 
        if [ -r /var/run/asterisk.ctl ] ; then
+
+               [ -e /dev/zappseudo ] && [ ! -d /dev/zap -o ! -e /dev/zap/pseudo ] && mkdir -p /dev/zap && ln -s /dev/zappseudo /dev/zap/pseudo
                if setup_asterisk "$DEST" ; then
                        # Selective reload modules.
                        reload_asterisk