/* * Wilcard TC400B Digium Transcoder Engine Interface Driver for Zapata Telephony interface test tool. * * Written by Matt O'Gorman * * Copyright (C) 2006, Digium, Inc. * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ #include #include #include #include #include #include #include #include #include #include struct format_map { unsigned int map[32][32]; }; static int find_transcoders(void) { struct zt_transcode_info info = { 0, }; struct format_map map = { { { 0 } } }; int fd, res; unsigned int x, y; info.op = ZT_TCOP_GETINFO; if ((fd = open("/dev/zap/transcode", O_RDWR)) < 0) { printf("Warning: No Zaptel transcoder support!\n"); return 0; } for (info.tcnum = 0; !(res = ioctl(fd, ZT_TRANSCODE_OP, &info)); info.tcnum++) { printf("Found transcoder %d, '%s'.\n",info.tcnum, info.name); x = ZT_TCOP_TEST; ioctl(fd, ZT_TRANSCODE_OP, &x); } close(fd); if (!info.tcnum) printf("No hardware transcoders found.\n"); return 0; } int main() { printf("this is a test\n"); find_transcoders(); return 0; }