IMO this would be elegant, but others probably view it as a hack.  (That's
ok; 30 years ago I was a hacker, now I'm just a hack).  

If you are starting asterisk as a service, simply create a call file to
reset the DEVSTATE values and copy it when starting asterisk. 

I've got a call file that I use to let me know my asterisk has restarted.

 

** /etc/init.d/asterisk **

#!/bin/sh

### BEGIN INIT INFO

# Provides: asterisk

# Required-Start: $network

# Required-Stop: $network

# Default-Start: 2 3 5

# Description: start asterisk server

### END INIT INFO

 

case "$1" in

'start')

        /sbin/ztcfg -vv &

        /bin/sleep 5

        /sbin/ztcfg -vv &

        /bin/sleep 5

        /bin/cp /etc/asterisk/astup.call /var/spool/asterisk/outgoing &

        cd /etc/asterisk

        /usr/sbin/asterisk -g &

        ;;

'stop')

        /usr/sbin/asterisk -rx "stop now"

        ;;

*)

        echo "Usage: $0 { start | stop }"

        ;;

esac

exit 0

 

** /etc/asterisk/astup.call

Channel: Zap/g1/wwXXXXXXX

CallerID: SIP/YYY

MaxRetries: 1

WaitTime: 60

retryTime: 5

Application: background

Data: /var/lib/asterisk/sounds/record/systemup

 

  _____  

From: [email protected]
[mailto:[email protected]] On Behalf Of Olivier
Sent: Friday, January 30, 2009 8:09 AM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: [asterisk-users] How to elegantly set DEVSTATE values
afterrestarting

 

Hi,

Whenever Asterisk restarts, some values such as DEVSTATE ones, should be
reset.
How would you proceed to have those settings done anytime Asterisk restarts
?

I was thinking of using #exec statement in appropriate .conf file.
Ant better idea ?

Regards

_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Reply via email to