Peering Switchvox and Asterisk using IAX

Peer Asterisk and Switchvox systems together to allow users in different offices use internal extensions.

Asterisk Configuration

Asterisk has been configured via FreePBX.

# cat /etc/asterisk/iax_additional.conf
[switchvox]
host=switchvox.example.com
username=asterisk
secret=passwd
type=friend
qualify=yes
qualifyfreqok=25000
transfer=no
trunk=yes
auth=md5
encryption=yes
context=from-internal
# cat /etc/asterisk/iax_general_additional.conf
mailboxdetail=yes
tos=ef
disallow=all
allow=alaw
allow=ulaw
allow=gsm
requirecalltoken=no
calltokenoptional=0.0.0.0/0.0.0.0
codecpriority=host
delayreject=yes
language=uk
jitterbuffer=no
minregexpire=60
maxregexpire=3600
pbx*CLI> iax2 show peers
Name/Username    Host           Mask             Port          Status    
switchvox/aster  54.X.Y.Z  (S)  255.255.255.255  4569 (T)  (E) OK (35 ms)
1 iax2 peers [1 online, 0 offline, 0 unmonitored]

Switchvox Configuration

Provider Information

IAX Provider Name: AsteriskPBX
IAX Provider Label: asterisk
Your Account ID: switchvox
Your Password: passwd
Hostname: asterisk.example.com
Callback Extension: N/A
Incoming Authentication Type: MD5

Peer Settings

Host Type: Peer
Apply Incoming Call Rules to Provider: NO
Host is a Switchvox PBX: NO
Passthrough Outgoing Call Rules: Internal (Any local extension)

Connection Settings

Qualify Hosts: YES
Enable Trunbking: YES
Use RSA Authentication of Outgoing: NO

Call Settings

Audio Codecs: ULAW, ALAW, GSM
Enable Jutterbuffer: NO

Firewall

Make sure Asterisk and Switchvox servers can reach each other via UDP port 4569.

Troubleshooting

CallToken Support Required

To fix the following error:

ERROR[2153] chan_iax2.c: Call rejected, CallToken Support required. If unexpected, resolve by placing address 54.X.Y.Z in the calltokenoptional list or setting user switchvox requirecalltoken=no

Add the lines below to /etc/asterisk/iax_general_additional.conf:

requirecalltoken=no
calltokenoptional=0.0.0.0/0.0.0.0

Incoming Call is Unencrypted

If you have a forceencryption=yes set on Asterisk, you may find yourself into this trouble:

NOTICE[2152] chan_iax2.c: Call Terminated, Incoming call is unencrypted while force encrypt is enabled.

References

http://kb.digium.com/articles/Configuration/Peering-Switchvox-and-Asterisk-using-IAX

Leave a Reply

Your email address will not be published. Required fields are marked *