2talk have now launched an IAX2 Beta service aimed at customers with an ‘Asterisk’ based IP-PBX system including the following:
- Asterisk 1.2/1.4/1.6
- Trixbox
- FreePBX
- Callweaver
- Freeswitch etc.
If your IP-PBX, gateway or phone supports the IAX2 protocol then it should be compatible with 2talk’s IAX2 service. IAX2 has a number of advantages over the SIP protocol including:
- IAX2 trunking is more efficient with your Internet bandwidth when making multiple calls - often using less than half the bandwidth of the equivalent SIP calls using the same voice codec. For example eight G.729 calls using SIP will use around 250kbps with SIP but less than 100kbps using IAX2 trunking.
- With IAX2 it is easier to connect to 2talk when behind a router or firewall as a single port number is used for both signalling (call setup information) and media (voice traffic). This removes the complexity of traversing some problematic firewalls etc. and removes problems with no audio or one way audio etc.
- DTMF traffic is always out of band removing any confusion about which DTMF method to use
For more benefits of IAX2 over SIP visit:
http://www.voip-info.org/wiki/view/IAX+versus+SIP
To use the 2talk IAX2 Beta Service you need to connect to ‘iax.2talk.co.nz’ (rather than 2talk.co.nz). Below is a basic example configuration in the Asterisk ‘iax.conf’ file where the customer phone number is 099749000 and password is ‘mypassword’. Obviously you replace these with your own phone number and password.
[general]
bandwidth=low
disallow=all
allow=gsm
allow=alaw
allow=ulaw
allow=ilbc
trunkfreq=20
trunktimestamps=yes
tos=ef
register =>
099749000:mypassword@iax.2talk.co.nz
[099749000]
type=friend
username=099749000
trunk=yes
context=from-trunk
(* See below note on context)
host=iax.2talk.co.nz
secret=mypassword
auth=md5
disallow=all
allow=gsm
allow=alaw
allow=ulaw
(specify your own codec preferences in the allow’s here)
* If your context for incoming calls is not
‘from-trunk’ then you will need to login to 2talk live and change your
‘IAX2 context’ under the ‘Preferences’ column and ‘Voice Quality &
Networking’ section. Here you can specify your own context string
used
for incoming IAX2 calls. By default Trixbox/FreePBX servers tend
to
use ‘from-trunk’ which is why we have made this the default context
setting for IAX2 trunks.
NOTE: If you wish to have multiple numbers presented over IAX2 then you need to create a ‘register’ and ‘peer’ entry for each number in your IAX configuration file since each line on your account acts independantly.
Trixbox Settings
Trixbox configuration is done slightly differently than standard Asterisk configurations. Below is an example IAX2 configuration for Trixbox (Version 2.6.2) sent through by a user. Obviously you will need to change the phone number 099749000 and password 'mypassword' to be your own 2talk phone number and password. The example also assume g729 is used as the codec. If you do not have a license for this codec then substitute this for gsm, alaw or ulaw etc.:
[Peer Details]
username=099749000
type=friend
secret=mypassword
nat=route
insecure=very
host=iax.2talk.co.nz
fromuser=099749000
disallow=all
trunk=yes
context=from-trunk
canreinvite=no
bandwidth=low
allow=g729 ; Replace the codec with gsm or alaw if you do not have the g729 codec supported
requirecalltoken=no ; Required for Asterisk 1.6 compatibility
[User Details]
username=099749000
type=friend
secret=mypassword
nat=route
insecure=very
host=iax.2talk.co.nz
context=from-pstn
[Registration]
099749000:mypassword@iax.2talk.co.nz
Trixbox 2.8 settings
A customer using Trixbox 2.8 has also posted the following simplified instructions. Update your iax_additional.conf settings and add the following (replacing 099749000 with your own 2talk number and mypassword with your own password). This was generated with the "OutGoing" section of the trunk dialog. "Incoming" was left blank. Neverless, it receives incoming calls because the type=friend.
[099749000]
host=iax.2talk.co.nz
username=099749000
secret=mypassword
type=friend
requirecalltoken=no
context=from-trunk
trunk=yes
allow=g729 ; Replace the codec with gsm or alaw if you do not have the g729 codec supported
Also a couple of other points to note:
- If you have previously enabled ‘SIP trunking/peering’ on your account then you first need to disable this to use the IAX2 trunking service since SIP trunking takes precedence over the IAX2 routing.
- You MUST name your IAX trunk the same as your username. So if your 2talk login name is 099749000 then you should also name your trunk this as well. Using a separate name for your trunk/peer definition will cause problems with calls.
- You should also put an explicit ‘context=xxxx’ line (where xxxx is your preferred context) in your peer definition. (NOTE: Also be aware that there seems to be a bug some freepbx versions whereby if you change ONLY the context line in your IAX trunk definition, it doesn’t write the changes out to the iax_additional file and if your context doesn’t match up with the 2talk context, then calls will be rejected)
You then need to update your dial plan and replace the ‘Dial’
command(s) to use IAX2 instead of SIP. For example:
exten =>
_X.,1,Dial(IAX2/099749000/${EXTEN})
NOTE: You should disable any SIP registrations to 2talk on the same
phone numbers otherwise the call may not be delivered by IAX2.
Please
also remember that the 2talk IAX2 trunking service is a BETA service -
so please report any problems you have to support@2talk.co.nz. If
you
want a stable production system then you are better using SIP to
connect to 2talk until the IAX2 service comes out of Beta.