36 #include "asterisk/lock.h"
55 static char *
app =
"GetCPEID";
71 unsigned char cpeid[4];
74 int width, height, buttons;
78 for (x = 0; x < 4; x++)
81 strcpy(data[0],
"** CPE Info **");
82 strcpy(data[1],
"Identifying CPE...");
83 strcpy(data[2],
"Please wait...");
90 ast_verb(3,
"Got CPEID of '%02x:%02x:%02x:%02x' on '%s'\n",
91 (
unsigned)cpeid[0], (
unsigned)cpeid[1], (
unsigned)cpeid[2],
92 (
unsigned)cpeid[3], chan->
name);
95 strcpy(data[1],
"Measuring CPE...");
96 strcpy(data[2],
"Please wait...");
100 ast_verb(3,
"CPE has %d lines, %d columns, and %d buttons on '%s'\n", height, width, buttons, chan->
name);
106 snprintf(data[1], 80,
"CPEID: %02x:%02x:%02x:%02x",
107 (
unsigned)cpeid[0], (
unsigned)cpeid[1],
108 (
unsigned)cpeid[2], (
unsigned)cpeid[3]);
110 strcpy(data[1],
"CPEID Unknown");
112 snprintf(data[2], 80,
"Geom: %dx%d, %d buttons", width, height, buttons);
114 strcpy(data[2],
"Geometry unknown");
115 strcpy(data[3],
"Press # to exit");
146 .nonoptreq =
"res_adsi",
Main Channel structure associated with a channel.
Asterisk main include file. File version handling, generic pbx functions.
#define ast_alloca(size)
call __builtin_alloca to ensure we get gcc builtin semantics
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)
#define AST_MODULE_INFO(keystr, flags_to_set, desc, fields...)
Generic File Format Support. Should be included by clients of the file handling routines. File service providers should instead include mod_format.h.
static struct adsi_event justify[]
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,...)
General Asterisk PBX channel definitions.
Core PBX routines and definitions.
static int cpeid_setstatus(struct ast_channel *chan, char *stuff[], int voice)
const ast_string_field name
int ast_waitfordigit(struct ast_channel *c, int ms)
Waits for a digit.
static int unload_module(void)
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.
#define ASTERISK_FILE_VERSION(file, version)
Register/unregister a source code file with the core.
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.