Avoid cppcheck warnings; removing unused vars and a bit of cleanup.
[asterisk/asterisk.git] / codecs / codec_dahdi.c
1 /*
2  * Asterisk -- An open source telephony toolkit.
3  *
4  * DAHDI native transcoding support
5  *
6  * Copyright (C) 1999 - 2008, Digium, Inc.
7  *
8  * Mark Spencer <markster@digium.com>
9  * Kevin P. Fleming <kpfleming@digium.com>
10  *
11  * See http://www.asterisk.org for more information about
12  * the Asterisk project. Please do not directly contact
13  * any of the maintainers of this project for assistance;
14  * the project provides a web site, mailing lists and IRC
15  * channels for your use.
16  *
17  * This program is free software, distributed under the terms of
18  * the GNU General Public License Version 2. See the LICENSE file
19  * at the top of the source tree.
20  */
21
22 /*! \file
23  *
24  * \brief Translate between various formats natively through DAHDI transcoding
25  *
26  * \ingroup codecs
27  */
28
29 /*** MODULEINFO
30         <depend>dahdi</depend>
31  ***/
32
33 #include "asterisk.h"
34
35 ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
36
37 #include <fcntl.h>
38 #include <netinet/in.h>
39 #include <sys/ioctl.h>
40 #include <sys/mman.h>
41 #include <sys/poll.h>
42 #include <dahdi/user.h>
43
44 #include "asterisk/lock.h"
45 #include "asterisk/translate.h"
46 #include "asterisk/config.h"
47 #include "asterisk/module.h"
48 #include "asterisk/cli.h"
49 #include "asterisk/channel.h"
50 #include "asterisk/utils.h"
51 #include "asterisk/linkedlists.h"
52 #include "asterisk/ulaw.h"
53
54 #define BUFFER_SIZE 8000
55
56 #define G723_SAMPLES 240
57 #define G729_SAMPLES 160
58
59 #ifndef DAHDI_FORMAT_MAX_AUDIO
60 #define DAHDI_FORMAT_G723_1    (1 << 0)
61 #define DAHDI_FORMAT_GSM       (1 << 1)
62 #define DAHDI_FORMAT_ULAW      (1 << 2)
63 #define DAHDI_FORMAT_ALAW      (1 << 3)
64 #define DAHDI_FORMAT_G726      (1 << 4)
65 #define DAHDI_FORMAT_ADPCM     (1 << 5)
66 #define DAHDI_FORMAT_SLINEAR   (1 << 6)
67 #define DAHDI_FORMAT_LPC10     (1 << 7)
68 #define DAHDI_FORMAT_G729A     (1 << 8)
69 #define DAHDI_FORMAT_SPEEX     (1 << 9)
70 #define DAHDI_FORMAT_ILBC      (1 << 10)
71 #endif
72
73 static struct channel_usage {
74         int total;
75         int encoders;
76         int decoders;
77 } channels;
78
79 static char *handle_cli_transcoder_show(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a);
80
81 static struct ast_cli_entry cli[] = {
82         AST_CLI_DEFINE(handle_cli_transcoder_show, "Display DAHDI transcoder utilization.")
83 };
84
85 struct format_map {
86         unsigned int map[32][32];
87 };
88
89 static struct format_map global_format_map = { { { 0 } } };
90
91 struct translator {
92         struct ast_translator t;
93         AST_LIST_ENTRY(translator) entry;
94 };
95
96 static AST_LIST_HEAD_STATIC(translators, translator);
97
98 struct codec_dahdi_pvt {
99         int fd;
100         struct dahdi_transcoder_formats fmts;
101         unsigned int softslin:1;
102         unsigned int fake:2;
103         uint16_t required_samples;
104         uint16_t samples_in_buffer;
105         uint8_t ulaw_buffer[1024];
106 };
107
108 /* Only used by a decoder */
109 static int ulawtolin(struct ast_trans_pvt *pvt, int samples)
110 {
111         struct codec_dahdi_pvt *dahdip = pvt->pvt;
112         int i = samples;
113         uint8_t *src = &dahdip->ulaw_buffer[0];
114         int16_t *dst = pvt->outbuf.i16 + pvt->datalen;
115
116         /* convert and copy in outbuf */
117         while (i--) {
118                 *dst++ = AST_MULAW(*src++);
119         }
120
121         return 0;
122 }
123
124 /* Only used by an encoder. */
125 static int lintoulaw(struct ast_trans_pvt *pvt, struct ast_frame *f)
126 {
127         struct codec_dahdi_pvt *dahdip = pvt->pvt;
128         int i = f->samples;
129         uint8_t *dst = &dahdip->ulaw_buffer[dahdip->samples_in_buffer];
130         int16_t *src = f->data.ptr;
131
132         if (dahdip->samples_in_buffer + i > sizeof(dahdip->ulaw_buffer)) {
133                 ast_log(LOG_ERROR, "Out of buffer space!\n");
134                 return -i;
135         }
136
137         while (i--) {
138                 *dst++ = AST_LIN2MU(*src++);
139         }
140
141         dahdip->samples_in_buffer += f->samples;
142         return 0;
143 }
144
145 static char *handle_cli_transcoder_show(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
146 {
147         struct channel_usage copy;
148
149         switch (cmd) {
150         case CLI_INIT:
151                 e->command = "transcoder show";
152                 e->usage =
153                         "Usage: transcoder show\n"
154                         "       Displays channel utilization of DAHDI transcoder(s).\n";
155                 return NULL;
156         case CLI_GENERATE:
157                 return NULL;
158         }
159
160         if (a->argc != 2)
161                 return CLI_SHOWUSAGE;
162
163         copy = channels;
164
165         if (copy.total == 0)
166                 ast_cli(a->fd, "No DAHDI transcoders found.\n");
167         else
168                 ast_cli(a->fd, "%d/%d encoders/decoders of %d channels are in use.\n", copy.encoders, copy.decoders, copy.total);
169
170         return CLI_SUCCESS;
171 }
172
173 static void dahdi_write_frame(struct codec_dahdi_pvt *dahdip, const uint8_t *buffer, const ssize_t count)
174 {
175         int res;
176         struct pollfd p = {0};
177         if (!count) return;
178         res = write(dahdip->fd, buffer, count);
179         if (-1 == res) {
180                 ast_log(LOG_ERROR, "Failed to write to transcoder: %s\n", strerror(errno));
181         }
182         if (count != res) {
183                 ast_log(LOG_ERROR, "Requested write of %zd bytes, but only wrote %d bytes.\n", count, res);
184         }
185         p.fd = dahdip->fd;
186         p.events = POLLOUT;
187         res = poll(&p, 1, 50);
188 }
189
190 static int dahdi_encoder_framein(struct ast_trans_pvt *pvt, struct ast_frame *f)
191 {
192         struct codec_dahdi_pvt *dahdip = pvt->pvt;
193
194         if (!f->subclass.format.id) {
195                 /* We're just faking a return for calculation purposes. */
196                 dahdip->fake = 2;
197                 pvt->samples = f->samples;
198                 return 0;
199         }
200
201         /* Buffer up the packets and send them to the hardware if we
202          * have enough samples set up. */
203         if (dahdip->softslin) {
204                 if (lintoulaw(pvt, f)) {
205                          return -1;
206                 }
207         } else {
208                 /* NOTE:  If softslin support is not needed, and the sample
209                  * size is equal to the required sample size, we wouldn't
210                  * need this copy operation.  But at the time this was
211                  * written, only softslin is supported. */
212                 if (dahdip->samples_in_buffer + f->samples > sizeof(dahdip->ulaw_buffer)) {
213                         ast_log(LOG_ERROR, "Out of buffer space.\n");
214                         return -1;
215                 }
216                 memcpy(&dahdip->ulaw_buffer[dahdip->samples_in_buffer], f->data.ptr, f->samples);
217                 dahdip->samples_in_buffer += f->samples;
218         }
219
220         while (dahdip->samples_in_buffer > dahdip->required_samples) {
221                 dahdi_write_frame(dahdip, dahdip->ulaw_buffer, dahdip->required_samples);
222                 dahdip->samples_in_buffer -= dahdip->required_samples;
223                 if (dahdip->samples_in_buffer) {
224                         /* Shift any remaining bytes down. */
225                         memmove(dahdip->ulaw_buffer, &dahdip->ulaw_buffer[dahdip->required_samples],
226                                 dahdip->samples_in_buffer);
227                 }
228         }
229         pvt->samples += f->samples;
230         pvt->datalen = 0;
231         return -1;
232 }
233
234 static struct ast_frame *dahdi_encoder_frameout(struct ast_trans_pvt *pvt)
235 {
236         struct codec_dahdi_pvt *dahdip = pvt->pvt;
237         int res;
238
239         if (2 == dahdip->fake) {
240                 dahdip->fake = 1;
241                 pvt->f.frametype = AST_FRAME_VOICE;
242                 ast_format_clear(&pvt->f.subclass.format);
243                 pvt->f.samples = dahdip->required_samples;
244                 pvt->f.data.ptr = NULL;
245                 pvt->f.offset = 0;
246                 pvt->f.datalen = 0;
247                 pvt->f.mallocd = 0;
248                 pvt->samples = 0;
249
250                 return ast_frisolate(&pvt->f);
251
252         } else if (1 == dahdip->fake) {
253                 dahdip->fake = 0;
254                 return NULL;
255         }
256
257         res = read(dahdip->fd, pvt->outbuf.c + pvt->datalen, pvt->t->buf_size - pvt->datalen);
258         if (-1 == res) {
259                 if (EWOULDBLOCK == errno) {
260                         /* Nothing waiting... */
261                         return NULL;
262                 } else {
263                         ast_log(LOG_ERROR, "Failed to read from transcoder: %s\n", strerror(errno));
264                         return NULL;
265                 }
266         } else {
267                 pvt->f.datalen = res;
268                 pvt->f.frametype = AST_FRAME_VOICE;
269                 ast_format_copy(&pvt->f.subclass.format, &pvt->t->dst_format);
270                 pvt->f.mallocd = 0;
271                 pvt->f.offset = AST_FRIENDLY_OFFSET;
272                 pvt->f.src = pvt->t->name;
273                 pvt->f.data.ptr = pvt->outbuf.c;
274                 pvt->f.samples = ast_codec_get_samples(&pvt->f);
275
276                 pvt->samples = 0;
277                 pvt->datalen = 0;
278                 return ast_frisolate(&pvt->f);
279         }
280
281         /* Shouldn't get here... */
282         return NULL;
283 }
284
285 static int dahdi_decoder_framein(struct ast_trans_pvt *pvt, struct ast_frame *f)
286 {
287         struct codec_dahdi_pvt *dahdip = pvt->pvt;
288
289         if (!f->subclass.format.id) {
290                 /* We're just faking a return for calculation purposes. */
291                 dahdip->fake = 2;
292                 pvt->samples = f->samples;
293                 return 0;
294         }
295
296         if (!f->datalen) {
297                 if (f->samples != dahdip->required_samples) {
298                         ast_log(LOG_ERROR, "%d != %d %d\n", f->samples, dahdip->required_samples, f->datalen);
299                 }
300         }
301         dahdi_write_frame(dahdip, f->data.ptr, f->datalen);
302         pvt->samples += f->samples;
303         pvt->datalen = 0;
304         return -1;
305 }
306
307 static struct ast_frame *dahdi_decoder_frameout(struct ast_trans_pvt *pvt)
308 {
309         int res;
310         struct codec_dahdi_pvt *dahdip = pvt->pvt;
311
312         if (2 == dahdip->fake) {
313                 dahdip->fake = 1;
314                 pvt->f.frametype = AST_FRAME_VOICE;
315                 ast_format_clear(&pvt->f.subclass.format);
316                 pvt->f.samples = dahdip->required_samples;
317                 pvt->f.data.ptr = NULL;
318                 pvt->f.offset = 0;
319                 pvt->f.datalen = 0;
320                 pvt->f.mallocd = 0;
321                 pvt->samples = 0;
322                 return ast_frisolate(&pvt->f);
323         } else if (1 == dahdip->fake) {
324                 pvt->samples = 0;
325                 dahdip->fake = 0;
326                 return NULL;
327         }
328
329         /* Let's check to see if there is a new frame for us.... */
330         if (dahdip->softslin) {
331                 res = read(dahdip->fd, dahdip->ulaw_buffer, sizeof(dahdip->ulaw_buffer));
332         } else {
333                 res = read(dahdip->fd, pvt->outbuf.c + pvt->datalen, pvt->t->buf_size - pvt->datalen);
334         }
335
336         if (-1 == res) {
337                 if (EWOULDBLOCK == errno) {
338                         /* Nothing waiting... */
339                         return NULL;
340                 } else {
341                         ast_log(LOG_ERROR, "Failed to read from transcoder: %s\n", strerror(errno));
342                         return NULL;
343                 }
344         } else {
345                 if (dahdip->softslin) {
346                         ulawtolin(pvt, res);
347                         pvt->f.datalen = res * 2;
348                 } else {
349                         pvt->f.datalen = res;
350                 }
351                 pvt->datalen = 0;
352                 pvt->f.frametype = AST_FRAME_VOICE;
353                 ast_format_copy(&pvt->f.subclass.format, &pvt->t->dst_format);
354                 pvt->f.mallocd = 0;
355                 pvt->f.offset = AST_FRIENDLY_OFFSET;
356                 pvt->f.src = pvt->t->name;
357                 pvt->f.data.ptr = pvt->outbuf.c;
358                 pvt->f.samples = res;
359                 pvt->samples = 0;
360
361                 return ast_frisolate(&pvt->f);
362         }
363
364         /* Shouldn't get here... */
365         return NULL;
366 }
367
368
369 static void dahdi_destroy(struct ast_trans_pvt *pvt)
370 {
371         struct codec_dahdi_pvt *dahdip = pvt->pvt;
372
373         switch (dahdip->fmts.dstfmt) {
374         case AST_FORMAT_G729A:
375         case AST_FORMAT_G723_1:
376                 ast_atomic_fetchadd_int(&channels.encoders, -1);
377                 break;
378         default:
379                 ast_atomic_fetchadd_int(&channels.decoders, -1);
380                 break;
381         }
382
383         close(dahdip->fd);
384 }
385
386 static int dahdi_translate(struct ast_trans_pvt *pvt, struct ast_format *dst_format, struct ast_format *src_format)
387 {
388         /* Request translation through zap if possible */
389         int fd;
390         struct codec_dahdi_pvt *dahdip = pvt->pvt;
391         int flags;
392         int tried_once = 0;
393         const char *dev_filename = "/dev/dahdi/transcode";
394
395         if ((fd = open(dev_filename, O_RDWR)) < 0) {
396                 ast_log(LOG_ERROR, "Failed to open %s: %s\n", dev_filename, strerror(errno));
397                 return -1;
398         }
399
400         dahdip->fmts.srcfmt = ast_format_to_old_bitfield(src_format);
401         dahdip->fmts.dstfmt = ast_format_to_old_bitfield(dst_format);
402
403         ast_debug(1, "Opening transcoder channel from %s to %s.\n", ast_getformatname(src_format), ast_getformatname(dst_format));
404
405 retry:
406         if (ioctl(fd, DAHDI_TC_ALLOCATE, &dahdip->fmts)) {
407                 if ((ENODEV == errno) && !tried_once) {
408                         /* We requested to translate to/from an unsupported
409                          * format.  Most likely this is because signed linear
410                          * was not supported by any hardware devices even
411                          * though this module always registers signed linear
412                          * support. In this case we'll retry, requesting
413                          * support for ULAW instead of signed linear and then
414                          * we'll just convert from ulaw to signed linear in
415                          * software. */
416                         if (AST_FORMAT_SLINEAR == ast_format_id_from_old_bitfield(dahdip->fmts.srcfmt)) {
417                                 ast_debug(1, "Using soft_slin support on source\n");
418                                 dahdip->softslin = 1;
419                                 dahdip->fmts.srcfmt = ast_format_id_to_old_bitfield(AST_FORMAT_ULAW);
420                         } else if (AST_FORMAT_SLINEAR == ast_format_id_from_old_bitfield(dahdip->fmts.dstfmt)) {
421                                 ast_debug(1, "Using soft_slin support on destination\n");
422                                 dahdip->softslin = 1;
423                                 dahdip->fmts.dstfmt = ast_format_id_to_old_bitfield(AST_FORMAT_ULAW);
424                         }
425                         tried_once = 1;
426                         goto retry;
427                 }
428                 ast_log(LOG_ERROR, "Unable to attach to transcoder: %s\n", strerror(errno));
429                 close(fd);
430
431                 return -1;
432         }
433
434         flags = fcntl(fd, F_GETFL);
435         if (flags > - 1) {
436                 if (fcntl(fd, F_SETFL, flags | O_NONBLOCK))
437                         ast_log(LOG_WARNING, "Could not set non-block mode!\n");
438         }
439
440         dahdip->fd = fd;
441
442         dahdip->required_samples = ((dahdip->fmts.dstfmt|dahdip->fmts.srcfmt) & (ast_format_id_to_old_bitfield(AST_FORMAT_G723_1))) ? G723_SAMPLES : G729_SAMPLES;
443
444         switch (ast_format_id_from_old_bitfield(dahdip->fmts.dstfmt)) {
445         case AST_FORMAT_G729A:
446                 ast_atomic_fetchadd_int(&channels.encoders, +1);
447                 break;
448         case AST_FORMAT_G723_1:
449                 ast_atomic_fetchadd_int(&channels.encoders, +1);
450                 break;
451         default:
452                 ast_atomic_fetchadd_int(&channels.decoders, +1);
453                 break;
454         }
455
456         return 0;
457 }
458
459 static int dahdi_new(struct ast_trans_pvt *pvt)
460 {
461         return dahdi_translate(pvt,
462                 &pvt->t->dst_format,
463                 &pvt->t->src_format);
464 }
465
466 static struct ast_frame *fakesrc_sample(void)
467 {
468         /* Don't bother really trying to test hardware ones. */
469         static struct ast_frame f = {
470                 .frametype = AST_FRAME_VOICE,
471                 .samples = 160,
472                 .src = __PRETTY_FUNCTION__
473         };
474
475         return &f;
476 }
477
478 static int is_encoder(struct translator *zt)
479 {
480         if ((zt->t.src_format.id == AST_FORMAT_ULAW) ||
481                 (zt->t.src_format.id == AST_FORMAT_ALAW) ||
482                 (zt->t.src_format.id == AST_FORMAT_SLINEAR)) {
483                 return 1;
484         } else {
485                 return 0;
486         }
487 }
488
489 static int register_translator(int dst, int src)
490 {
491         struct translator *zt;
492         int res;
493         struct ast_format dst_format;
494         struct ast_format src_format;
495
496         ast_format_from_old_bitfield(&dst_format, (1 << dst));
497         ast_format_from_old_bitfield(&src_format, (1 << src));
498
499         if (!(zt = ast_calloc(1, sizeof(*zt)))) {
500                 return -1;
501         }
502
503         snprintf((char *) (zt->t.name), sizeof(zt->t.name), "zap%sto%s",
504                  ast_getformatname(&src_format), ast_getformatname(&dst_format));
505         ast_format_copy(&zt->t.src_format, &src_format);
506         ast_format_copy(&zt->t.dst_format, &dst_format);
507         zt->t.buf_size = BUFFER_SIZE;
508         if (is_encoder(zt)) {
509                 zt->t.framein = dahdi_encoder_framein;
510                 zt->t.frameout = dahdi_encoder_frameout;
511         } else {
512                 zt->t.framein = dahdi_decoder_framein;
513                 zt->t.frameout = dahdi_decoder_frameout;
514         }
515         zt->t.destroy = dahdi_destroy;
516         zt->t.buffer_samples = 0;
517         zt->t.newpvt = dahdi_new;
518         zt->t.sample = fakesrc_sample;
519         zt->t.native_plc = 0;
520
521         zt->t.desc_size = sizeof(struct codec_dahdi_pvt);
522         if ((res = ast_register_translator(&zt->t))) {
523                 ast_free(zt);
524                 return -1;
525         }
526
527         AST_LIST_LOCK(&translators);
528         AST_LIST_INSERT_HEAD(&translators, zt, entry);
529         AST_LIST_UNLOCK(&translators);
530
531         global_format_map.map[dst][src] = 1;
532
533         return res;
534 }
535
536 static void drop_translator(int dst, int src)
537 {
538         struct translator *cur;
539
540         AST_LIST_LOCK(&translators);
541         AST_LIST_TRAVERSE_SAFE_BEGIN(&translators, cur, entry) {
542                 if (cur->t.src_format.id != ast_format_id_from_old_bitfield((1 << src)))
543                         continue;
544
545                 if (cur->t.dst_format.id != ast_format_id_from_old_bitfield((1 << dst)))
546                         continue;
547
548                 AST_LIST_REMOVE_CURRENT(entry);
549                 ast_unregister_translator(&cur->t);
550                 ast_free(cur);
551                 global_format_map.map[dst][src] = 0;
552                 break;
553         }
554         AST_LIST_TRAVERSE_SAFE_END;
555         AST_LIST_UNLOCK(&translators);
556 }
557
558 static void unregister_translators(void)
559 {
560         struct translator *cur;
561
562         AST_LIST_LOCK(&translators);
563         while ((cur = AST_LIST_REMOVE_HEAD(&translators, entry))) {
564                 ast_unregister_translator(&cur->t);
565                 ast_free(cur);
566         }
567         AST_LIST_UNLOCK(&translators);
568 }
569
570 static void build_translators(struct format_map *map, unsigned int dstfmts, unsigned int srcfmts)
571 {
572         unsigned int src, dst;
573
574         for (src = 0; src < 32; src++) {
575                 for (dst = 0; dst < 32; dst++) {
576                         if (!(srcfmts & (1 << src)))
577                                 continue;
578
579                         if (!(dstfmts & (1 << dst)))
580                                 continue;
581
582                         if (global_format_map.map[dst][src])
583                                 continue;
584
585                         if (!register_translator(dst, src))
586                                 map->map[dst][src] = 1;
587                 }
588         }
589 }
590
591 static int find_transcoders(void)
592 {
593         struct dahdi_transcoder_info info = { 0, };
594         struct format_map map = { { { 0 } } };
595         int fd;
596         unsigned int x, y;
597
598         if ((fd = open("/dev/dahdi/transcode", O_RDWR)) < 0) {
599                 ast_log(LOG_ERROR, "Failed to open /dev/dahdi/transcode: %s\n", strerror(errno));
600                 return 0;
601         }
602
603         for (info.tcnum = 0; !ioctl(fd, DAHDI_TC_GETINFO, &info); info.tcnum++) {
604                 ast_verb(2, "Found transcoder '%s'.\n", info.name);
605
606                 /* Complex codecs need to support signed linear.  If the
607                  * hardware transcoder does not natively support signed linear
608                  * format, we will emulate it in software directly in this
609                  * module. Also, do not allow direct ulaw/alaw to complex
610                  * codec translation, since that will prevent the generic PLC
611                  * functions from working. */
612                 if (info.dstfmts & (DAHDI_FORMAT_ULAW | DAHDI_FORMAT_ALAW)) {
613                         info.dstfmts |= DAHDI_FORMAT_SLINEAR;
614                         info.dstfmts &= ~(DAHDI_FORMAT_ULAW | DAHDI_FORMAT_ALAW);
615                 }
616                 if (info.srcfmts & (DAHDI_FORMAT_ULAW | DAHDI_FORMAT_ALAW)) {
617                         info.srcfmts |= DAHDI_FORMAT_SLINEAR;
618                         info.srcfmts &= ~(DAHDI_FORMAT_ULAW | DAHDI_FORMAT_ALAW);
619                 }
620
621                 build_translators(&map, info.dstfmts, info.srcfmts);
622                 ast_atomic_fetchadd_int(&channels.total, info.numchannels / 2);
623
624         }
625
626         close(fd);
627
628         if (!info.tcnum) {
629                 ast_verb(2, "No hardware transcoders found.\n");
630         }
631
632         for (x = 0; x < 32; x++) {
633                 for (y = 0; y < 32; y++) {
634                         if (!map.map[x][y] && global_format_map.map[x][y])
635                                 drop_translator(x, y);
636                 }
637         }
638
639         return 0;
640 }
641
642 static int reload(void)
643 {
644         return AST_MODULE_LOAD_SUCCESS;
645 }
646
647 static int unload_module(void)
648 {
649         ast_cli_unregister_multiple(cli, ARRAY_LEN(cli));
650         unregister_translators();
651
652         return 0;
653 }
654
655 static int load_module(void)
656 {
657         ast_ulaw_init();
658         find_transcoders();
659         ast_cli_register_multiple(cli, ARRAY_LEN(cli));
660         return AST_MODULE_LOAD_SUCCESS;
661 }
662
663 AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Generic DAHDI Transcoder Codec Translator",
664                 .load = load_module,
665                 .unload = unload_module,
666                 .reload = reload,
667                );