Daily Archives: July 8, 2010

Radio amateur and Asterisk (chan_alsaradio.c part 2)

In the previous article I explained just few bits about Asterisk and app_rpt and how I came to the conclusion to build another channel driver for app_rpt.

The idea behind is that I wanted to make a channel driver that uses a general purpose sound card for media path and serial port for signaling. If the card has a driver for Linux then ALSA (Advanced Linux Sound Architecture) will provide an abstraction of it so that the channel driver will not depend on the specific sound card type.

On the signaling side, the serial port is used to send PTT signal and receive COR (or COS) and CTCSS from an external decoder (if needed only). The simplest serial interface to the radio station is presented bellow:

It does not use the right levels for RS232 interface but it will work with the serial ports of modern computers as long as the PTT and COR are not stressed with high data rate (this is unlikely anyway). I will provide later on an interface that will make use of optocouplers for isolation of signals and audio transformers for isolation of media path.

Audio signals (media path) are connected form the audio output of the rig to soundcard input and from soundcard output to rig microphone input.

The new channel driver is called alsaradio and corresponding module is named chan_alsaradio.so. Like all the other channel drivers it has a configuration file in which one could give various options. Here is a typical alsaradio.conf file which should be placed where all asterisk config files are: /etc/asterisk/

alsaradio.conf

[ard0]

input_device=plughw:0,0

output_device=plughw:0,0

serial_device=/dev/ttyS0

[general]

carrierfrom=serialdsr

You should use appropriate values for your input_device and output_device parameters according to configuration of your sound card.

Here is a relevant portion from rpt.conf that uses the alsaradio channel driver:

rpt.conf

[xxxxxx – here is your node number]

rxchannel=alsaradio/ard0

Here is a echolink.conf that will make app_rpt communicate with Echolink servers:

echolink.conf

[el0]

confmode=no

call=YO3IIU

pwd=your Echolink password

name=your name

qth=your qth

email=your e-mail

maxstns=20

rtcptimeout=10

node=your node number

context=radio-secure

server1=server1.echolink.org

server2=server2.echolink.org

server3=server3.echolink.org

If you’ve proper configured the app_rpt, alsaradio and echolink and connected the radio to the PC then you should be able to key in and dial using DTMF a number from another radio tuned to the frequency of your main radio. Alsaradio is able to decode the DTMF and send them to app_rpt. For example if you want to connect to *ECHOTEST* (node number 9999) you should dial:

*33009999

I will explain later about how various nod numbers could be dialed using DTMF commands.

irlp.conf

node =stn5667  #the IRLP node number you will obtain during installation

call=yo3iiu

rtcptimeout=10

localispeakerport=2174

radmod=no

audioport=2074

context=radio-secure

astnode=27235 #your Allstarlink node number

Dialing an IRLP number like 9500:

*349500

if you obtained an Allstarlink node number too, you would be able to dial for example number 27235 with the following command:

*327235

Radio Amateur and Asterisk (chan_alsaradio.c part 1)

Couple of months ago I’ve been looking for open source software that a radio amateur could use. I came across app_rpt that is an application for Asterisk with many many interesting features. What is Asterisk then? Asterisk is an open source telephony software that knows many telecom protocols, SIP, MEGACO, IAX (Asterisk own VoIP protocol) just to name a few.

In Asterisk one can distinguish applications and channels although from programmer point of view there is no difference, both being shared libraries.

Channels are the ones used to get or to send calls to/from Asterisk although Asterisk does not distinguish between FXO (Foreign eXchange office) and FXS (Foreign eXchange Station). Applications could do whatever they want with data gotten from the channels it connected to.

Looking at the features Asterisk provides one could imagine at least couple of use cases for Asterisk and its usage in ham radio. Basically the Asterisk could be seen as a PBX able to communicate with other exchanges via various physical links and protocols while locally it can be connected to a radio station.

Now speaking about app_rpt application, it is initiated by Jim Dixon WB6NIL and its intention is to supply a full software repeater package with all modern repeater and remote base functionality included. It’s home with full details and options is here:

http://app-rpt.qrvc.com/

How app_rpt works: the communication with radio station is through a channel driver that uses specific hardware:

– Quad PCI adapter

or

–  CM108 chip USB soundcard with some GPIO pins for signalling like PTT, COR, CTCSS decoding.

App_rpt does not provide only standalone repeater controller functionality but also is able to be integrated into networks like Echolink and IRLP through corresponding channel drivers (chan_echolink.so and chan_irlp.so)

My situation is that I do not own any of the hardware that app_rpt is able to work with nor able to buy them easily. Therefore I decided to implement a simpler interface for my radio station based on ALSA and use serial port for signalling.