#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"
Include dependency graph for app_settransfercapability.c:
Go to the source code of this file.
Functions | |
AST_MODULE_INFO_STANDARD (ASTERISK_GPL_KEY,"Set ISDN Transfer Capability") | |
static int | load_module (void) |
static int | settransfercapability_exec (struct ast_channel *chan, void *data) |
static int | unload_module (void) |
Variables | |
static char * | app = "SetTransferCapability" |
static char * | descrip |
static char * | synopsis = "Set ISDN Transfer Capability" |
struct { | |
char * name | |
int val | |
} | transcaps [] |
Definition in file app_settransfercapability.c.
AST_MODULE_INFO_STANDARD | ( | ASTERISK_GPL_KEY | , | |
"Set ISDN Transfer Capability" | ||||
) |
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 }
char* app = "SetTransferCapability" [static] |
Definition at line 43 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.