summaryrefslogtreecommitdiff
path: root/res/res_adsi.c
diff options
context:
space:
mode:
authorMark Michelson <mmichelson@digium.com>2012-06-25 15:55:25 +0000
committerMark Michelson <mmichelson@digium.com>2012-06-25 15:55:25 +0000
commit453e01725de7d16f538ca928065fcee3a6d0e650 (patch)
treecf4b1ac303894a749fe6544f1cf2782a71bcee3f /res/res_adsi.c
parent87810af23dc9ca98a6f544fee78dcd58022c813a (diff)
Multiple revisions 369323-369324
........ r369323 | mmichelson | 2012-06-25 10:35:43 -0500 (Mon, 25 Jun 2012) | 9 lines Eliminate embedding of res_adsi.so module. The way this is done is to stop using the optional API. Instead, res_adsi.so, when loaded fills in a table of function pointers. Review: https://reviewboard.asterisk.org/r/1991 ........ r369324 | mmichelson | 2012-06-25 10:50:17 -0500 (Mon, 25 Jun 2012) | 2 lines Forgot to svn add this file in my last commit. ........ Merged revisions 369323-369324 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 369325 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369326 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_adsi.c')
-rw-r--r--res/res_adsi.c185
1 files changed, 123 insertions, 62 deletions
diff --git a/res/res_adsi.c b/res/res_adsi.c
index f00ec8648..92987f072 100644
--- a/res/res_adsi.c
+++ b/res/res_adsi.c
@@ -49,8 +49,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/module.h"
#include "asterisk/config.h"
#include "asterisk/file.h"
-
-#define AST_API_MODULE
#include "asterisk/adsi.h"
#define DEFAULT_ADSI_MAX_RETRIES 3
@@ -73,6 +71,35 @@ static char speeddial[ADSI_MAX_SPEED_DIAL][3][SPEEDDIAL_MAX_LEN];
static int alignment = 0;
+static int adsi_begin_download(struct ast_channel *chan, char *service, unsigned char *fdn, unsigned char *sec, int version);
+static int adsi_end_download(struct ast_channel *chan);
+static int adsi_channel_restore(struct ast_channel *chan);
+static int adsi_print(struct ast_channel *chan, char **lines, int *align, int voice);
+static int adsi_load_session(struct ast_channel *chan, unsigned char *app, int ver, int data);
+static int adsi_unload_session(struct ast_channel *chan);
+static int adsi_transmit_message(struct ast_channel *chan, unsigned char *msg, int msglen, int msgtype);
+static int adsi_transmit_message_full(struct ast_channel *chan, unsigned char *msg, int msglen, int msgtype, int dowait);
+static int adsi_read_encoded_dtmf(struct ast_channel *chan, unsigned char *buf, int maxlen);
+static int adsi_connect_session(unsigned char *buf, unsigned char *fdn, int ver);
+static int adsi_query_cpeid(unsigned char *buf);
+static int adsi_query_cpeinfo(unsigned char *buf);
+static int adsi_get_cpeid(struct ast_channel *chan, unsigned char *cpeid, int voice);
+static int adsi_get_cpeinfo(struct ast_channel *chan, int *width, int *height, int *buttons, int voice);
+static int adsi_download_connect(unsigned char *buf, char *service, unsigned char *fdn, unsigned char *sec, int ver);
+static int adsi_disconnect_session(unsigned char *buf);
+static int adsi_download_disconnect(unsigned char *buf);
+static int adsi_data_mode(unsigned char *buf);
+static int adsi_clear_soft_keys(unsigned char *buf);
+static int adsi_clear_screen(unsigned char *buf);
+static int adsi_voice_mode(unsigned char *buf, int when);
+static int adsi_available(struct ast_channel *chan);
+static int adsi_display(unsigned char *buf, int page, int line, int just, int wrap, char *col1, char *col2);
+static int adsi_set_line(unsigned char *buf, int page, int line);
+static int adsi_load_soft_key(unsigned char *buf, int key, const char *llabel, const char *slabel, char *ret, int data);
+static int adsi_set_keys(unsigned char *buf, unsigned char *keys);
+static int adsi_input_control(unsigned char *buf, int page, int line, int display, int format, int just);
+static int adsi_input_format(unsigned char *buf, int num, int dir, int wrap, char *format1, char *format2);
+
static int adsi_generate(unsigned char *buf, int msgtype, unsigned char *msg, int msglen, int msgnum, int last, struct ast_format *codec)
{
int sum, x, bytes = 0;
@@ -328,7 +355,7 @@ static int __adsi_transmit_messages(struct ast_channel *chan, unsigned char **ms
return 0;
}
-int AST_OPTIONAL_API_NAME(ast_adsi_begin_download)(struct ast_channel *chan, char *service, unsigned char *fdn, unsigned char *sec, int version)
+static int adsi_begin_download(struct ast_channel *chan, char *service, unsigned char *fdn, unsigned char *sec, int version)
{
int bytes = 0;
unsigned char buf[256];
@@ -336,8 +363,8 @@ int AST_OPTIONAL_API_NAME(ast_adsi_begin_download)(struct ast_channel *chan, cha
/* Setup the resident soft key stuff, a piece at a time */
/* Upload what scripts we can for voicemail ahead of time */
- bytes += ast_adsi_download_connect(buf + bytes, service, fdn, sec, version);
- if (ast_adsi_transmit_message_full(chan, buf, bytes, ADSI_MSG_DOWNLOAD, 0)) {
+ bytes += adsi_download_connect(buf + bytes, service, fdn, sec, version);
+ if (adsi_transmit_message_full(chan, buf, bytes, ADSI_MSG_DOWNLOAD, 0)) {
return -1;
}
if (ast_readstring(chan, ack, 1, 10000, 10000, "")) {
@@ -350,21 +377,21 @@ int AST_OPTIONAL_API_NAME(ast_adsi_begin_download)(struct ast_channel *chan, cha
return -1;
}
-int AST_OPTIONAL_API_NAME(ast_adsi_end_download)(struct ast_channel *chan)
+static int adsi_end_download(struct ast_channel *chan)
{
int bytes = 0;
unsigned char buf[256];
/* Setup the resident soft key stuff, a piece at a time */
/* Upload what scripts we can for voicemail ahead of time */
- bytes += ast_adsi_download_disconnect(buf + bytes);
- if (ast_adsi_transmit_message_full(chan, buf, bytes, ADSI_MSG_DOWNLOAD, 0)) {
+ bytes += adsi_download_disconnect(buf + bytes);
+ if (adsi_transmit_message_full(chan, buf, bytes, ADSI_MSG_DOWNLOAD, 0)) {
return -1;
}
return 0;
}
-int AST_OPTIONAL_API_NAME(ast_adsi_transmit_message_full)(struct ast_channel *chan, unsigned char *msg, int msglen, int msgtype, int dowait)
+static int adsi_transmit_message_full(struct ast_channel *chan, unsigned char *msg, int msglen, int msgtype, int dowait)
{
unsigned char *msgs[5] = { NULL, NULL, NULL, NULL, NULL };
int msglens[5], msgtypes[5], newdatamode = (ast_channel_adsicpe(chan) & ADSI_FLAG_DATAMODE), res, x, waitforswitch = 0;
@@ -440,9 +467,9 @@ int AST_OPTIONAL_API_NAME(ast_adsi_transmit_message_full)(struct ast_channel *ch
return res;
}
-int AST_OPTIONAL_API_NAME(ast_adsi_transmit_message)(struct ast_channel *chan, unsigned char *msg, int msglen, int msgtype)
+static int adsi_transmit_message(struct ast_channel *chan, unsigned char *msg, int msglen, int msgtype)
{
- return ast_adsi_transmit_message_full(chan, msg, msglen, msgtype, 1);
+ return adsi_transmit_message_full(chan, msg, msglen, msgtype, 1);
}
static inline int ccopy(unsigned char *dst, const unsigned char *src, int max)
@@ -456,7 +483,7 @@ static inline int ccopy(unsigned char *dst, const unsigned char *src, int max)
return x;
}
-int AST_OPTIONAL_API_NAME(ast_adsi_load_soft_key)(unsigned char *buf, int key, const char *llabel, const char *slabel, char *ret, int data)
+static int adsi_load_soft_key(unsigned char *buf, int key, const char *llabel, const char *slabel, char *ret, int data)
{
int bytes = 0;
@@ -497,7 +524,7 @@ int AST_OPTIONAL_API_NAME(ast_adsi_load_soft_key)(unsigned char *buf, int key, c
return bytes;
}
-int AST_OPTIONAL_API_NAME(ast_adsi_connect_session)(unsigned char *buf, unsigned char *fdn, int ver)
+static int adsi_connect_session(unsigned char *buf, unsigned char *fdn, int ver)
{
int bytes = 0, x;
@@ -521,7 +548,7 @@ int AST_OPTIONAL_API_NAME(ast_adsi_connect_session)(unsigned char *buf, unsigned
}
-int AST_OPTIONAL_API_NAME(ast_adsi_download_connect)(unsigned char *buf, char *service, unsigned char *fdn, unsigned char *sec, int ver)
+static int adsi_download_connect(unsigned char *buf, char *service, unsigned char *fdn, unsigned char *sec, int ver)
{
int bytes = 0, x;
@@ -553,7 +580,7 @@ int AST_OPTIONAL_API_NAME(ast_adsi_download_connect)(unsigned char *buf, char *s
}
-int AST_OPTIONAL_API_NAME(ast_adsi_disconnect_session)(unsigned char *buf)
+static int adsi_disconnect_session(unsigned char *buf)
{
int bytes = 0;
@@ -568,7 +595,7 @@ int AST_OPTIONAL_API_NAME(ast_adsi_disconnect_session)(unsigned char *buf)
}
-int AST_OPTIONAL_API_NAME(ast_adsi_query_cpeid)(unsigned char *buf)
+static int adsi_query_cpeid(unsigned char *buf)
{
int bytes = 0;
buf[bytes++] = ADSI_QUERY_CPEID;
@@ -578,7 +605,7 @@ int AST_OPTIONAL_API_NAME(ast_adsi_query_cpeid)(unsigned char *buf)
return bytes;
}
-int AST_OPTIONAL_API_NAME(ast_adsi_query_cpeinfo)(unsigned char *buf)
+static int adsi_query_cpeinfo(unsigned char *buf)
{
int bytes = 0;
buf[bytes++] = ADSI_QUERY_CONFIG;
@@ -588,7 +615,7 @@ int AST_OPTIONAL_API_NAME(ast_adsi_query_cpeinfo)(unsigned char *buf)
return bytes;
}
-int AST_OPTIONAL_API_NAME(ast_adsi_read_encoded_dtmf)(struct ast_channel *chan, unsigned char *buf, int maxlen)
+static int adsi_read_encoded_dtmf(struct ast_channel *chan, unsigned char *buf, int maxlen)
{
int bytes = 0, res, gotstar = 0, pos = 0;
unsigned char current = 0;
@@ -625,20 +652,20 @@ int AST_OPTIONAL_API_NAME(ast_adsi_read_encoded_dtmf)(struct ast_channel *chan,
return bytes;
}
-int AST_OPTIONAL_API_NAME(ast_adsi_get_cpeid)(struct ast_channel *chan, unsigned char *cpeid, int voice)
+static int adsi_get_cpeid(struct ast_channel *chan, unsigned char *cpeid, int voice)
{
unsigned char buf[256] = "";
int bytes = 0, res;
- bytes += ast_adsi_data_mode(buf);
- ast_adsi_transmit_message_full(chan, buf, bytes, ADSI_MSG_DISPLAY, 0);
+ bytes += adsi_data_mode(buf);
+ adsi_transmit_message_full(chan, buf, bytes, ADSI_MSG_DISPLAY, 0);
bytes = 0;
- bytes += ast_adsi_query_cpeid(buf);
- ast_adsi_transmit_message_full(chan, buf, bytes, ADSI_MSG_DISPLAY, 0);
+ bytes += adsi_query_cpeid(buf);
+ adsi_transmit_message_full(chan, buf, bytes, ADSI_MSG_DISPLAY, 0);
/* Get response */
- res = ast_adsi_read_encoded_dtmf(chan, cpeid, 4);
+ res = adsi_read_encoded_dtmf(chan, cpeid, 4);
if (res != 4) {
ast_log(LOG_WARNING, "Got %d bytes back of encoded DTMF, expecting 4\n", res);
res = 0;
@@ -648,25 +675,25 @@ int AST_OPTIONAL_API_NAME(ast_adsi_get_cpeid)(struct ast_channel *chan, unsigned
if (voice) {
bytes = 0;
- bytes += ast_adsi_voice_mode(buf, 0);
- ast_adsi_transmit_message_full(chan, buf, bytes, ADSI_MSG_DISPLAY, 0);
+ bytes += adsi_voice_mode(buf, 0);
+ adsi_transmit_message_full(chan, buf, bytes, ADSI_MSG_DISPLAY, 0);
/* Ignore the resulting DTMF B announcing it's in voice mode */
ast_waitfordigit(chan, 1000);
}
return res;
}
-int AST_OPTIONAL_API_NAME(ast_adsi_get_cpeinfo)(struct ast_channel *chan, int *width, int *height, int *buttons, int voice)
+static int adsi_get_cpeinfo(struct ast_channel *chan, int *width, int *height, int *buttons, int voice)
{
unsigned char buf[256] = "";
int bytes = 0, res;
- bytes += ast_adsi_data_mode(buf);
- ast_adsi_transmit_message_full(chan, buf, bytes, ADSI_MSG_DISPLAY, 0);
+ bytes += adsi_data_mode(buf);
+ adsi_transmit_message_full(chan, buf, bytes, ADSI_MSG_DISPLAY, 0);
bytes = 0;
- bytes += ast_adsi_query_cpeinfo(buf);
- ast_adsi_transmit_message_full(chan, buf, bytes, ADSI_MSG_DISPLAY, 0);
+ bytes += adsi_query_cpeinfo(buf);
+ adsi_transmit_message_full(chan, buf, bytes, ADSI_MSG_DISPLAY, 0);
/* Get width */
if ((res = ast_readstring(chan, (char *) buf, 2, 1000, 500, "")) < 0) {
@@ -715,15 +742,15 @@ int AST_OPTIONAL_API_NAME(ast_adsi_get_cpeinfo)(struct ast_channel *chan, int *w
}
if (voice) {
bytes = 0;
- bytes += ast_adsi_voice_mode(buf, 0);
- ast_adsi_transmit_message_full(chan, buf, bytes, ADSI_MSG_DISPLAY, 0);
+ bytes += adsi_voice_mode(buf, 0);
+ adsi_transmit_message_full(chan, buf, bytes, ADSI_MSG_DISPLAY, 0);
/* Ignore the resulting DTMF B announcing it's in voice mode */
ast_waitfordigit(chan, 1000);
}
return res;
}
-int AST_OPTIONAL_API_NAME(ast_adsi_data_mode)(unsigned char *buf)
+static int adsi_data_mode(unsigned char *buf)
{
int bytes = 0;
@@ -738,7 +765,7 @@ int AST_OPTIONAL_API_NAME(ast_adsi_data_mode)(unsigned char *buf)
}
-int AST_OPTIONAL_API_NAME(ast_adsi_clear_soft_keys)(unsigned char *buf)
+static int adsi_clear_soft_keys(unsigned char *buf)
{
int bytes = 0;
@@ -753,7 +780,7 @@ int AST_OPTIONAL_API_NAME(ast_adsi_clear_soft_keys)(unsigned char *buf)
}
-int AST_OPTIONAL_API_NAME(ast_adsi_clear_screen)(unsigned char *buf)
+static int adsi_clear_screen(unsigned char *buf)
{
int bytes = 0;
@@ -768,7 +795,7 @@ int AST_OPTIONAL_API_NAME(ast_adsi_clear_screen)(unsigned char *buf)
}
-int AST_OPTIONAL_API_NAME(ast_adsi_voice_mode)(unsigned char *buf, int when)
+static int adsi_voice_mode(unsigned char *buf, int when)
{
int bytes = 0;
@@ -785,7 +812,7 @@ int AST_OPTIONAL_API_NAME(ast_adsi_voice_mode)(unsigned char *buf, int when)
}
-int AST_OPTIONAL_API_NAME(ast_adsi_available)(struct ast_channel *chan)
+static int adsi_available(struct ast_channel *chan)
{
int cpe = ast_channel_adsicpe(chan) & 0xff;
if ((cpe == AST_ADSI_AVAILABLE) ||
@@ -795,7 +822,7 @@ int AST_OPTIONAL_API_NAME(ast_adsi_available)(struct ast_channel *chan)
return 0;
}
-int AST_OPTIONAL_API_NAME(ast_adsi_download_disconnect)(unsigned char *buf)
+static int adsi_download_disconnect(unsigned char *buf)
{
int bytes = 0;
@@ -810,7 +837,7 @@ int AST_OPTIONAL_API_NAME(ast_adsi_download_disconnect)(unsigned char *buf)
}
-int AST_OPTIONAL_API_NAME(ast_adsi_display)(unsigned char *buf, int page, int line, int just, int wrap,
+static int adsi_display(unsigned char *buf, int page, int line, int just, int wrap,
char *col1, char *col2)
{
int bytes = 0;
@@ -857,7 +884,7 @@ int AST_OPTIONAL_API_NAME(ast_adsi_display)(unsigned char *buf, int page, int li
}
-int AST_OPTIONAL_API_NAME(ast_adsi_input_control)(unsigned char *buf, int page, int line, int display, int format, int just)
+static int adsi_input_control(unsigned char *buf, int page, int line, int display, int format, int just)
{
int bytes = 0;
@@ -880,7 +907,7 @@ int AST_OPTIONAL_API_NAME(ast_adsi_input_control)(unsigned char *buf, int page,
return bytes;
}
-int AST_OPTIONAL_API_NAME(ast_adsi_input_format)(unsigned char *buf, int num, int dir, int wrap, char *format1, char *format2)
+static int adsi_input_format(unsigned char *buf, int num, int dir, int wrap, char *format1, char *format2)
{
int bytes = 0;
@@ -900,7 +927,7 @@ int AST_OPTIONAL_API_NAME(ast_adsi_input_format)(unsigned char *buf, int num, in
return bytes;
}
-int AST_OPTIONAL_API_NAME(ast_adsi_set_keys)(unsigned char *buf, unsigned char *keys)
+static int adsi_set_keys(unsigned char *buf, unsigned char *keys)
{
int bytes = 0, x;
@@ -916,7 +943,7 @@ int AST_OPTIONAL_API_NAME(ast_adsi_set_keys)(unsigned char *buf, unsigned char *
return bytes;
}
-int AST_OPTIONAL_API_NAME(ast_adsi_set_line)(unsigned char *buf, int page, int line)
+static int adsi_set_line(unsigned char *buf, int page, int line)
{
int bytes = 0;
@@ -947,14 +974,14 @@ int AST_OPTIONAL_API_NAME(ast_adsi_set_line)(unsigned char *buf, int page, int l
static int total = 0;
static int speeds = 0;
-int AST_OPTIONAL_API_NAME(ast_adsi_channel_restore)(struct ast_channel *chan)
+static int adsi_channel_restore(struct ast_channel *chan)
{
unsigned char dsp[256] = "", keyd[6] = "";
int bytes, x;
/* Start with initial display setup */
bytes = 0;
- bytes += ast_adsi_set_line(dsp + bytes, ADSI_INFO_PAGE, 1);
+ bytes += adsi_set_line(dsp + bytes, ADSI_INFO_PAGE, 1);
/* Prepare key setup messages */
@@ -962,26 +989,26 @@ int AST_OPTIONAL_API_NAME(ast_adsi_channel_restore)(struct ast_channel *chan)
for (x = 0; x < speeds; x++) {
keyd[x] = ADSI_SPEED_DIAL + x;
}
- bytes += ast_adsi_set_keys(dsp + bytes, keyd);
+ bytes += adsi_set_keys(dsp + bytes, keyd);
}
- ast_adsi_transmit_message_full(chan, dsp, bytes, ADSI_MSG_DISPLAY, 0);
+ adsi_transmit_message_full(chan, dsp, bytes, ADSI_MSG_DISPLAY, 0);
return 0;
}
-int AST_OPTIONAL_API_NAME(ast_adsi_print)(struct ast_channel *chan, char **lines, int *alignments, int voice)
+static int adsi_print(struct ast_channel *chan, char **lines, int *alignments, int voice)
{
unsigned char buf[4096];
int bytes = 0, res, x;
for (x = 0; lines[x]; x++) {
- bytes += ast_adsi_display(buf + bytes, ADSI_INFO_PAGE, x+1, alignments[x], 0, lines[x], "");
+ bytes += adsi_display(buf + bytes, ADSI_INFO_PAGE, x+1, alignments[x], 0, lines[x], "");
}
- bytes += ast_adsi_set_line(buf + bytes, ADSI_INFO_PAGE, 1);
+ bytes += adsi_set_line(buf + bytes, ADSI_INFO_PAGE, 1);
if (voice) {
- bytes += ast_adsi_voice_mode(buf + bytes, 0);
+ bytes += adsi_voice_mode(buf + bytes, 0);
}
- res = ast_adsi_transmit_message_full(chan, buf, bytes, ADSI_MSG_DISPLAY, 0);
+ res = adsi_transmit_message_full(chan, buf, bytes, ADSI_MSG_DISPLAY, 0);
if (voice) {
/* Ignore the resulting DTMF B announcing it's in voice mode */
ast_waitfordigit(chan, 1000);
@@ -989,21 +1016,21 @@ int AST_OPTIONAL_API_NAME(ast_adsi_print)(struct ast_channel *chan, char **lines
return res;
}
-int AST_OPTIONAL_API_NAME(ast_adsi_load_session)(struct ast_channel *chan, unsigned char *app, int ver, int data)
+static int adsi_load_session(struct ast_channel *chan, unsigned char *app, int ver, int data)
{
unsigned char dsp[256] = "";
int bytes = 0, res;
char resp[2];
/* Connect to session */
- bytes += ast_adsi_connect_session(dsp + bytes, app, ver);
+ bytes += adsi_connect_session(dsp + bytes, app, ver);
if (data) {
- bytes += ast_adsi_data_mode(dsp + bytes);
+ bytes += adsi_data_mode(dsp + bytes);
}
/* Prepare key setup messages */
- if (ast_adsi_transmit_message_full(chan, dsp, bytes, ADSI_MSG_DISPLAY, 0)) {
+ if (adsi_transmit_message_full(chan, dsp, bytes, ADSI_MSG_DISPLAY, 0)) {
return -1;
}
if (app) {
@@ -1028,17 +1055,17 @@ int AST_OPTIONAL_API_NAME(ast_adsi_load_session)(struct ast_channel *chan, unsig
}
-int AST_OPTIONAL_API_NAME(ast_adsi_unload_session)(struct ast_channel *chan)
+static int adsi_unload_session(struct ast_channel *chan)
{
unsigned char dsp[256] = "";
int bytes = 0;
/* Connect to session */
- bytes += ast_adsi_disconnect_session(dsp + bytes);
- bytes += ast_adsi_voice_mode(dsp + bytes, 0);
+ bytes += adsi_disconnect_session(dsp + bytes);
+ bytes += adsi_voice_mode(dsp + bytes, 0);
/* Prepare key setup messages */
- if (ast_adsi_transmit_message_full(chan, dsp, bytes, ADSI_MSG_DISPLAY, 0)) {
+ if (adsi_transmit_message_full(chan, dsp, bytes, ADSI_MSG_DISPLAY, 0)) {
return -1;
}
@@ -1140,19 +1167,53 @@ static int reload(void)
return 0;
}
+static struct adsi_funcs res_adsi_funcs = {
+ .version = AST_ADSI_VERSION,
+ .begin_download = adsi_begin_download,
+ .end_download = adsi_end_download,
+ .channel_restore = adsi_channel_restore,
+ .print = adsi_print,
+ .load_session = adsi_load_session,
+ .unload_session = adsi_unload_session,
+ .transmit_message = adsi_transmit_message,
+ .transmit_message_full = adsi_transmit_message_full,
+ .read_encoded_dtmf = adsi_read_encoded_dtmf,
+ .connect_session = adsi_connect_session,
+ .query_cpeid = adsi_query_cpeid,
+ .query_cpeinfo = adsi_query_cpeinfo,
+ .get_cpeid = adsi_get_cpeid,
+ .get_cpeinfo = adsi_get_cpeinfo,
+ .download_connect = adsi_download_connect,
+ .disconnect_session = adsi_disconnect_session,
+ .download_disconnect = adsi_download_disconnect,
+ .data_mode = adsi_data_mode,
+ .clear_soft_keys = adsi_clear_soft_keys,
+ .clear_screen = adsi_clear_screen,
+ .voice_mode = adsi_voice_mode,
+ .available = adsi_available,
+ .display = adsi_display,
+ .set_line = adsi_set_line,
+ .load_soft_key = adsi_load_soft_key,
+ .set_keys = adsi_set_keys,
+ .input_control = adsi_input_control,
+ .input_format = adsi_input_format,
+};
+
static int load_module(void)
{
adsi_load(0);
+ ast_adsi_install_funcs(&res_adsi_funcs);
return AST_MODULE_LOAD_SUCCESS;
}
static int unload_module(void)
{
/* Can't unload this once we're loaded */
+ ast_adsi_install_funcs(NULL);
return -1;
}
-AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS | AST_MODFLAG_LOAD_ORDER, "ADSI Resource",
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "ADSI Resource",
.load = load_module,
.unload = unload_module,
.reload = reload,