#include "asterisk.h"
#include <string.h>
#include <stdlib.h>
#include "asterisk/logger.h"
#include "asterisk/channel.h"
#include "asterisk/pbx.h"
#include "asterisk/module.h"
#include "asterisk/options.h"
#include "asterisk/transcap.h"
Go to the source code of this file.
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
static int | load_module (void) |
static int | settransfercapability_exec (struct ast_channel *chan, void *data) |
static int | unload_module (void) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_DEFAULT | AST_MODFLAG_BUILDSUM, .description = "Set ISDN Transfer Capability" , .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 = "361d7bb937402d51e4658efb5b4d76e4" , .load = load_module, .unload = unload_module, } |
static char * | app = "SetTransferCapability" |
static const struct ast_module_info * | ast_module_info = &__mod_info |
static char * | descrip |
static char * | synopsis = "Set ISDN Transfer Capability" |
struct { | |
char * name | |
int val | |
} | transcaps [] |
Definition in file app_settransfercapability.c.
static void __reg_module | ( | void | ) | [static] |
Definition at line 136 of file app_settransfercapability.c.
static void __unreg_module | ( | void | ) | [static] |
Definition at line 136 of file app_settransfercapability.c.
static int load_module | ( | void | ) | [static] |
Definition at line 131 of file app_settransfercapability.c.
References ast_register_application(), and settransfercapability_exec().
00132 { 00133 return ast_register_application(app, settransfercapability_exec, synopsis, descrip); 00134 }
static int settransfercapability_exec | ( | struct ast_channel * | chan, | |
void * | data | |||
) | [static] |
Definition at line 72 of file app_settransfercapability.c.
References ast_log(), ast_module_user_add, ast_module_user_remove, ast_strdupa, ast_verbose(), ast_module_user::chan, LOG_WARNING, name, option_verbose, transcaps, ast_channel::transfercapability, and VERBOSE_PREFIX_3.
Referenced by load_module().
00073 { 00074 char *tmp = NULL; 00075 struct ast_module_user *u; 00076 int x; 00077 char *opts; 00078 int transfercapability = -1; 00079 static int dep_warning = 0; 00080 00081 u = ast_module_user_add(chan); 00082 00083 if (!dep_warning) { 00084 dep_warning = 1; 00085 ast_log(LOG_WARNING, "SetTransferCapability is deprecated. Please use CHANNEL(transfercapability) instead.\n"); 00086 } 00087 00088 if (data) 00089 tmp = ast_strdupa(data); 00090 else 00091 tmp = ""; 00092 00093 opts = strchr(tmp, '|'); 00094 if (opts) 00095 *opts = '\0'; 00096 00097 for (x = 0; x < (sizeof(transcaps) / sizeof(transcaps[0])); x++) { 00098 if (!strcasecmp(transcaps[x].name, tmp)) { 00099 transfercapability = transcaps[x].val; 00100 break; 00101 } 00102 } 00103 if (transfercapability < 0) { 00104 ast_log(LOG_WARNING, "'%s' is not a valid transfer capability (see 'show application SetTransferCapability')\n", tmp); 00105 ast_module_user_remove(u); 00106 return 0; 00107 } 00108 00109 chan->transfercapability = (unsigned short)transfercapability; 00110 00111 if (option_verbose > 2) 00112 ast_verbose(VERBOSE_PREFIX_3 "Setting transfer capability to: 0x%.2x - %s.\n", transfercapability, tmp); 00113 00114 ast_module_user_remove(u); 00115 00116 return 0; 00117 }
static int unload_module | ( | void | ) | [static] |
Definition at line 120 of file app_settransfercapability.c.
References ast_module_user_hangup_all, and ast_unregister_application().
00121 { 00122 int res; 00123 00124 res = ast_unregister_application(app); 00125 00126 ast_module_user_hangup_all(); 00127 00128 return res; 00129 }
struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_DEFAULT | AST_MODFLAG_BUILDSUM, .description = "Set ISDN Transfer Capability" , .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 = "361d7bb937402d51e4658efb5b4d76e4" , .load = load_module, .unload = unload_module, } [static] |
Definition at line 136 of file app_settransfercapability.c.
char* app = "SetTransferCapability" [static] |
Definition at line 43 of file app_settransfercapability.c.
const struct ast_module_info* ast_module_info = &__mod_info [static] |
Definition at line 136 of file app_settransfercapability.c.
char* descrip [static] |
Definition at line 57 of file app_settransfercapability.c.
char* name |
Definition at line 48 of file app_settransfercapability.c.
char* synopsis = "Set ISDN Transfer Capability" [static] |
Definition at line 45 of file app_settransfercapability.c.
struct { ... } transcaps[] [static] |
Referenced by settransfercapability_exec().
int val |
Definition at line 48 of file app_settransfercapability.c.