app_stasis.c File Reference

Stasis dialplan application. More...

#include "asterisk.h"
#include "asterisk/app.h"
#include "asterisk/module.h"
#include "asterisk/pbx.h"
#include "asterisk/stasis.h"
#include "asterisk/stasis_app_impl.h"

Include dependency graph for app_stasis.c:

Go to the source code of this file.

Defines

#define MAX_ARGS   128
 Maximum number of arguments for the Stasis dialplan application.

Functions

static void __reg_module (void)
static void __unreg_module (void)
static int app_exec (struct ast_channel *chan, const char *data)
static int load_module (void)
static int unload_module (void)

Variables

static struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_DEFAULT , .description = "Stasis dialplan application" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = AST_BUILDOPT_SUM, .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .nonoptreq = "res_stasis", }
static struct ast_module_infoast_module_info = &__mod_info
static const char * stasis = "Stasis"
 Dialplan application name.


Detailed Description

Stasis dialplan application.

Author:
David M. Lee, II <dlee@digium.com>

Definition in file app_stasis.c.


Define Documentation

#define MAX_ARGS   128

Maximum number of arguments for the Stasis dialplan application.

Definition at line 79 of file app_stasis.c.


Function Documentation

static void __reg_module ( void   )  [static]

Definition at line 144 of file app_stasis.c.

static void __unreg_module ( void   )  [static]

Definition at line 144 of file app_stasis.c.

static int app_exec ( struct ast_channel chan,
const char *  data 
) [static]

/brief Stasis dialplan application callback

Definition at line 85 of file app_stasis.c.

References app_name(), args, AST_APP_ARG, ast_assert, AST_DECLARE_APP_ARGS, ast_log, AST_STANDARD_APP_ARGS, ast_strdupa, LOG_WARNING, MAX_ARGS, NULL, parse(), pbx_builtin_setvar_helper(), and stasis_app_exec().

00086 {
00087    char *parse = NULL;
00088    int ret = -1;
00089 
00090    AST_DECLARE_APP_ARGS(args,
00091       AST_APP_ARG(app_name);
00092       AST_APP_ARG(app_argv)[MAX_ARGS];
00093    );
00094 
00095    ast_assert(chan != NULL);
00096    ast_assert(data != NULL);
00097 
00098    pbx_builtin_setvar_helper(chan, "STASISSTATUS", "");
00099 
00100    /* parse the arguments */
00101    parse = ast_strdupa(data);
00102    AST_STANDARD_APP_ARGS(args, parse);
00103 
00104    if (args.argc < 1) {
00105       ast_log(LOG_WARNING, "Stasis app_name argument missing\n");
00106    } else {
00107       ret = stasis_app_exec(chan,
00108                             args.app_name,
00109                             args.argc - 1,
00110                             args.app_argv);
00111    }
00112 
00113    if (ret == -1) {
00114        pbx_builtin_setvar_helper(chan, "STASISSTATUS", "FAILED");
00115    } else {
00116        pbx_builtin_setvar_helper(chan, "STASISSTATUS", "SUCCESS");
00117    }
00118 
00119    return ret;
00120 }

static int load_module ( void   )  [static]

Definition at line 122 of file app_stasis.c.

References app_exec, ast_register_application_xml, and stasis_app_ref().

00123 {
00124    int r = 0;
00125 
00126    stasis_app_ref();
00127    r |= ast_register_application_xml(stasis, app_exec);
00128    return r;
00129 }

static int unload_module ( void   )  [static]

Definition at line 131 of file app_stasis.c.

References ast_unregister_application(), and stasis_app_unref().

00132 {
00133    int r = 0;
00134    r |= ast_unregister_application(stasis);
00135    stasis_app_unref();
00136    return r;
00137 }


Variable Documentation

struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_DEFAULT , .description = "Stasis dialplan application" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = AST_BUILDOPT_SUM, .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .nonoptreq = "res_stasis", } [static]

Definition at line 144 of file app_stasis.c.

Definition at line 144 of file app_stasis.c.

const char* stasis = "Stasis" [static]

Dialplan application name.

Definition at line 82 of file app_stasis.c.

Referenced by ast_bridge_publish_blind_transfer(), and snoop_stasis_thread().


Generated on Thu Apr 16 06:28:45 2015 for Asterisk - The Open Source Telephony Project by  doxygen 1.5.6