[asterisk-users] AMI perl daemon
vip killa
vipkilla at gmail.com
Mon May 16 07:33:59 CDT 2011
Thank you, that makes sense but actually I would be invoking the script
using the "externnotify" in voicemail.conf, similar to
"externnotify = /var/lib/asterisk/scripts/notify.pl"
I assume "externnotify" cannot call the FastAGI server...correct?
On Mon, May 16, 2011 at 8:23 AM, Alex Balashov <abalashov at evaristesys.com>wrote:
> On 05/16/2011 08:19 AM, vip killa wrote:
>
> If the script were called each time an extension were dialed in a
>> dialplan for example, wouldn't each new instance of the script need to
>> re-connect to AMI, run command, disconnect?
>>
>
> Well, yes, if you invoke a new instance of the script each time, that is
> what would happen. The desired approach is to have some means of
> communicating with the running daemon to indicate to it that it should
> originate a call, perhaps via a control socket/API.
>
> If your invocation is in the dial plan, the simplest thing to do would be
> to build a FastAGI server in Perl. This CPAN module can save some work:
>
>
>
> http://search.cpan.org/~jaywhy/Asterisk-FastAGI-0.02/lib/Asterisk/FastAGI.pm
>
> Then have that process either maintain a persistent AMI connection, or open
> a new one each time if you don't feel like/don't know how to implement the
> asynchronous approach.
>
> When you want to initiate a dial, just call:
>
> exten => ...,x,AGI(agi://some.server.ip/your_script)
>
> Of course, you could also use call files if the script is executing on the
> same Asterisk server as the one on which the dials take place.
>
>
> --
> Alex Balashov - Principal
> Evariste Systems LLC
> 260 Peachtree Street NW
> Suite 2200
> Atlanta, GA 30303
> Tel: +1-678-954-0670
> Fax: +1-404-961-1892
> Web: http://www.evaristesys.com/
>
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> New to Asterisk? Join us for a live introductory webinar every Thurs:
> http://www.asterisk.org/hello
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
> http://lists.digium.com/mailman/listinfo/asterisk-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20110516/365ff3d9/attachment.htm>
More information about the asterisk-users
mailing list