Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
dtmfascii.c
Package: rtsp-1.0.1.tar.gz [view]
Upload User: sy_wanhua
Upload Date: 2013-07-25
Package Size: 3048k
Code Size: 2k
Category:
Streaming_Mpeg4
Development Platform:
C/C++
- #include <stdio.h>
- #include <stdlib.h>
- #include <strings.h>
- #include <sys/ioctl.h>
- #include <sys/types.h>
- #include <sys/time.h>
- #include <signal.h>
- #include <unistd.h>
- #include <fcntl.h>
- #include <asm/errno.h>
- #include "ixjuser.h"
- void closeall(void);
- void getdata(int);
- int ixj1, size1, len, cmd;
- unsigned long write1;
- char buff1[480];
- int main(int argc, char *argv[])
- {
- char pname1[80], buff1[480];
- int cnt, oflags1, oflags2;
- sprintf(pname1, "/dev/ixj%s", argv[1]);
- ixj1 = open(pname1, O_RDWR);
- atexit(closeall);
- signal(SIGIO, &getdata);
- fcntl(ixj1, F_SETOWN, getpid());
- oflags1 = fcntl(ixj1, F_GETFL);
- fcntl(ixj1, F_SETFL, oflags1 | FASYNC);
- getchar();
- }
- void closeall(void)
- {
- ioctl(ixj1, IXJCTL_DSP_IDLE);
- close(ixj1);
- }
- void getdata(int x)
- {
- fd_set rfds,wfds,efds;
- struct timeval tv;
- IXJ_EXCEPTION ixje;
- int nmax, size;
- char buf[480];
- signal(SIGIO, &getdata);
- // nmax = (ixj1 > 0 ? ixj1+1 : 1);
- nmax = ixj1+1;
- FD_ZERO(&rfds);
- FD_ZERO(&wfds);
- FD_ZERO(&efds);
- FD_SET(ixj1, &rfds);
- FD_SET(ixj1, &wfds);
- FD_SET(ixj1, &efds);
- tv.tv_sec = 0;
- tv.tv_usec = 300;
- select(nmax,&rfds, &wfds, &efds, &tv);
- if(FD_ISSET(ixj1,&rfds))
- {
- }
- if(FD_ISSET(ixj1,&wfds))
- {
- }
- if(FD_ISSET(ixj1,&efds))
- {
- ixje.bytes = ioctl(ixj1, IXJCTL_EXCEPTION);
- if(ixje.bits.dtmf_ready)
- {
- // Deal with DTMF
- ioctl(ixj1, IXJCTL_CPT_STOP);
- printf("DTMF from card 0 = %cn",ioctl(ixj1, IXJCTL_GET_DTMF_ASCII));
- }
- if(ixje.bits.hookstate)
- {
- if(ioctl(ixj1, IXJCTL_HOOKSTATE))
- {
- ioctl(ixj1, IXJCTL_DIALTONE);
- printf("Off Hookn");
- }
- else
- printf("On Hookn");
- }
- fflush(stdout);
- }
- }