codec_dahdi.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648
  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. /*! \file
  22. *
  23. * \brief Translate between various formats natively through DAHDI transcoding
  24. *
  25. * \ingroup codecs
  26. */
  27. /*** MODULEINFO
  28. <support_level>core</support_level>
  29. <depend>dahdi</depend>
  30. ***/
  31. #include "asterisk.h"
  32. ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
  33. #include <fcntl.h>
  34. #include <netinet/in.h>
  35. #include <sys/ioctl.h>
  36. #include <sys/mman.h>
  37. #include <sys/poll.h>
  38. #include <dahdi/user.h>
  39. #include "asterisk/lock.h"
  40. #include "asterisk/translate.h"
  41. #include "asterisk/config.h"
  42. #include "asterisk/module.h"
  43. #include "asterisk/cli.h"
  44. #include "asterisk/channel.h"
  45. #include "asterisk/utils.h"
  46. #include "asterisk/linkedlists.h"
  47. #include "asterisk/ulaw.h"
  48. #define BUFFER_SIZE 8000
  49. #define G723_SAMPLES 240
  50. #define G729_SAMPLES 160
  51. static struct channel_usage {
  52. int total;
  53. int encoders;
  54. int decoders;
  55. } channels;
  56. static char *handle_cli_transcoder_show(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a);
  57. static struct ast_cli_entry cli[] = {
  58. AST_CLI_DEFINE(handle_cli_transcoder_show, "Display DAHDI transcoder utilization.")
  59. };
  60. struct format_map {
  61. unsigned int map[32][32];
  62. };
  63. static struct format_map global_format_map = { { { 0 } } };
  64. struct translator {
  65. struct ast_translator t;
  66. AST_LIST_ENTRY(translator) entry;
  67. };
  68. static AST_LIST_HEAD_STATIC(translators, translator);
  69. struct codec_dahdi_pvt {
  70. int fd;
  71. struct dahdi_transcoder_formats fmts;
  72. unsigned int softslin:1;
  73. unsigned int fake:2;
  74. uint16_t required_samples;
  75. uint16_t samples_in_buffer;
  76. uint8_t ulaw_buffer[1024];
  77. };
  78. /* Only used by a decoder */
  79. static int ulawtolin(struct ast_trans_pvt *pvt, int samples)
  80. {
  81. struct codec_dahdi_pvt *dahdip = pvt->pvt;
  82. int i = samples;
  83. uint8_t *src = &dahdip->ulaw_buffer[0];
  84. int16_t *dst = pvt->outbuf.i16 + pvt->datalen;
  85. /* convert and copy in outbuf */
  86. while (i--) {
  87. *dst++ = AST_MULAW(*src++);
  88. }
  89. return 0;
  90. }
  91. /* Only used by an encoder. */
  92. static int lintoulaw(struct ast_trans_pvt *pvt, struct ast_frame *f)
  93. {
  94. struct codec_dahdi_pvt *dahdip = pvt->pvt;
  95. int i = f->samples;
  96. uint8_t *dst = &dahdip->ulaw_buffer[dahdip->samples_in_buffer];
  97. int16_t *src = f->data.ptr;
  98. if (dahdip->samples_in_buffer + i > sizeof(dahdip->ulaw_buffer)) {
  99. ast_log(LOG_ERROR, "Out of buffer space!\n");
  100. return -i;
  101. }
  102. while (i--) {
  103. *dst++ = AST_LIN2MU(*src++);
  104. }
  105. dahdip->samples_in_buffer += f->samples;
  106. return 0;
  107. }
  108. static char *handle_cli_transcoder_show(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
  109. {
  110. struct channel_usage copy;
  111. switch (cmd) {
  112. case CLI_INIT:
  113. e->command = "transcoder show";
  114. e->usage =
  115. "Usage: transcoder show\n"
  116. " Displays channel utilization of DAHDI transcoder(s).\n";
  117. return NULL;
  118. case CLI_GENERATE:
  119. return NULL;
  120. }
  121. if (a->argc != 2)
  122. return CLI_SHOWUSAGE;
  123. copy = channels;
  124. if (copy.total == 0)
  125. ast_cli(a->fd, "No DAHDI transcoders found.\n");
  126. else
  127. ast_cli(a->fd, "%d/%d encoders/decoders of %d channels are in use.\n", copy.encoders, copy.decoders, copy.total);
  128. return CLI_SUCCESS;
  129. }
  130. static void dahdi_write_frame(struct codec_dahdi_pvt *dahdip, const uint8_t *buffer, const ssize_t count)
  131. {
  132. int res;
  133. struct pollfd p = {0};
  134. if (!count) return;
  135. res = write(dahdip->fd, buffer, count);
  136. if (option_verbose > 10) {
  137. if (-1 == res) {
  138. ast_log(LOG_ERROR, "Failed to write to transcoder: %s\n", strerror(errno));
  139. }
  140. if (count != res) {
  141. ast_log(LOG_ERROR, "Requested write of %zd bytes, but only wrote %d bytes.\n", count, res);
  142. }
  143. }
  144. p.fd = dahdip->fd;
  145. p.events = POLLOUT;
  146. res = poll(&p, 1, 50);
  147. }
  148. static int dahdi_encoder_framein(struct ast_trans_pvt *pvt, struct ast_frame *f)
  149. {
  150. struct codec_dahdi_pvt *dahdip = pvt->pvt;
  151. if (!f->subclass.codec) {
  152. /* We're just faking a return for calculation purposes. */
  153. dahdip->fake = 2;
  154. pvt->samples = f->samples;
  155. return 0;
  156. }
  157. /* Buffer up the packets and send them to the hardware if we
  158. * have enough samples set up. */
  159. if (dahdip->softslin) {
  160. if (lintoulaw(pvt, f)) {
  161. return -1;
  162. }
  163. } else {
  164. /* NOTE: If softslin support is not needed, and the sample
  165. * size is equal to the required sample size, we wouldn't
  166. * need this copy operation. But at the time this was
  167. * written, only softslin is supported. */
  168. if (dahdip->samples_in_buffer + f->samples > sizeof(dahdip->ulaw_buffer)) {
  169. ast_log(LOG_ERROR, "Out of buffer space.\n");
  170. return -1;
  171. }
  172. memcpy(&dahdip->ulaw_buffer[dahdip->samples_in_buffer], f->data.ptr, f->samples);
  173. dahdip->samples_in_buffer += f->samples;
  174. }
  175. while (dahdip->samples_in_buffer > dahdip->required_samples) {
  176. dahdi_write_frame(dahdip, dahdip->ulaw_buffer, dahdip->required_samples);
  177. dahdip->samples_in_buffer -= dahdip->required_samples;
  178. if (dahdip->samples_in_buffer) {
  179. /* Shift any remaining bytes down. */
  180. memmove(dahdip->ulaw_buffer, &dahdip->ulaw_buffer[dahdip->required_samples],
  181. dahdip->samples_in_buffer);
  182. }
  183. }
  184. pvt->samples += f->samples;
  185. pvt->datalen = 0;
  186. return -1;
  187. }
  188. static struct ast_frame *dahdi_encoder_frameout(struct ast_trans_pvt *pvt)
  189. {
  190. struct codec_dahdi_pvt *dahdip = pvt->pvt;
  191. int res;
  192. if (2 == dahdip->fake) {
  193. dahdip->fake = 1;
  194. pvt->f.frametype = AST_FRAME_VOICE;
  195. pvt->f.subclass.codec = 0;
  196. pvt->f.samples = dahdip->required_samples;
  197. pvt->f.data.ptr = NULL;
  198. pvt->f.offset = 0;
  199. pvt->f.datalen = 0;
  200. pvt->f.mallocd = 0;
  201. pvt->samples = 0;
  202. return ast_frisolate(&pvt->f);
  203. } else if (1 == dahdip->fake) {
  204. dahdip->fake = 0;
  205. return NULL;
  206. }
  207. res = read(dahdip->fd, pvt->outbuf.c + pvt->datalen, pvt->t->buf_size - pvt->datalen);
  208. if (-1 == res) {
  209. if (EWOULDBLOCK == errno) {
  210. /* Nothing waiting... */
  211. return NULL;
  212. } else {
  213. ast_log(LOG_ERROR, "Failed to read from transcoder: %s\n", strerror(errno));
  214. return NULL;
  215. }
  216. } else {
  217. pvt->f.datalen = res;
  218. pvt->f.samples = dahdip->required_samples;
  219. pvt->f.frametype = AST_FRAME_VOICE;
  220. pvt->f.subclass.codec = 1 << (pvt->t->dstfmt);
  221. pvt->f.mallocd = 0;
  222. pvt->f.offset = AST_FRIENDLY_OFFSET;
  223. pvt->f.src = pvt->t->name;
  224. pvt->f.data.ptr = pvt->outbuf.c;
  225. pvt->samples = 0;
  226. pvt->datalen = 0;
  227. return ast_frisolate(&pvt->f);
  228. }
  229. /* Shouldn't get here... */
  230. return NULL;
  231. }
  232. static int dahdi_decoder_framein(struct ast_trans_pvt *pvt, struct ast_frame *f)
  233. {
  234. struct codec_dahdi_pvt *dahdip = pvt->pvt;
  235. if (!f->subclass.codec) {
  236. /* We're just faking a return for calculation purposes. */
  237. dahdip->fake = 2;
  238. pvt->samples = f->samples;
  239. return 0;
  240. }
  241. if (!f->datalen) {
  242. if (f->samples != dahdip->required_samples) {
  243. ast_log(LOG_ERROR, "%d != %d %d\n", f->samples, dahdip->required_samples, f->datalen);
  244. }
  245. }
  246. dahdi_write_frame(dahdip, f->data.ptr, f->datalen);
  247. pvt->samples += f->samples;
  248. pvt->datalen = 0;
  249. return -1;
  250. }
  251. static struct ast_frame *dahdi_decoder_frameout(struct ast_trans_pvt *pvt)
  252. {
  253. int res;
  254. struct codec_dahdi_pvt *dahdip = pvt->pvt;
  255. if (2 == dahdip->fake) {
  256. dahdip->fake = 1;
  257. pvt->f.frametype = AST_FRAME_VOICE;
  258. pvt->f.subclass.codec = 0;
  259. pvt->f.samples = dahdip->required_samples;
  260. pvt->f.data.ptr = NULL;
  261. pvt->f.offset = 0;
  262. pvt->f.datalen = 0;
  263. pvt->f.mallocd = 0;
  264. pvt->samples = 0;
  265. return ast_frisolate(&pvt->f);
  266. } else if (1 == dahdip->fake) {
  267. pvt->samples = 0;
  268. dahdip->fake = 0;
  269. return NULL;
  270. }
  271. /* Let's check to see if there is a new frame for us.... */
  272. if (dahdip->softslin) {
  273. res = read(dahdip->fd, dahdip->ulaw_buffer, sizeof(dahdip->ulaw_buffer));
  274. } else {
  275. res = read(dahdip->fd, pvt->outbuf.c + pvt->datalen, pvt->t->buf_size - pvt->datalen);
  276. }
  277. if (-1 == res) {
  278. if (EWOULDBLOCK == errno) {
  279. /* Nothing waiting... */
  280. return NULL;
  281. } else {
  282. ast_log(LOG_ERROR, "Failed to read from transcoder: %s\n", strerror(errno));
  283. return NULL;
  284. }
  285. } else {
  286. if (dahdip->softslin) {
  287. ulawtolin(pvt, res);
  288. pvt->f.datalen = res * 2;
  289. } else {
  290. pvt->f.datalen = res;
  291. }
  292. pvt->datalen = 0;
  293. pvt->f.frametype = AST_FRAME_VOICE;
  294. pvt->f.subclass.codec = 1 << (pvt->t->dstfmt);
  295. pvt->f.mallocd = 0;
  296. pvt->f.offset = AST_FRIENDLY_OFFSET;
  297. pvt->f.src = pvt->t->name;
  298. pvt->f.data.ptr = pvt->outbuf.c;
  299. pvt->f.samples = res;
  300. pvt->samples = 0;
  301. return ast_frisolate(&pvt->f);
  302. }
  303. /* Shouldn't get here... */
  304. return NULL;
  305. }
  306. static void dahdi_destroy(struct ast_trans_pvt *pvt)
  307. {
  308. struct codec_dahdi_pvt *dahdip = pvt->pvt;
  309. switch (dahdip->fmts.dstfmt) {
  310. case AST_FORMAT_G729A:
  311. case AST_FORMAT_G723_1:
  312. ast_atomic_fetchadd_int(&channels.encoders, -1);
  313. break;
  314. default:
  315. ast_atomic_fetchadd_int(&channels.decoders, -1);
  316. break;
  317. }
  318. close(dahdip->fd);
  319. }
  320. static int dahdi_translate(struct ast_trans_pvt *pvt, int dest, int source)
  321. {
  322. /* Request translation through zap if possible */
  323. int fd;
  324. struct codec_dahdi_pvt *dahdip = pvt->pvt;
  325. int flags;
  326. int tried_once = 0;
  327. const char *dev_filename = "/dev/dahdi/transcode";
  328. if ((fd = open(dev_filename, O_RDWR)) < 0) {
  329. ast_log(LOG_ERROR, "Failed to open %s: %s\n", dev_filename, strerror(errno));
  330. return -1;
  331. }
  332. dahdip->fmts.srcfmt = (1 << source);
  333. dahdip->fmts.dstfmt = (1 << dest);
  334. ast_debug(1, "Opening transcoder channel from %d to %d.\n", source, dest);
  335. retry:
  336. if (ioctl(fd, DAHDI_TC_ALLOCATE, &dahdip->fmts)) {
  337. if ((ENODEV == errno) && !tried_once) {
  338. /* We requested to translate to/from an unsupported
  339. * format. Most likely this is because signed linear
  340. * was not supported by any hardware devices even
  341. * though this module always registers signed linear
  342. * support. In this case we'll retry, requesting
  343. * support for ULAW instead of signed linear and then
  344. * we'll just convert from ulaw to signed linear in
  345. * software. */
  346. if (AST_FORMAT_SLINEAR == dahdip->fmts.srcfmt) {
  347. ast_debug(1, "Using soft_slin support on source\n");
  348. dahdip->softslin = 1;
  349. dahdip->fmts.srcfmt = AST_FORMAT_ULAW;
  350. } else if (AST_FORMAT_SLINEAR == dahdip->fmts.dstfmt) {
  351. ast_debug(1, "Using soft_slin support on destination\n");
  352. dahdip->softslin = 1;
  353. dahdip->fmts.dstfmt = AST_FORMAT_ULAW;
  354. }
  355. tried_once = 1;
  356. goto retry;
  357. }
  358. ast_log(LOG_ERROR, "Unable to attach to transcoder: %s\n", strerror(errno));
  359. close(fd);
  360. return -1;
  361. }
  362. flags = fcntl(fd, F_GETFL);
  363. if (flags > - 1) {
  364. if (fcntl(fd, F_SETFL, flags | O_NONBLOCK))
  365. ast_log(LOG_WARNING, "Could not set non-block mode!\n");
  366. }
  367. dahdip->fd = fd;
  368. dahdip->required_samples = ((dahdip->fmts.dstfmt|dahdip->fmts.srcfmt)&AST_FORMAT_G723_1) ? G723_SAMPLES : G729_SAMPLES;
  369. switch (dahdip->fmts.dstfmt) {
  370. case AST_FORMAT_G729A:
  371. ast_atomic_fetchadd_int(&channels.encoders, +1);
  372. break;
  373. case AST_FORMAT_G723_1:
  374. ast_atomic_fetchadd_int(&channels.encoders, +1);
  375. break;
  376. default:
  377. ast_atomic_fetchadd_int(&channels.decoders, +1);
  378. break;
  379. }
  380. return 0;
  381. }
  382. static int dahdi_new(struct ast_trans_pvt *pvt)
  383. {
  384. return dahdi_translate(pvt, pvt->t->dstfmt, pvt->t->srcfmt);
  385. }
  386. static struct ast_frame *fakesrc_sample(void)
  387. {
  388. /* Don't bother really trying to test hardware ones. */
  389. static struct ast_frame f = {
  390. .frametype = AST_FRAME_VOICE,
  391. .samples = 160,
  392. .src = __PRETTY_FUNCTION__
  393. };
  394. return &f;
  395. }
  396. static int is_encoder(struct translator *zt)
  397. {
  398. if (zt->t.srcfmt&(AST_FORMAT_ULAW|AST_FORMAT_ALAW|AST_FORMAT_SLINEAR)) {
  399. return 1;
  400. } else {
  401. return 0;
  402. }
  403. }
  404. static int register_translator(int dst, int src)
  405. {
  406. struct translator *zt;
  407. int res;
  408. if (!(zt = ast_calloc(1, sizeof(*zt)))) {
  409. return -1;
  410. }
  411. snprintf((char *) (zt->t.name), sizeof(zt->t.name), "zap%sto%s",
  412. ast_getformatname((1 << src)), ast_getformatname((1 << dst)));
  413. zt->t.srcfmt = (1 << src);
  414. zt->t.dstfmt = (1 << dst);
  415. zt->t.buf_size = BUFFER_SIZE;
  416. if (is_encoder(zt)) {
  417. zt->t.framein = dahdi_encoder_framein;
  418. zt->t.frameout = dahdi_encoder_frameout;
  419. } else {
  420. zt->t.framein = dahdi_decoder_framein;
  421. zt->t.frameout = dahdi_decoder_frameout;
  422. }
  423. zt->t.destroy = dahdi_destroy;
  424. zt->t.buffer_samples = 0;
  425. zt->t.newpvt = dahdi_new;
  426. zt->t.sample = fakesrc_sample;
  427. zt->t.native_plc = 0;
  428. zt->t.desc_size = sizeof(struct codec_dahdi_pvt);
  429. if ((res = ast_register_translator(&zt->t))) {
  430. ast_free(zt);
  431. return -1;
  432. }
  433. AST_LIST_LOCK(&translators);
  434. AST_LIST_INSERT_HEAD(&translators, zt, entry);
  435. AST_LIST_UNLOCK(&translators);
  436. global_format_map.map[dst][src] = 1;
  437. return res;
  438. }
  439. static void drop_translator(int dst, int src)
  440. {
  441. struct translator *cur;
  442. AST_LIST_LOCK(&translators);
  443. AST_LIST_TRAVERSE_SAFE_BEGIN(&translators, cur, entry) {
  444. if (cur->t.srcfmt != src)
  445. continue;
  446. if (cur->t.dstfmt != dst)
  447. continue;
  448. AST_LIST_REMOVE_CURRENT(entry);
  449. ast_unregister_translator(&cur->t);
  450. ast_free(cur);
  451. global_format_map.map[dst][src] = 0;
  452. break;
  453. }
  454. AST_LIST_TRAVERSE_SAFE_END;
  455. AST_LIST_UNLOCK(&translators);
  456. }
  457. static void unregister_translators(void)
  458. {
  459. struct translator *cur;
  460. AST_LIST_LOCK(&translators);
  461. while ((cur = AST_LIST_REMOVE_HEAD(&translators, entry))) {
  462. ast_unregister_translator(&cur->t);
  463. ast_free(cur);
  464. }
  465. AST_LIST_UNLOCK(&translators);
  466. }
  467. static void build_translators(struct format_map *map, unsigned int dstfmts, unsigned int srcfmts)
  468. {
  469. unsigned int src, dst;
  470. for (src = 0; src < 32; src++) {
  471. for (dst = 0; dst < 32; dst++) {
  472. if (!(srcfmts & (1 << src)))
  473. continue;
  474. if (!(dstfmts & (1 << dst)))
  475. continue;
  476. if (global_format_map.map[dst][src])
  477. continue;
  478. if (!register_translator(dst, src))
  479. map->map[dst][src] = 1;
  480. }
  481. }
  482. }
  483. static int find_transcoders(void)
  484. {
  485. struct dahdi_transcoder_info info = { 0, };
  486. struct format_map map = { { { 0 } } };
  487. int fd, res;
  488. unsigned int x, y;
  489. if ((fd = open("/dev/dahdi/transcode", O_RDWR)) < 0) {
  490. ast_log(LOG_ERROR, "Failed to open /dev/dahdi/transcode: %s\n", strerror(errno));
  491. return 0;
  492. }
  493. for (info.tcnum = 0; !(res = ioctl(fd, DAHDI_TC_GETINFO, &info)); info.tcnum++) {
  494. if (option_verbose > 1)
  495. ast_verbose(VERBOSE_PREFIX_2 "Found transcoder '%s'.\n", info.name);
  496. /* Complex codecs need to support signed linear. If the
  497. * hardware transcoder does not natively support signed linear
  498. * format, we will emulate it in software directly in this
  499. * module. Also, do not allow direct ulaw/alaw to complex
  500. * codec translation, since that will prevent the generic PLC
  501. * functions from working. */
  502. if (info.dstfmts & (AST_FORMAT_ULAW | AST_FORMAT_ALAW)) {
  503. info.dstfmts |= AST_FORMAT_SLINEAR;
  504. info.dstfmts &= ~(AST_FORMAT_ULAW | AST_FORMAT_ALAW);
  505. }
  506. if (info.srcfmts & (AST_FORMAT_ULAW | AST_FORMAT_ALAW)) {
  507. info.srcfmts |= AST_FORMAT_SLINEAR;
  508. info.srcfmts &= ~(AST_FORMAT_ULAW | AST_FORMAT_ALAW);
  509. }
  510. build_translators(&map, info.dstfmts, info.srcfmts);
  511. ast_atomic_fetchadd_int(&channels.total, info.numchannels / 2);
  512. }
  513. close(fd);
  514. if (!info.tcnum && (option_verbose > 1))
  515. ast_verbose(VERBOSE_PREFIX_2 "No hardware transcoders found.\n");
  516. for (x = 0; x < 32; x++) {
  517. for (y = 0; y < 32; y++) {
  518. if (!map.map[x][y] && global_format_map.map[x][y])
  519. drop_translator(x, y);
  520. }
  521. }
  522. return 0;
  523. }
  524. static int reload(void)
  525. {
  526. return AST_MODULE_LOAD_SUCCESS;
  527. }
  528. static int unload_module(void)
  529. {
  530. ast_cli_unregister_multiple(cli, ARRAY_LEN(cli));
  531. unregister_translators();
  532. return 0;
  533. }
  534. static int load_module(void)
  535. {
  536. ast_ulaw_init();
  537. find_transcoders();
  538. ast_cli_register_multiple(cli, ARRAY_LEN(cli));
  539. return AST_MODULE_LOAD_SUCCESS;
  540. }
  541. AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Generic DAHDI Transcoder Codec Translator",
  542. .load = load_module,
  543. .unload = unload_module,
  544. .reload = reload,
  545. );