3. Asterisk configuration

3.1. Modules

Make sure that the modules res_agi.so and format_sln.so are enabled on /etc/asterisk/modules.conf:

...
; Formats
load => res_sln.so
...
; Channels
load => res_agi.so
...

3.2. Extensions

On the asterisk's extensions file configuration we have to add all the radio statios for which we want incoming calls. Imagine we have two stations to connect, Munichis and Puerto Saija. Although not really necessary, it's recomendable that yout create a new context (for example: radio) for this special users.

On this example, we will asign extension 10 for munichis and 11 for puertosaija. We have to add the following lines to /etc/asterisk/extensions.conf

[radio]

; Munichis radio station
exten => 10,1,Answer()
exten => 10,2,EAGI(phonepatch.agi|-i|munichis)
exten => 10,3,Hangup

; Puerto Saija radio station
exten => 11,1,Answer()
exten => 11,2,EAGI(phonepatch.agi|-i|puertosaija)
exten => 11,3,Hangup

Outgoing extensions also use the EAGI script, so it's necessary to enable one (and only one) extension (in this example, 100) that would serve all users to make an outgoing call. Notice that the callerid will be common for all these users, since calls from radio users are anonymous. For simplicity, use the same context that you choose for the incoming calls:

[radio]

...

exten => 100,1,Answer()
exten => 100,2,EAGI(phonepatch.agi|-o)
exten => 100,3,Hangup