[asterisk-dev] Another bounty - app_reload
Matthew Rubenstein
email at mattruby.com
Wed Oct 4 21:19:19 MST 2006
On Wed, 2006-10-04 at 17:31 -0700, asterisk-dev-request at lists.digium.com
wrote:
> Date: Wed, 04 Oct 2006 19:02:08 -0400
> From: Kristian Kielhofner <kris at krisk.org>
> Subject: Re: [asterisk-dev] Another bounty - app_reload
> To: Asterisk Developers Mailing List <asterisk-dev at lists.digium.com>
> Message-ID: <45243D70.4010404 at krisk.org>
> Content-Type: text/plain; charset=iso-8859-1; format=flowed
>
> Andrew Kohlsmith wrote:
> > On Wednesday 04 October 2006 15:47, Kristian Kielhofner wrote:
> >
> >> So, here is another bounty! app_reload should be able to
> initiate a
> >>reload from the dialplan. It should also be able to (optionally)
> >>specify a single module to reload, i.e. chan_sip.so, etc.
> >
> >
> > What's wrong with:
> >
> > exten => 735623,1,System(/usr/sbin/asterisk -rx "reload")
> > exten => 735623,n,Hangup
> >
> > ??
> >
> > -A.
>
> As I stated before:
>
> "Yes, obviously System("asterisk -rx reload") and other variations
> would
> work. But does using the System command to launch another Asterisk
> process to connect to the already running Asterisk instance over a
> UNIX
> socket to issue a reload bother anyone else? It sure bothers me...
> Wouldn't having a dialplan app to call ast_module_reload be sooo much
> simpler?"
Actually, what seems missing from the diaplan apps is one that just
writes to the Manager API socket any passed string, and one to read from
the Manager API socket any sent data. The read command would be even
better if it could be connected to the API initially, and buffer data
sent from the Manager, for parsing by regexp (and flushing). These apps
would be especially useful in Perl Asterisk::AGI. That way dialplan and
Perl (etc) could always offer a consistent API even with arbitrary added
apps to the local installation.
ManagerWrite(<command>, <delimited-data-string>)
ManagerRead($[<channel-variable])
ManagerSubscribe($[channel-variable])
Right now it looks like the only way to do it is to write a Perl sub()
in each Asterisk::AGI Perl script that opens a socket and reads from it.
And maybe update the local install's pm. Much better if it's
standardized as part of the API that everyone's AGIs (or diaplans) can
call, depending on the installed Manager commands installed.
> --
> Kristian Kielhofner
>
>
--
(C) Matthew Rubenstein
More information about the asterisk-dev
mailing list