[asterisk-users] How to elegantly set DEVSTATE values afterrestarting

Danny Nicholas danny at debsinc.com
Fri Jan 30 08:30:15 CST 2009


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: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com] 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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20090130/0f60ee43/attachment.htm 


More information about the asterisk-users mailing list