[asterisk-dev] Originate as a dialplan application, and the G() flag in Dial

Russell Bryant russell at digium.com
Wed Oct 29 15:39:34 CDT 2008


----- asterisk-dev at kfife.mailworks.org wrote:

> 1. Originate:
> I think there should be a dial plan application equivalent to the CLI
> command 'originate'.  Reasoning: The Dial() application and whole the
> dial plan itself are of course intended to bridge channels and
> process
> inbound calls.  Naturally any Outbound calling necessarily originates
> from some EXTERNAL business logic coming through AMI, call files etc.
> However there are times when a dial plan events needs to trigger a
> call,
> and I can do it using something like system() and “asterisk -rx
> originate...” it seems a little kludgy.  So, I’m a little surprised
> there's no dial plan equivalent of Originate.  Should there be one?

This seems reasonable.  Also, it should be trivial to write.  The code that actually does the originate that is being used by manager originate, CLI originate, and pbx_spool, is all centralized to one of 2 API calls.

ast_pbx_outgoing_exten()

ast_pbx_outgoing_app()

For anyone interested in trying this out, don't forget to use ast_autoservice_start() on the channel running the dialplan before calling one of these API calls, and ast_autoservice_stop() afterwards.

-- 
Russell Bryant
Senior Software Engineer
Open Source Team Lead
Digium, Inc.



More information about the asterisk-dev mailing list