ChannelRedirect application. More...
#include "asterisk.h"#include "asterisk/file.h"#include "asterisk/channel.h"#include "asterisk/pbx.h"#include "asterisk/module.h"#include "asterisk/lock.h"#include "asterisk/app.h"#include "asterisk/features.h"
Go to the source code of this file.
Functions | |
| static void | __reg_module (void) |
| static void | __unreg_module (void) |
| static int | asyncgoto_exec (struct ast_channel *chan, void *data) |
| static int | load_module (void) |
| static int | unload_module (void) |
Variables | |
| static struct ast_module_info __MODULE_INFO_SECTION | __mod_info = { __MODULE_INFO_GLOBALS .name = AST_MODULE, .flags = AST_MODFLAG_DEFAULT , .description = "Redirects a given channel to a dialplan target" , .key = ASTERISK_GPL_KEY , .buildopt_sum = AST_BUILDOPT_SUM, .load = load_module, .unload = unload_module, } |
| static char * | app = "ChannelRedirect" |
| static struct ast_module_info * | ast_module_info = &__mod_info |
ChannelRedirect application.
Definition in file app_channelredirect.c.
| static void __reg_module | ( | void | ) | [static] |
Definition at line 117 of file app_channelredirect.c.
| static void __unreg_module | ( | void | ) | [static] |
Definition at line 117 of file app_channelredirect.c.
| static int asyncgoto_exec | ( | struct ast_channel * | chan, |
| void * | data | ||
| ) | [static] |
Definition at line 65 of file app_channelredirect.c.
References AST_APP_ARG, ast_async_parseable_goto(), ast_channel_unlock, AST_DECLARE_APP_ARGS, AST_FLAG_BRIDGE_HANGUP_DONT, ast_get_channel_by_name_locked(), ast_log(), ast_set_flag, AST_STANDARD_APP_ARGS, ast_strdupa, ast_strlen_zero(), LOG_WARNING, ast_channel::pbx, and pbx_builtin_setvar_helper().
Referenced by load_module().
{
int res = -1;
char *info;
struct ast_channel *chan2 = NULL;
AST_DECLARE_APP_ARGS(args,
AST_APP_ARG(channel);
AST_APP_ARG(label);
);
if (ast_strlen_zero(data)) {
ast_log(LOG_WARNING, "%s requires an argument (channel,[[context,]exten,]priority)\n", app);
return -1;
}
info = ast_strdupa(data);
AST_STANDARD_APP_ARGS(args, info);
if (ast_strlen_zero(args.channel) || ast_strlen_zero(args.label)) {
ast_log(LOG_WARNING, "%s requires an argument (channel,[[context,]exten,]priority)\n", app);
return -1;
}
chan2 = ast_get_channel_by_name_locked(args.channel);
if (!chan2) {
ast_log(LOG_WARNING, "No such channel: %s\n", args.channel);
pbx_builtin_setvar_helper(chan, "CHANNELREDIRECT_STATUS", "NOCHANNEL");
return 0;
}
if (chan2->pbx) {
ast_set_flag(chan2, AST_FLAG_BRIDGE_HANGUP_DONT); /* don't let the after-bridge code run the h-exten */
}
res = ast_async_parseable_goto(chan2, args.label);
pbx_builtin_setvar_helper(chan, "CHANNELREDIRECT_STATUS", "SUCCESS");
ast_channel_unlock(chan2);
return res;
}
| static int load_module | ( | void | ) | [static] |
Definition at line 111 of file app_channelredirect.c.
References AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, ast_register_application_xml, and asyncgoto_exec().
| static int unload_module | ( | void | ) | [static] |
Definition at line 106 of file app_channelredirect.c.
References ast_unregister_application().
{
return ast_unregister_application(app);
}
struct ast_module_info __MODULE_INFO_SECTION __mod_info = { __MODULE_INFO_GLOBALS .name = AST_MODULE, .flags = AST_MODFLAG_DEFAULT , .description = "Redirects a given channel to a dialplan target" , .key = ASTERISK_GPL_KEY , .buildopt_sum = AST_BUILDOPT_SUM, .load = load_module, .unload = unload_module, } [static] |
Definition at line 117 of file app_channelredirect.c.
char* app = "ChannelRedirect" [static] |
Definition at line 63 of file app_channelredirect.c.
struct ast_module_info* ast_module_info = &__mod_info [static] |
Definition at line 117 of file app_channelredirect.c.