[asterisk-dev] FXS to FXO loopback test
Pawel Pastuszak
pawelpastuszak at gmail.com
Wed Apr 23 19:18:10 CDT 2008
Hi Matthew,
I am not sure if i explained myself right, let me try again so i have a mini
application that was based on the fxstest.c located in zaptel.
Here is the source of the fxstest.c
http://svn.digium.com/view/zaptel/betas/1.2-hpec/fxstest.c?view=markup
What i did was modify it so that it send ring tone and the sends the
different tones.
So what i have working is able to detect if the FXO interface is ringing but
i not sure how can i detect what tones is getting on the fxo side.
Here is also a basic bock diagram
[ FXS ] ---> Physical Cable Loopback to ---> [ FXO ]
Send Ring -------------------------------------------------> Is Ringing
Send DTMF Tones ------------------------------------ > ????? No clue how to
tell whats coming in [ need HELP here ]
Pawel
On Wed, Apr 23, 2008 at 5:57 PM, Matthew Fredrickson <creslin at digium.com>
wrote:
> 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.
>
> _______________________________________________
> --Bandwidth and Colocation Provided by http://www.api-digital.com--
>
> asterisk-dev mailing list
> To UNSUBSCRIBE or update options visit:
> http://lists.digium.com/mailman/listinfo/asterisk-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-dev/attachments/20080423/1afcedb4/attachment.htm
More information about the asterisk-dev
mailing list