Re: [asterisk-users] How to use an Application from inside an Application?

2007-10-13 Thread Pirlouwi
Thx a lot for response. pbx_exec is very useful.
Pirlouwi.

2007/10/12, Tilghman Lesher <[EMAIL PROTECTED]>:
>
> On Friday 12 October 2007 04:28:42 Pirlouwi wrote:
> > I wonder if there is a way to build my own asterisk application (let us
> say
> > apps/app_myappl.c),
> > and to launch other existing applications from it (for example, doing an
> > apps/app_dial.c, or others).
>
> Both the Page app and VoicemailMain do this, respectively for MeetMe and
> Directory, so you can look at their source for examples.
>
> In the case of Page, the guts of it is:
> app = pbx_findapp("MeetMe");
> pbx_exec(chan, app, meetmeopts);
>
> Please check out app_page.c for the rest of the syntax.
>
> --
> Tilghman
>
> ___
> --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
>
___
--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

Re: [asterisk-users] How to use an Application from inside an Application?

2007-10-12 Thread Tilghman Lesher
On Friday 12 October 2007 04:28:42 Pirlouwi wrote:
> I wonder if there is a way to build my own asterisk application (let us say
> apps/app_myappl.c),
> and to launch other existing applications from it (for example, doing an
> apps/app_dial.c, or others).

Both the Page app and VoicemailMain do this, respectively for MeetMe and
Directory, so you can look at their source for examples.

In the case of Page, the guts of it is:
app = pbx_findapp("MeetMe");
pbx_exec(chan, app, meetmeopts);

Please check out app_page.c for the rest of the syntax.

-- 
Tilghman

___
--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


Re: [asterisk-users] How to use an Application from inside an Application?

2007-10-12 Thread Lee Jenkins
Pirlouwi wrote:
> Hello,
> I wonder if there is a way to build my own asterisk application (let us 
> say apps/app_myappl.c),
> and to launch other existing applications from it (for example, doing an 
> apps/app_dial.c, or others).
> 
> Could someone highlight me on that?
> thx
> Pirlouwi.
> 

Even better question for me is if Asterisk can call libraries not 
written in C, but that export their routines under cdecl calling 
convention.  This might be a better question for dev lists though.

I'd really like to start writing some .so libraries for use within 
Asterisk without having to use AGI.

--

Lee


___
--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


Re: [asterisk-users] How to use an Application from inside an Application?

2007-10-12 Thread Alexandre Snarskii
On Fri, Oct 12, 2007 at 11:28:42AM +0200, Pirlouwi wrote:
> Hello,
> I wonder if there is a way to build my own asterisk application (let us say
> apps/app_myappl.c),
> and to launch other existing applications from it (for example, doing an
> apps/app_dial.c, or others).
> 
> Could someone highlight me on that?

grep pbx_exec apps/*.c 
:) 

For example, apps/app_queue.c calls MixMonitor in about that way 
(lots of code skipped for clarity): 

struct ast_app *mixmonapp = NULL;

mixmonapp = pbx_findapp("MixMonitor");

if (mixmonapp) { 
 ret = pbx_exec(qe->chan, mixmonapp, mixmonargs);
} else 
 ast_log(LOG_WARNING, "Asked to run MixMonitor on this call, but cannot 
find the MixMonitor app!\n");



___
--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


[asterisk-users] How to use an Application from inside an Application?

2007-10-12 Thread Pirlouwi
Hello,
I wonder if there is a way to build my own asterisk application (let us say
apps/app_myappl.c),
and to launch other existing applications from it (for example, doing an
apps/app_dial.c, or others).

Could someone highlight me on that?
thx
Pirlouwi.
___
--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