Olivier
2009-Jan-30 14:08 UTC
[asterisk-users] How to elegantly set DEVSTATE values after restarting
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/e0742810/attachment.htm
Danny Nicholas
2009-Jan-30 14:30 UTC
[asterisk-users] How to elegantly set DEVSTATE values afterrestarting
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
Tzafrir Cohen
2009-Jan-30 14:42 UTC
[asterisk-users] How to elegantly set DEVSTATE values after restarting
On Fri, Jan 30, 2009 at 03:08:52PM +0100, Olivier wrote:> 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 > ?Sounds racy. #exec is called whenever configuration is parsed (on reload as well). It is also called before the configuration is actually parsed, and thus you can't rely on devices to exist. -- Tzafrir Cohen icq#16849755 jabber:tzafrir.cohen at xorcom.com +972-50-7952406 mailto:tzafrir.cohen at xorcom.com http://www.xorcom.com iax:guest at local.xorcom.com/tzafrir
Hi, I am using asterisk version 1.4.22.1 on a centos 5.2 machine. Is there any way to run a script somebody puts the call on/off hold ? The script must be run both on hold and off hold. Best ragards. Idris -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20090130/917e6967/attachment.htm