54 static char *
app =
"GetCPEID";
70 unsigned char cpeid[4];
73 int width, height, buttons;
77 for (x = 0; x < 4; x++)
80 strcpy(data[0],
"** CPE Info **");
81 strcpy(data[1],
"Identifying CPE...");
82 strcpy(data[2],
"Please wait...");
89 ast_verb(3,
"Got CPEID of '%02hhx:%02hhx:%02hhx:%02hhx' on '%s'\n",
93 strcpy(data[1],
"Measuring CPE...");
94 strcpy(data[2],
"Please wait...");
98 ast_verb(3,
"CPE has %d lines, %d columns, and %d buttons on '%s'\n", height, width, buttons,
ast_channel_name(chan));
104 snprintf(data[1], 80,
"CPEID: %02hhx:%02hhx:%02hhx:%02hhx",
105 cpeid[0], cpeid[1], cpeid[2], cpeid[3]);
107 strcpy(data[1],
"CPEID Unknown");
109 snprintf(data[2], 80,
"Geom: %dx%d, %d buttons", width, height, buttons);
111 strcpy(data[2],
"Geometry unknown");
112 strcpy(data[3],
"Press # to exit");
144 .requires =
"res_adsi",
Main Channel structure associated with a channel.
Asterisk locking-related definitions:
Asterisk main include file. File version handling, generic pbx functions.
int ast_adsi_load_session(struct ast_channel *chan, unsigned char *app, int ver, int data)
Check if scripts for a given app are already loaded. Version may be -1, if any version is okay...
static int cpeid_exec(struct ast_channel *chan, const char *idata)
static int load_module(void)
Generic File Format Support. Should be included by clients of the file handling routines. File service providers should instead include mod_format.h.
ADSI Support (built upon Caller*ID)
int ast_unregister_application(const char *app)
Unregister an application.
int ast_adsi_get_cpeid(struct ast_channel *chan, unsigned char *cpeid, int voice)
#define ast_verb(level,...)
static const struct adsi_event justify[]
General Asterisk PBX channel definitions.
Core PBX routines and definitions.
#define ast_alloca(size)
call __builtin_alloca to ensure we get gcc builtin semantics
static int cpeid_setstatus(struct ast_channel *chan, char *stuff[], int voice)
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS|AST_MODFLAG_LOAD_ORDER, "HTTP Phone Provisioning",.support_level=AST_MODULE_SUPPORT_EXTENDED,.load=load_module,.unload=unload_module,.reload=reload,.load_pri=AST_MODPRI_CHANNEL_DEPEND,.requires="http",)
int ast_waitfordigit(struct ast_channel *c, int ms)
Waits for a digit.
static int unload_module(void)
const char * ast_channel_name(const struct ast_channel *chan)
int ast_adsi_unload_session(struct ast_channel *chan)
#define ASTERISK_GPL_KEY
The text the key() function should return.
Asterisk module definitions.
#define ast_register_application_xml(app, execute)
Register an application using XML documentation.
int ast_adsi_get_cpeinfo(struct ast_channel *chan, int *width, int *height, int *buttons, int voice)
int ast_adsi_print(struct ast_channel *chan, char **lines, int *align, int voice)
Display some stuff on the screen.