2 * Asterisk -- An open source telephony toolkit.
4 * Copyright (C) 1999 - 2005, Digium, Inc.
6 * Mark Spencer <markster@digium.com>
8 * Includes code and algorithms from the Zapata library.
10 * See http://www.asterisk.org for more information about
11 * the Asterisk project. Please do not directly contact
12 * any of the maintainers of this project for assistance;
13 * the project provides a web site, mailing lists and IRC
14 * channels for your use.
16 * This program is free software, distributed under the terms of
17 * the GNU General Public License Version 2. See the LICENSE file
18 * at the top of the source tree.
25 * \author Mark Spencer <markster@digium.com>
27 * \note this module is required by app_voicemail and app_getcpeid
28 * \todo Move app_getcpeid into this module
29 * \todo Create a core layer so that app_voicemail does not require
35 ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
45 #include "asterisk/ulaw.h"
46 #include "asterisk/alaw.h"
47 #include "asterisk/callerid.h"
48 #include "asterisk/logger.h"
49 #include "asterisk/fskmodem.h"
50 #include "asterisk/channel.h"
51 #include "asterisk/adsi.h"
52 #include "asterisk/module.h"
53 #include "asterisk/config.h"
54 #include "asterisk/file.h"
55 #include "asterisk/options.h"
57 #define DEFAULT_ADSI_MAX_RETRIES 3
59 #define ADSI_MAX_INTRO 20
60 #define ADSI_MAX_SPEED_DIAL 6
62 #define ADSI_FLAG_DATAMODE (1 << 8)
64 static int maxretries = DEFAULT_ADSI_MAX_RETRIES;
66 /* Asterisk ADSI button definitions */
67 #define ADSI_SPEED_DIAL 10 /* 10-15 are reserved for speed dial */
69 static char intro[ADSI_MAX_INTRO][20];
70 static int aligns[ADSI_MAX_INTRO];
72 static char speeddial[ADSI_MAX_SPEED_DIAL][3][20];
74 static int alignment = 0;
76 static int adsi_generate(unsigned char *buf, int msgtype, unsigned char *msg, int msglen, int msgnum, int last, int codec)
81 /* Initial carrier (imaginary) */
89 /* If first message, Send 150ms of MARK's */
91 for (x=0;x<150;x++) /* was 150 */
94 /* Put message type */
98 /* Put message length (plus one for the message number) */
102 /* Put message number */
106 /* Put actual message */
107 for (x=0;x<msglen;x++) {
112 /* Put 2's compliment of sum */
113 PUT_CLID(256-(sum & 0xff));
117 /* Put trailing marks */
126 static int adsi_careful_send(struct ast_channel *chan, unsigned char *buf, int len, int *remainder)
128 /* Sends carefully on a full duplex channel by using reading for
130 struct ast_frame *inf, outf;
133 /* Zero out our outgoing frame */
134 memset(&outf, 0, sizeof(outf));
136 if (remainder && *remainder) {
139 /* Send remainder if provided */
140 if (amt > *remainder)
143 *remainder = *remainder - amt;
144 outf.frametype = AST_FRAME_VOICE;
145 outf.subclass = AST_FORMAT_ULAW;
149 if (ast_write(chan, &outf)) {
150 ast_log(LOG_WARNING, "Failed to carefully write frame\n");
153 /* Update pointers and lengths */
160 /* If we don't get anything at all back in a second, forget
162 if (ast_waitfor(chan, 1000) < 1)
164 inf = ast_read(chan);
168 if (inf->frametype == AST_FRAME_VOICE) {
169 /* Read a voice frame */
170 if (inf->subclass != AST_FORMAT_ULAW) {
171 ast_log(LOG_WARNING, "Channel not in ulaw?\n");
174 /* Send no more than they sent us */
175 if (amt > inf->datalen)
178 *remainder = inf->datalen - amt;
179 outf.frametype = AST_FRAME_VOICE;
180 outf.subclass = AST_FORMAT_ULAW;
184 if (ast_write(chan, &outf)) {
185 ast_log(LOG_WARNING, "Failed to carefully write frame\n");
188 /* Update pointers and lengths */
197 static int __adsi_transmit_messages(struct ast_channel *chan, unsigned char **msg, int *msglen, int *msgtype)
199 /* msglen must be no more than 256 bits, each */
200 unsigned char buf[24000 * 5];
208 /* Wait up to 500 ms for initial ACK */
214 if (chan->adsicpe == AST_ADSI_UNAVAILABLE) {
215 /* Don't bother if we know they don't support ADSI */
220 while(retries < maxretries) {
221 if (!(chan->adsicpe & ADSI_FLAG_DATAMODE)) {
222 /* Generate CAS (no SAS) */
223 ast_gen_cas(buf, 0, 680, AST_FORMAT_ULAW);
226 if (adsi_careful_send(chan, buf, 680, NULL)) {
227 ast_log(LOG_WARNING, "Unable to send CAS\n");
229 /* Wait For DTMF result */
232 if (((res = ast_waitfor(chan, waittime)) < 1)) {
233 /* Didn't get back DTMF A in time */
235 ast_log(LOG_DEBUG, "No ADSI CPE detected (%d)\n", res);
237 chan->adsicpe = AST_ADSI_UNAVAILABLE;
245 ast_log(LOG_DEBUG, "Hangup in ADSI\n");
248 if (f->frametype == AST_FRAME_DTMF) {
249 if (f->subclass == 'A') {
250 /* Okay, this is an ADSI CPE. Note this for future reference, too */
252 chan->adsicpe = AST_ADSI_AVAILABLE;
255 if (f->subclass == 'D') {
257 ast_log(LOG_DEBUG, "Off-hook capable CPE only, not ADSI\n");
259 ast_log(LOG_WARNING, "Unknown ADSI response '%c'\n", f->subclass);
261 chan->adsicpe = AST_ADSI_UNAVAILABLE;
270 ast_log(LOG_DEBUG, "ADSI Compatible CPE Detected\n");
273 ast_log(LOG_DEBUG, "Already in data mode\n");
279 def= ast_channel_defer_dtmf(chan);
281 while((x < 6) && msg[x]) {
282 res = adsi_generate(buf + pos, msgtype[x], msg[x], msglen[x], x+1 - start, (x == 5) || !msg[x+1], AST_FORMAT_ULAW);
284 ast_log(LOG_WARNING, "Failed to generate ADSI message %d on channel %s\n", x + 1, chan->name);
288 ast_log(LOG_DEBUG, "Message %d, of %d input bytes, %d output bytes\n",
289 x + 1, msglen[x], res);
296 res = adsi_careful_send(chan, buf, pos, &rem);
298 ast_channel_undefer_dtmf(chan);
303 ast_log(LOG_DEBUG, "Sent total spill of %d bytes\n", pos);
305 memset(ack, 0, sizeof(ack));
306 /* Get real result */
307 res = ast_readstring(chan, ack, 2, 1000, 1000, "");
308 /* Check for hangup */
313 ast_log(LOG_DEBUG, "Acked up to message %d\n", atoi(ack + 1));
314 start += atoi(ack + 1);
320 ast_log(LOG_DEBUG, "Retransmitting (%d), from %d\n", retries, start + 1);
324 ast_log(LOG_WARNING, "Unexpected response to ack: %s (retry %d)\n", ack, retries);
327 if (retries >= maxretries) {
328 ast_log(LOG_WARNING, "Maximum ADSI Retries (%d) exceeded\n", maxretries);
336 int ast_adsi_begin_download(struct ast_channel *chan, char *service, unsigned char *fdn, unsigned char *sec, int version)
339 unsigned char buf[256];
342 /* Setup the resident soft key stuff, a piece at a time */
343 /* Upload what scripts we can for voicemail ahead of time */
344 bytes += ast_adsi_download_connect(buf + bytes, service, fdn, sec, version);
345 if (ast_adsi_transmit_message_full(chan, buf, bytes, ADSI_MSG_DOWNLOAD, 0))
347 if (ast_readstring(chan, ack, 1, 10000, 10000, ""))
352 ast_log(LOG_DEBUG, "Download was denied by CPE\n");
356 int ast_adsi_end_download(struct ast_channel *chan)
359 unsigned char buf[256];
361 /* Setup the resident soft key stuff, a piece at a time */
362 /* Upload what scripts we can for voicemail ahead of time */
363 bytes += ast_adsi_download_disconnect(buf + bytes);
364 if (ast_adsi_transmit_message_full(chan, buf, bytes, ADSI_MSG_DOWNLOAD, 0))
369 int ast_adsi_transmit_message_full(struct ast_channel *chan, unsigned char *msg, int msglen, int msgtype, int dowait)
371 unsigned char *msgs[5] = { NULL, NULL, NULL, NULL, NULL };
377 int writeformat, readformat;
378 int waitforswitch = 0;
380 writeformat = chan->writeformat;
381 readformat = chan->readformat;
383 newdatamode = chan->adsicpe & ADSI_FLAG_DATAMODE;
385 for (x=0;x<msglen;x+=(msg[x+1]+2)) {
386 if (msg[x] == ADSI_SWITCH_TO_DATA) {
388 ast_log(LOG_DEBUG, "Switch to data is sent!\n");
390 newdatamode = ADSI_FLAG_DATAMODE;
393 if (msg[x] == ADSI_SWITCH_TO_VOICE) {
395 ast_log(LOG_DEBUG, "Switch to voice is sent!\n");
403 msgtypes[0] = msgtype;
406 ast_log(LOG_WARNING, "Can't send ADSI message of %d bytes, too large\n", msglen);
410 ast_stopstream(chan);
412 if (ast_set_write_format(chan, AST_FORMAT_ULAW)) {
413 ast_log(LOG_WARNING, "Unable to set write format to ULAW\n");
417 if (ast_set_read_format(chan, AST_FORMAT_ULAW)) {
418 ast_log(LOG_WARNING, "Unable to set read format to ULAW\n");
420 if (ast_set_write_format(chan, writeformat))
421 ast_log(LOG_WARNING, "Unable to restore write format to %d\n", writeformat);
425 res = __adsi_transmit_messages(chan, msgs, msglens, msgtypes);
429 ast_log(LOG_DEBUG, "Wait for switch is '%d'\n", waitforswitch);
430 while (waitforswitch-- && ((res = ast_waitfordigit(chan, 1000)) > 0)) {
433 ast_log(LOG_DEBUG, "Waiting for 'B'...\n");
438 chan->adsicpe = (chan->adsicpe & ~ADSI_FLAG_DATAMODE) | newdatamode;
441 ast_set_write_format(chan, writeformat);
443 ast_set_read_format(chan, readformat);
446 res = ast_safe_sleep(chan, 100 );
450 int ast_adsi_transmit_message(struct ast_channel *chan, unsigned char *msg, int msglen, int msgtype)
452 return ast_adsi_transmit_message_full(chan, msg, msglen, msgtype, 1);
455 static inline int ccopy(unsigned char *dst, const unsigned char *src, int max)
458 /* Carefully copy the requested data */
459 while ((x < max) && src[x] && (src[x] != 0xff)) {
466 int ast_adsi_load_soft_key(unsigned char *buf, int key, const char *llabel, const char *slabel, const char *ret, int data)
470 /* Abort if invalid key specified */
471 if ((key < 2) || (key > 33))
473 buf[bytes++] = ADSI_LOAD_SOFTKEY;
474 /* Reserve for length */
479 /* Carefully copy long label */
480 bytes += ccopy(buf + bytes, (const unsigned char *)llabel, 18);
482 /* Place delimiter */
486 bytes += ccopy(buf + bytes, (const unsigned char *)slabel, 7);
489 /* If specified, copy return string */
491 /* Place delimiter */
494 buf[bytes++] = ADSI_SWITCH_TO_DATA2;
495 /* Carefully copy return string */
496 bytes += ccopy(buf + bytes, (const unsigned char *)ret, 20);
499 /* Replace parameter length */
505 int ast_adsi_connect_session(unsigned char *buf, unsigned char *fdn, int ver)
511 buf[bytes++] = ADSI_CONNECT_SESSION;
513 /* Reserve space for length */
518 buf[bytes++] = fdn[x];
520 buf[bytes++] = ver & 0xff;
528 int ast_adsi_download_connect(unsigned char *buf, char *service, unsigned char *fdn, unsigned char *sec, int ver)
534 buf[bytes++] = ADSI_DOWNLOAD_CONNECT;
536 /* Reserve space for length */
540 bytes+= ccopy(buf + bytes, (unsigned char *)service, 18);
546 buf[bytes++] = fdn[x];
549 buf[bytes++] = sec[x];
550 buf[bytes++] = ver & 0xff;
558 int ast_adsi_disconnect_session(unsigned char *buf)
563 buf[bytes++] = ADSI_DISC_SESSION;
565 /* Reserve space for length */
573 int ast_adsi_query_cpeid(unsigned char *buf)
576 buf[bytes++] = ADSI_QUERY_CPEID;
577 /* Reserve space for length */
583 int ast_adsi_query_cpeinfo(unsigned char *buf)
586 buf[bytes++] = ADSI_QUERY_CONFIG;
587 /* Reserve space for length */
593 int ast_adsi_read_encoded_dtmf(struct ast_channel *chan, unsigned char *buf, int maxlen)
597 unsigned char current = 0;
600 memset(buf, 0, sizeof(buf));
601 while(bytes <= maxlen) {
602 /* Wait up to a second for a digit */
603 res = ast_waitfordigit(chan, 1000);
610 /* Ignore anything other than a digit */
611 if ((res < '0') || (res > '9'))
618 buf[bytes++] = (res << 4) | current;
628 int ast_adsi_get_cpeid(struct ast_channel *chan, unsigned char *cpeid, int voice)
630 unsigned char buf[256];
633 bytes += ast_adsi_data_mode(buf);
634 ast_adsi_transmit_message_full(chan, buf, bytes, ADSI_MSG_DISPLAY, 0);
637 bytes += ast_adsi_query_cpeid(buf);
638 ast_adsi_transmit_message_full(chan, buf, bytes, ADSI_MSG_DISPLAY, 0);
641 memset(buf, 0, sizeof(buf));
642 res = ast_adsi_read_encoded_dtmf(chan, cpeid, 4);
644 ast_log(LOG_WARNING, "Got %d bytes back of encoded DTMF, expecting 4\n", res);
652 bytes += ast_adsi_voice_mode(buf, 0);
653 ast_adsi_transmit_message_full(chan, buf, bytes, ADSI_MSG_DISPLAY, 0);
654 /* Ignore the resulting DTMF B announcing it's in voice mode */
655 ast_waitfordigit(chan, 1000);
660 int ast_adsi_get_cpeinfo(struct ast_channel *chan, int *width, int *height, int *buttons, int voice)
662 unsigned char buf[256];
665 bytes += ast_adsi_data_mode(buf);
666 ast_adsi_transmit_message_full(chan, buf, bytes, ADSI_MSG_DISPLAY, 0);
669 bytes += ast_adsi_query_cpeinfo(buf);
670 ast_adsi_transmit_message_full(chan, buf, bytes, ADSI_MSG_DISPLAY, 0);
673 memset(buf, 0, sizeof(buf));
674 res = ast_readstring(chan, (char *)buf, 2, 1000, 500, "");
677 if (strlen((char *)buf) != 2) {
678 ast_log(LOG_WARNING, "Got %d bytes of width, expecting 2\n", res);
684 *width = atoi((char *)buf);
686 memset(buf, 0, sizeof(buf));
688 res = ast_readstring(chan, (char *)buf, 2, 1000, 500, "");
691 if (strlen((char *)buf) != 2) {
692 ast_log(LOG_WARNING, "Got %d bytes of height, expecting 2\n", res);
698 *height= atoi((char *)buf);
701 memset(buf, 0, sizeof(buf));
703 res = ast_readstring(chan, (char *)buf, 1, 1000, 500, "");
706 if (strlen((char *)buf) != 1) {
707 ast_log(LOG_WARNING, "Got %d bytes of buttons, expecting 1\n", res);
713 *buttons = atoi((char *)buf);
717 bytes += ast_adsi_voice_mode(buf, 0);
718 ast_adsi_transmit_message_full(chan, buf, bytes, ADSI_MSG_DISPLAY, 0);
719 /* Ignore the resulting DTMF B announcing it's in voice mode */
720 ast_waitfordigit(chan, 1000);
725 int ast_adsi_data_mode(unsigned char *buf)
730 buf[bytes++] = ADSI_SWITCH_TO_DATA;
732 /* Reserve space for length */
740 int ast_adsi_clear_soft_keys(unsigned char *buf)
745 buf[bytes++] = ADSI_CLEAR_SOFTKEY;
747 /* Reserve space for length */
755 int ast_adsi_clear_screen(unsigned char *buf)
760 buf[bytes++] = ADSI_CLEAR_SCREEN;
762 /* Reserve space for length */
770 int ast_adsi_voice_mode(unsigned char *buf, int when)
775 buf[bytes++] = ADSI_SWITCH_TO_VOICE;
777 /* Reserve space for length */
780 buf[bytes++] = when & 0x7f;
787 int ast_adsi_available(struct ast_channel *chan)
789 int cpe = chan->adsicpe & 0xff;
790 if ((cpe == AST_ADSI_AVAILABLE) ||
791 (cpe == AST_ADSI_UNKNOWN))
796 int ast_adsi_download_disconnect(unsigned char *buf)
801 buf[bytes++] = ADSI_DOWNLOAD_DISC;
803 /* Reserve space for length */
811 int ast_adsi_display(unsigned char *buf, int page, int line, int just, int wrap,
812 char *col1, char *col2)
816 /* Sanity check line number */
819 if (line > 4) return -1;
821 if (line > 33) return -1;
827 buf[bytes++] = ADSI_LOAD_VIRTUAL_DISP;
829 /* Reserve space for size */
832 /* Page and wrap indicator */
833 buf[bytes++] = ((page & 0x1) << 7) | ((wrap & 0x1) << 6) | (line & 0x3f);
836 buf[bytes++] = (just & 0x3) << 5;
838 /* Omit highlight mode definition */
842 bytes+= ccopy(buf + bytes, (unsigned char *)col1, 20);
847 /* Secondary column */
848 bytes += ccopy(buf + bytes, (unsigned char *)col2, 20);
857 int ast_adsi_input_control(unsigned char *buf, int page, int line, int display, int format, int just)
862 if (line > 4) return -1;
864 if (line > 33) return -1;
870 buf[bytes++] = ADSI_INPUT_CONTROL;
872 buf[bytes++] = ((page & 1) << 7) | (line & 0x3f);
873 buf[bytes++] = ((display & 1) << 7) | ((just & 0x3) << 4) | (format & 0x7);
880 int ast_adsi_input_format(unsigned char *buf, int num, int dir, int wrap, char *format1, char *format2)
884 if (!strlen((char *)format1))
887 buf[bytes++] = ADSI_INPUT_FORMAT;
889 buf[bytes++] = ((dir & 1) << 7) | ((wrap & 1) << 6) | (num & 0x7);
890 bytes += ccopy(buf + bytes, (unsigned char *)format1, 20);
892 if (format2 && strlen((char *)format2)) {
893 bytes += ccopy(buf + bytes, (unsigned char *)format2, 20);
899 int ast_adsi_set_keys(unsigned char *buf, unsigned char *keys)
904 buf[bytes++] = ADSI_INIT_SOFTKEY_LINE;
907 /* Key definitions */
909 buf[bytes++] = (keys[x] & 0x3f) ? keys[x] : (keys[x] | 0x1);
914 int ast_adsi_set_line(unsigned char *buf, int page, int line)
918 /* Sanity check line number */
921 if (line > 4) return -1;
923 if (line > 33) return -1;
929 buf[bytes++] = ADSI_LINE_CONTROL;
931 /* Reserve space for size */
935 buf[bytes++] = ((page & 0x1) << 7) | (line & 0x3f);
942 static int total = 0;
943 static int speeds = 0;
945 int ast_adsi_channel_restore(struct ast_channel *chan)
947 unsigned char dsp[256];
950 unsigned char keyd[6];
952 memset(dsp, 0, sizeof(dsp));
954 /* Start with initial display setup */
956 bytes += ast_adsi_set_line(dsp + bytes, ADSI_INFO_PAGE, 1);
958 /* Prepare key setup messages */
961 memset(keyd, 0, sizeof(keyd));
962 for (x=0;x<speeds;x++) {
963 keyd[x] = ADSI_SPEED_DIAL + x;
965 bytes += ast_adsi_set_keys(dsp + bytes, keyd);
967 ast_adsi_transmit_message_full(chan, dsp, bytes, ADSI_MSG_DISPLAY, 0);
972 int ast_adsi_print(struct ast_channel *chan, char **lines, int *aligns, int voice)
974 unsigned char buf[4096];
978 for(x=0;lines[x];x++)
979 bytes += ast_adsi_display(buf + bytes, ADSI_INFO_PAGE, x+1, aligns[x], 0, lines[x], "");
980 bytes += ast_adsi_set_line(buf + bytes, ADSI_INFO_PAGE, 1);
982 bytes += ast_adsi_voice_mode(buf + bytes, 0);
984 res = ast_adsi_transmit_message_full(chan, buf, bytes, ADSI_MSG_DISPLAY, 0);
986 /* Ignore the resulting DTMF B announcing it's in voice mode */
987 ast_waitfordigit(chan, 1000);
992 int ast_adsi_load_session(struct ast_channel *chan, unsigned char *app, int ver, int data)
994 unsigned char dsp[256];
999 memset(dsp, 0, sizeof(dsp));
1001 /* Connect to session */
1003 bytes += ast_adsi_connect_session(dsp + bytes, app, ver);
1006 bytes += ast_adsi_data_mode(dsp + bytes);
1008 /* Prepare key setup messages */
1009 if (ast_adsi_transmit_message_full(chan, dsp, bytes, ADSI_MSG_DISPLAY, 0))
1012 res = ast_readstring(chan, resp, 1, 1200, 1200, "");
1017 ast_log(LOG_DEBUG, "No response from CPE about version. Assuming not there.\n");
1020 if (!strcmp(resp, "B")) {
1022 ast_log(LOG_DEBUG, "CPE has script '%s' version %d already loaded\n", app, ver);
1024 } else if (!strcmp(resp, "A")) {
1026 ast_log(LOG_DEBUG, "CPE hasn't script '%s' version %d already loaded\n", app, ver);
1028 ast_log(LOG_WARNING, "Unexpected CPE response to script query: %s\n", resp);
1036 int ast_adsi_unload_session(struct ast_channel *chan)
1038 unsigned char dsp[256];
1041 memset(dsp, 0, sizeof(dsp));
1043 /* Connect to session */
1045 bytes += ast_adsi_disconnect_session(dsp + bytes);
1046 bytes += ast_adsi_voice_mode(dsp + bytes, 0);
1048 /* Prepare key setup messages */
1049 if (ast_adsi_transmit_message_full(chan, dsp, bytes, ADSI_MSG_DISPLAY, 0))
1054 static int str2align(char *s)
1056 if (!strncasecmp(s, "l", 1))
1057 return ADSI_JUST_LEFT;
1058 else if (!strncasecmp(s, "r", 1))
1059 return ADSI_JUST_RIGHT;
1060 else if (!strncasecmp(s, "i", 1))
1061 return ADSI_JUST_IND;
1063 return ADSI_JUST_CENT;
1066 static void init_state(void)
1070 for (x=0;x<ADSI_MAX_INTRO;x++)
1071 aligns[x] = ADSI_JUST_CENT;
1072 ast_copy_string(intro[0], "Welcome to the", sizeof(intro[0]));
1073 ast_copy_string(intro[1], "Asterisk", sizeof(intro[1]));
1074 ast_copy_string(intro[2], "Open Source PBX", sizeof(intro[2]));
1077 for (x=3;x<ADSI_MAX_INTRO;x++)
1079 memset(speeddial, 0, sizeof(speeddial));
1080 alignment = ADSI_JUST_CENT;
1083 static void adsi_load(void)
1086 struct ast_config *conf;
1087 struct ast_variable *v;
1090 conf = ast_config_load("adsi.conf");
1093 for (v = ast_variable_browse(conf, "intro"); v; v = v->next) {
1094 if (!strcasecmp(v->name, "alignment"))
1095 alignment = str2align(v->value);
1096 else if (!strcasecmp(v->name, "greeting")) {
1097 if (x < ADSI_MAX_INTRO) {
1098 aligns[x] = alignment;
1099 ast_copy_string(intro[x], v->value, sizeof(intro[x]));
1102 } else if (!strcasecmp(v->name, "maxretries")) {
1103 if (atoi(v->value) > 0)
1104 maxretries = atoi(v->value);
1110 for (v = ast_variable_browse(conf, "speeddial"); v; v = v->next) {
1111 char *stringp = v->value;
1112 name = strsep(&stringp, ",");
1113 sname = strsep(&stringp, ",");
1116 if (x < ADSI_MAX_SPEED_DIAL) {
1117 ast_copy_string(speeddial[x][0], v->name, sizeof(speeddial[x][0]));
1118 ast_copy_string(speeddial[x][1], name, 18);
1119 ast_copy_string(speeddial[x][2], sname, 7);
1125 ast_config_destroy(conf);
1129 static int reload(void)
1135 static int load_module(void)
1141 static int unload_module(void)
1143 /* Can't unload this once we're loaded */
1147 AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS, "ADSI Resource",
1148 .load = load_module,
1149 .unload = unload_module,