Olivier
2008-Oct-16 06:57 UTC
[asterisk-users] How to launch batch whenever Asterisk (re)start ?
Hi, Using Asterisk 1.4, I would like to send a couple of SIP notifies or various scripts whenever Asterisk restart. My concern is also deal with restart from CLI but I don't how Asterisk is restarted when using CLI. Is safe_asterisk used ? What is the best way to do ? Regards -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20081016/4e12f725/attachment.htm
Steve Totaro
2008-Oct-16 07:11 UTC
[asterisk-users] How to launch batch whenever Asterisk (re)start ?
On Thu, Oct 16, 2008 at 2:57 AM, Olivier <oza-4h07 at myamail.com> wrote:> Hi, > > Using Asterisk 1.4, I would like to send a couple of SIP notifies or various > scripts whenever Asterisk restart. > My concern is also deal with restart from CLI but I don't how Asterisk is > restarted when using CLI. > > Is safe_asterisk used ? > What is the best way to do ? > > Regards > >I would suggest rc.local and forget init scripts. Safe_asterisk is useful, but I call that from rc.local. Thanks, Steve Totaro The Insomniac
Torbjörn Abrahamsson
2008-Oct-16 07:43 UTC
[asterisk-users] How to launch batch whenever Asterisk (re)start ?
You could use #exec statements in one of your config-files. This would mean that they would be run on every reload. As you asked about running at every restart, not reload, you would have to check if it is indeed a restart. This could possibly be done by checking the uptime with "asterisk -rx 'show uptime'", and then parse this to see if it is quite low, meaning it would be a restart... // T Olivier wrote:> Hi, > > Using Asterisk 1.4, I would like to send a couple of SIP notifies or various > scripts whenever Asterisk restart. > My concern is also deal with restart from CLI but I don't how Asterisk is > restarted when using CLI. > > Is safe_asterisk used ? > What is the best way to do ? > > 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
Tzafrir Cohen
2008-Oct-16 08:38 UTC
[asterisk-users] How to launch batch whenever Asterisk (re)start ?
On Thu, Oct 16, 2008 at 08:57:48AM +0200, Olivier wrote:> Hi, > > Using Asterisk 1.4, I would like to send a couple of SIP notifies or various > scripts whenever Asterisk restart. > My concern is also deal with restart from CLI but I don't how Asterisk is > restarted when using CLI.What do you really want to know? That chan_sip.so got loaded? The only sane way I can think of right now to do that is a log watcher. If you're using rsyslog or syslog-ng and you send asterisk messages to syslog, maybe implementing this on your own shouldn't be a problem. -- 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