?? ixj-howto
字號:
Linux Quicknet-Drivers-HowtoQuicknet Technologies, Inc. (www.quicknet.net)Version 0.3.5 July 2, 19991.0 IntroductionThis is a Pre-Alpha release version of the Linux driver forthe Quicknet Internet PhoneJACK and Internet LineJACK cards. Moreinformation about these cards is available at www.quicknet.net.The driver version discussed in this document is 0.1.30.These cards offer nice telco style interfaces to use your standardtelephone/key system/PBX as the user interface for VoIP applications.The Internet LineJACK also offers PSTN connectivity for a single lineInternet to PSTN gateway. Of course, you can add more than one cardto a system to obtain multi-line functionality. At this time, thedriver supports the POTS port on both the Internet PhoneJACK and theInternet LineJACK, but the PSTN port on the latter card is not yetsupported.This document, and the drivers for the cards, are intended for alimited audience that includes technically capable programmers whowould like to experiment with Quicknet cards. THE LINUX DRIVERS FOR QUICKNET CARDS ARE PRESENTLY IN A PRE-ALPHASTATE AND SHOULD NOT BE CONSIDERED AS READY FOR NORMAL WIDESPREAD USE.They are released early in the spirit of Internet development and tomake this technology available to innovators who would benefit fromearly exposure.When we promote the device driver to "beta" level it will beconsidered ready for non-programmer, non-technical users. Until then,please be aware that these drivers may not be stable and may affectthe performance of your system.1.1 Latest Additions/ImprovementsThe 0.1.30 version of the driver added support for the InternetLineJACK cards POTS port and fixed several small bugs. Refer to theCHANGES file for details.1.2 Copyright, Trademarks, Disclaimer, & Credits CopyrightCopyright (c) 1999 Quicknet Technologies, Inc. Permission is grantedto freely copy and distribute this document provided you preserve itin its original form. For corrections and minor changes contact themaintainer at linux@quicknet.net.TrademarksInternet PhoneJACK and Internet LineJACK are registered trademarks ofQuicknet Technologies, Inc.DisclaimerMuch of the info in this HOWTO is early information released byQuicknet Technologies, Inc. for the express purpose of allowing earlytesting and use of the Linux drivers developed for their products.While every attempt has been made to be thorough, complete andaccurate, the information contained here may be unreliable and thereare likely a number of errors in this document. Please let themaintainer know about them. Since this is free documentation, itshould be obvious that neither I nor previous authors can be heldlegally responsible for any errors.CreditsThis HOWTO was written by: Greg Herlein <gherlein@quicknet.net> Ed Okerson <eokerson@quicknet.net> 1.3 Future Plans: You Can Help Please let the maintainer know of any errors in facts, opinions,logic, spelling, grammar, clarity, links, etc. But first, if the dateis over a month old, check to see that you have the latestversion. Please send any info that you think belongs in this document.You can also contribute code and/or bug-fixes for the sampleapplications.1.4 Where to get thingsYou can download the latest versions of the driver from:http://www.quicknet.net/develop.htmYou can download the latest version of this document from:http://www.quicknet.net/develop.htm1.5 Mailing ListQuicknet operates a mailing list to provide a public forum on usingthese drivers.To subscribe to the linux-sdk mailing list, send an email to: majordomo@linux.quicknet.netIn the body of the email, type: subscribe linux-sdk <your-email-address>Please delete any signature block that you would normally add to thebottom of your email - it tends to confuse majordomo.To send mail to the list, address your mail to linux-sdk@linux.quicknet.netYour message will go out to everyone on the list.To unsubscribe to the linux-sdk mailing list, send an email to: majordomo@linux.quicknet.netIn the body of the email, type: unsubscribe linux-sdk <your-email-address>2.0 Requirements2.1 Quicknet Card(s)You will need at least two Internet PhoneJACK or Internet LineJACKcards (note that the present state of the driver supports only thePOTS port on the Internet LineJACK). These are ISA bus devices thatuse Plug-n-Play for configuration, and use no IRQs. The driver willsupport up to 16 cards in any one system, of any mix between the twotypes.Note that you will need two cards to do any useful testing, sinceyou will need a card on both ends of the connection.2.2 ISAPNPSince the Quicknet cards are Plug-n-Play devices, you will need theisapnp tools package to configure the cards. This package probablycame with your Linux distribution. Documentation on this package isavailable online at: http://mailer.wiwi.uni-marburg.de/linux/LDP/HOWTO/Plug-and-Play-HOWTO.html3.0 Card Configuration The Internet PhoneJACK only has one configuration register that requires16 IO ports. The Internet LineJACK card has two configuration registersand isapnp reports that IO 0 requires 16 IO ports and IO 1 requires 8.The Quicknet driver assumes that these registers are configured to becontiguous, i.e. if IO 0 is set to 0x340 then IO 1 should be set to 0x350.Make sure that none of the cards overlap if you have multiplecards in the system.If you are new to the isapnp tools, you can jumpstart yourself bydoing the following: a. run pnpdump to get a blank isapnp.conf file pnpdump > /etc/isapnp.conf b. edit the /etc/isapnp.conf file to set the register IO addresses. c. if you have multiple Quicknet cards, make sure that you donot have any overlaps. Be especially careful if you are mixing InternetPhoneJACK and Internet LineJACK cards in the same system.4.0 Driver and Test Software InstallationTo install and load the driver, perform the following: a. untar the distribution file. b. run the "ixj_dev_create" script to remove any stray devicefiles left in the /dev directory, and to create the new officiallydesignated device files. c. ensure that you have run the isapnp configuration utility to properly configure the cards. d. copy the module to a common module directory. We recommendthat you copy the driver to /lib/modules/<kernel-rev>/misc. Ourcurrent preferred location is /lib/modules/2.2.10/misc. e. if you are loading the module by hand, use insmod. An exampleof this would look like this: insmod ixj io=0x300 ixjdebug=0Then verify the module loaded by running lsmod. f. if you are planning on using kerneld to automatically load the module for you, then you need to edit /etc/conf.modules and add the following lines: options ixj io=0x300 ixjdebug=0 alias char-major-159 ixjIf you do this, then when you execute an application that uses themodule kerneld will load the module for you. Note that to do this,you need to have your kernel set to support kerneld. You can checkfor this by looking at /usr/src/linux/.config and you should see this: # Loadable module support # CONFIG_MODULES=y # CONFIG_MODVERSIONS is not set CONFIG_KMOD=y g. if you want non-root users to be able to read and write to the ixj devices (this is a good idea!) you should do the following: - decide upon a group name to use and create that group if needed. Add the user names to that group that you wish to have access to the device. For example, we typically will create a group named "ixj" in /etc/group and add all users to that group that we want to run software that can use the ixjX devices. - change the permissions on the device files, like this: chgrp ixj /dev/ixj* chmod 660 /dev/ixj* Once this is done, then non-root users should be able to use thedevices. If you have enabled autoloading of modules, then the usershould be able to open the device and have the module loadedautomatically for them. 5.0 Example CodeThere are several sample applications included with the driver todemonstrate its use.intercom.c - Demonstrates the drivers capability to pass audio betweenmultiple cards without passing the audio data through user space. Theapplication only has to deal with telling which cards to talk to eachother, the driver does the rest.inter2.c - Same concept as intercom.c, only passing the data through userspace. In this example the application has to deal with reading andwriting to the device files to pass data between cards.tpjackd.c - This is the server side of a very basic IP Telephony app. Itsimply waits on a TCP port for an incoming connection. When it receivesit the phone rings. When the phone is lifted it starts passing UDPpackets with audio data to the tpjack.c program.tpjack.c - This is the client side that goes with tpjackd.cdtmfread.c - This is sample code that shows how to use asynchronousnotification and how to read detected DTMF digits.playtone.c - This is sample code that shows how to play DTMF tones.busytone.c - This is sample code that shows how to play both busy andringback tones.ixjasync.c - This is sample code that shows how to use asyncronousnotification.record.c - This is sample code that shows how to record sound from thephone handset. The sound is recorded to a file that can be playedback with plaback.c (below).playback.c - This is sample code that shows how to play back soundsamples to the handset.jackopen.c - This is sample code that shows how to open the ixj device.led.c - This is sample code that shows how to blink the LEDs on theInternet LineJACK.6.0 Use of the DriverFollow the directions above to use the "ixj_dev_create" script tocreate the necessary device files. Modify the /etc/conf.modules fileas described above, and use modprobe or insmod to load the driver.6.1 Test Applicationstpjackd - daemon application to listen for an incoming callUse: tpjackd dev portdev - is the name of the device, usually "/dev/ixj0" - though if there are multiple cards in the system it might be /dev/ixj1, etc.port - the port that the daemon will listen to for an incoming ringThe daemon application now runs as a true daemon - it disconnects fromthe controlling terminal upon startup and runs only in the background.It logs messages to syslog. Typical use during development is to usean xterm window and put a "tail -f /var/log/messages" in use to watchthe logging.tpjack - calling applicationUse: tpjack dev host portdev - is the name of the device, usually "/dev/ixj0" - though if there are multiple cards in the system it might be /dev/ixj1, /dev/ixj2, etc.host - the name of the host that is running the daemon (name, not ip address) Note that the name of both hosts needs to be resolvable, either by DNS or local hosts files. port - the port that the daemon will listen to for an incoming ring7.0 Known LimitationsWe cannot currently play "dial-tone" and listen for DTMF digits at thesame time. This is a bug in the DSP chip. We have a work-around, butit's not done yet. Until then, if you want dial-tone, you can alwaysplay a recorded dial-tone sound into the audio until you have gatheredthe DTMF digits. Yes, it's lame, but it's the best we can do with abuggy DSP at this point.Currently, the driver does not support non-blocking IO. It doessupport poll() and select() functionality though. Other features willbe available soon.You should not use various ioctl calls in the ixjuser.h file unlessyou see them used in the sample code distributed with the driver. Notall the ioctls are implemented even though they are found in theheader file.See the lates CHANGES files for other recent improvements or knownlimitations.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -