[App_rpt] Using app_rpt as a dumb full duplex voice repeater

Raphael Hertzog raphael at ouaza.com
Fri Nov 24 17:47:32 UTC 2006


Hello,

on the recommandation of François Bergeret (F6HQZ), I tried to use app_rpt
for a very specific application. This application is not ham-related so
I'm sometimes lost in app_rpt's documentation as I don't understand
everything.

My problematic is very simple: on one side I have an audio connection
initiated by SIP. On the other side I have a 4-wires analogic line (2 wires
for rx and 2 wires for tx, that's the part which is common with the HAM
world and that app_rpt is able to handle) conveying *only* the voice
(there's no signalling at all).

My goal is to bridge the two sides: as soon as the SIP connection is
established, the audio should be forwarded on the "tx" line and the audio
received on the "rx" line should be sent to the SIP side. And I try to use
app_rpt to do this bridging.

On the hardware side I'm using a Digium TDM400P with two FXO modules
(since I don't want to feed current on the analogic lines). 

The zaptel configuration is:
fxsks=3   # FXO RX pair
fxsls=4   # FXO TX pair

The Asterisk zapata configuration is:
signalling=fxs_rx
channel => 3
signalling=fxs_tx
channel => 4

The app_rpt configuration is the smallest to I could come up with:
[100]                                   ; Node ID of first repeater
rxchannel = Zap/3                       ; Rx audio/signalling channel
txchannel = Zap/4                       ; Tx audio/signalling channel
idrecording = test                      ; id recording

[nodes]
100 = incoming at 127.0.0.1,NONE

Then in the Asterisk's extensions.conf, I create the application
associated to my SIP id "testfxo":
exten => testfxo,1,Answer()
exten => testfxo,n,Rpt(100|D)
exten => testfxo,n,Hangup()

Using the "Dumb Control Phone" mode is the one which gave the best
results (standard mode is refused, it accepts only IAX lines).

In this configuration, I can connect via SIP to "testfxo" and I can hear
my voice in the tx line and I can also hear (on the SIP side) the sound
received on the rx line (but I have some echo).... this last a few dozen
seconds at which point, there's a female voice which says "100" (the name
of the repeater) and then I lost one direction of communication
(analog->SIP). This side of the communication also happened to suffer from
a delay of 1 second whereas the communication in the other direction seems
without delay.

For this setup to work, we had to polarize the analog lines by injecting
some current. I don't know if this a requirement of the FXO module itself
or if this just a signalling problem (ie app_rpt/Asterisk waits until the
line seems to be connected before starting to really communicate). (If you
know the answer, I'm interested, and if you know how to avoid this
requirement I'm even more interested ;-))

After this lengthy explanation, let me ask some questions:
- is there a way to configure app_rpt to just do the bridging without
  offering any control functions ? I bet that the delay I mentionned above
  is due to the operations made by app_rpt (DTMF decoding, etc).
  Is the non-Phone control mode supposed to be what I'm looking for?
  If yes, do you know why only IAX connections are accepted ? I tried to
  look in the code, but I didn't find any valid reason except that some
  authentication is made using IAX parameters. If this is the only reason,
  it should be easy to modify it to accept a SIP connection.
- what's the difference in behaviour between before and after the announce
  of the repeater name ?
- given my requirement I bet that I will create a new application based on
  app_rpt where I will strip most of the code and keep only the required
  parts. app_rpt is a big piece of code (>6000 lines) so if someone
  familiar with the code could point me to the most important functions to
  keep and play with, I'd be grateful.

If you have seen big mistakes in the approach that I followed, feel free
to correct me. :-)

Thank you in advance for your help. And I also wish a quick recovery to
Steve & Jim.
-- 
Raphaël Hertzog -+- http://www.ouaza.com

Freexian : des développeurs Debian au service des entreprises
http://www.freexian.com



More information about the App_rpt-users mailing list