Difference between revisions of "IAX2"

From TD-er's Wiki
Jump to navigationJump to search
 
(9 intermediate revisions by one other user not shown)
Line 1: Line 1:
 +
IAX2 is the Inter-Asterisk eXchange protocol.
 +
This is used to transport the calls between Asterisk PBX stations.
 +
 +
== Description of iax.conf ==
 +
This file is used to configure clients connecting via the Inter-Asterisk
 +
eXchange protocol. IAX is primarily used for passing calls between
 +
Asterisk servers. 
 +
 +
N.B. This is a selection from the information given in [http://www.digium.com/en/docs/asterisk_handbook/handbook-draft.pdf Asterisk Handbook (p. 61-67)]
 +
Please read other options, when looking for security-options or options regarding unstable connections.
 +
=== Keywords ===
 +
'''In the general section:'''
 +
* '''port:''' The port to listen on for incoming connections. The default is port 5036. Takes as it's argument a port number (which must not be in use by another service.)
 +
* '''bindaddr:''' If multiple IP addresses are available in the same system, this option may be set to bind Asterisk to a single interface.
 +
port = 5036
 +
bindaddr = 0.0.0.0
 +
* '''bandwidth:''' This option is used to control which codecs are used generally. Rather than allowing or disallowing specific codecs, this option may be set to 'low' to automatically avoid some codecs that don't work well in low bandwidth sitiuations. Takes an option of low or high.
 +
* '''allow:''' Specifically allow a certain codec to be used. Takes a codec, or all. Using all is the same as specifying bandwidth=high.
 +
* '''disallow:''' Specifically disallow a certain codec. See ''allow''.
 +
bandwidth=low
 +
disallow=all
 +
allow=gsm
 +
* '''register:''' Register is used to tell the Asterisk server to register with another Asterisk server. This is normally only needed if our local server has a dynamic IP address and needs to tell the other server where to find it. The format of a  register statement is:
 +
register => username:secret@server
 +
The 'secret' field is optional, if no secret has been specified on the server being connected to. If RSA encryption is in use, specify the key to send to the server with this format:
 +
register => username:[key]@server
 +
* '''tos:''' Specify the type of service bits to set on IAX packets, which may improve routing of the packets. Available values are:
 +
** ''lowdelay'': minimize delay
 +
** ''throughput'': maximize throughput
 +
** ''reliability'': maximize reliability
 +
** ''mincost'': use the lowest cost path
 +
** ''none'': use no routing flags
 +
tos = lowdelay
 +
 +
'''Options for Entities'''
 +
 +
Entity definitions begin with the entity name in brackets. The name is followed by a number of keyword/value pairs applying to the entity in which they are set.
 +
The following keywords are available for users:
 +
* '''type:''' This sets the type of entity for the client. Valid types are:
 +
** ''user'': A user can place calls to or through the Asterisk server.
 +
** ''peer'': A peer receives calls from the Asterisk server, but does not place them
 +
** ''friend'': A friend both sends and receives calls through the Asterisk server. This makes the most sense for handsets or other station devices. When in doubt use this type.
 +
* '''trunk:''' Enables or disables trunking for a given user or peer. Trunk mode is a more efficient method of operating IAX if there are typically many calls running on the link. Trunk mode requires having a Zaptel interface in the Asterisk server.
 +
trunk=yes
 +
 +
== testing IAX2 trunking ==
 +
 
Situation:
 
Situation:
  

Latest revision as of 12:18, 6 February 2007

IAX2 is the Inter-Asterisk eXchange protocol. This is used to transport the calls between Asterisk PBX stations.

Description of iax.conf

This file is used to configure clients connecting via the Inter-Asterisk eXchange protocol. IAX is primarily used for passing calls between Asterisk servers.

N.B. This is a selection from the information given in Asterisk Handbook (p. 61-67) Please read other options, when looking for security-options or options regarding unstable connections.

Keywords

In the general section:

  • port: The port to listen on for incoming connections. The default is port 5036. Takes as it's argument a port number (which must not be in use by another service.)
  • bindaddr: If multiple IP addresses are available in the same system, this option may be set to bind Asterisk to a single interface.
port = 5036
bindaddr = 0.0.0.0
  • bandwidth: This option is used to control which codecs are used generally. Rather than allowing or disallowing specific codecs, this option may be set to 'low' to automatically avoid some codecs that don't work well in low bandwidth sitiuations. Takes an option of low or high.
  • allow: Specifically allow a certain codec to be used. Takes a codec, or all. Using all is the same as specifying bandwidth=high.
  • disallow: Specifically disallow a certain codec. See allow.
bandwidth=low
disallow=all
allow=gsm
  • register: Register is used to tell the Asterisk server to register with another Asterisk server. This is normally only needed if our local server has a dynamic IP address and needs to tell the other server where to find it. The format of a register statement is:
register => username:secret@server

The 'secret' field is optional, if no secret has been specified on the server being connected to. If RSA encryption is in use, specify the key to send to the server with this format:

register => username:[key]@server
  • tos: Specify the type of service bits to set on IAX packets, which may improve routing of the packets. Available values are:
    • lowdelay: minimize delay
    • throughput: maximize throughput
    • reliability: maximize reliability
    • mincost: use the lowest cost path
    • none: use no routing flags
tos = lowdelay

Options for Entities

Entity definitions begin with the entity name in brackets. The name is followed by a number of keyword/value pairs applying to the entity in which they are set. The following keywords are available for users:

  • type: This sets the type of entity for the client. Valid types are:
    • user: A user can place calls to or through the Asterisk server.
    • peer: A peer receives calls from the Asterisk server, but does not place them
    • friend: A friend both sends and receives calls through the Asterisk server. This makes the most sense for handsets or other station devices. When in doubt use this type.
  • trunk: Enables or disables trunking for a given user or peer. Trunk mode is a more efficient method of operating IAX if there are typically many calls running on the link. Trunk mode requires having a Zaptel interface in the Asterisk server.
trunk=yes

testing IAX2 trunking

Situation:

Schematic overview of all PC's running which software.

Conference-Voice-call between 201, 202 (G711u-codec) and 301 (G711u codec) X-lite on ext. 301 was combining the conference.

  • Traffic to and from Ext. 201 is Green
  • Traffic to and from Ext. 202 is Pink
  • Traffic to and from Ext. 301 is Red
  • Traffic between Asterisk-boxes is Blue in one direction and black in the other

Used filters in I/O-graph:

Filter-Black: ip.src == 192.168.1.101 && ip.dst == 192.168.1.106
Filter-Red  : ip.src == 192.168.1.3   && ip.dst == 192.168.1.106
Filter-Green: ip.src == 192.168.1.189 && ip.dst == 192.168.1.101
Filter-Blue : ip.src == 192.168.1.106 && ip.dst == 192.168.1.101
Filter-Pink : ip.src == 192.168.1.100 && ip.dst == 192.168.1.101

Number of packets. Red was the SIP-phone combining the conference (Auto-Conference). All using G711u codec.









Wireshark-analysis of a Reinitiation IAX2-data-packet, telling the Asterisk PBX on the other side which codec is used and to which conversation it belongs. Taken from while only 1 channel was active.