Pirlouwi
2007-Oct-12 09:28 UTC
[asterisk-users] How to use an Application from inside an Application?
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. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20071012/7789f9a1/attachment.htm
Alexandre Snarskii
2007-Oct-12 10:19 UTC
[asterisk-users] How to use an Application from inside an Application?
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");
Lee Jenkins
2007-Oct-12 13:26 UTC
[asterisk-users] How to use an Application from inside an Application?
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
Tilghman Lesher
2007-Oct-12 13:46 UTC
[asterisk-users] How to use an Application from inside an Application?
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
Pirlouwi
2007-Oct-13 22:07 UTC
[asterisk-users] How to use an Application from inside an Application?
Thx a lot for response. pbx_exec is very useful. Pirlouwi. 2007/10/12, Tilghman Lesher <tilghman at mail.jeffandtilghman.com>:> > 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 >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20071014/b72be69b/attachment.htm