[asterisk-dev] FXS to FXO loopback test

Matthew Fredrickson creslin at digium.com
Wed Apr 23 16:57:51 CDT 2008


Pawel Pastuszak wrote:
> Hi Guys,
> 
> I am trying to write an small C program that will able to send a tone and
> recive a tone at the other end using zaptel driver. I seen couple example of
> the fxstest.c that can send tone and ring so i want to uses that test and
> add so it can compare that  the tone goto to the other side on the FXO port.
> 
> How can i get the data from zaptel or see if the tone came in?

I think that if you're asking that question you have a long journey 
ahead of you.  Hopefully I am missing something in your question.

The way you access data on a zaptel channel is using open, read, and 
write system calls.  You need to write an application that opens a Zap 
channel, then reads the data from it and does some sort of fourier 
analysis to detect the tone that you sent, via some other application 
(which could be one you wrote).  You can use the write system call to 
write your tone data to the zaptel channel you want to generate the tone 
from.  If you wish to access the data in signed linear form (the form 
you are probably going to need to generate tones and do fourier 
analysis), you probably will want to familiarize yourself with the 
ZT_SETLINEAR ioctl.

-- 
Matthew Fredrickson
Software/Firmware Engineer
Digium, Inc.



More information about the asterisk-dev mailing list