• Idefisk
  • Tools
  • Tutorials
  • Reviews
  • VoIP Providers
  • Archives
ZOIPER softphone
Back to Tutorials

6.20. iax.conf

1. IAX channel
 

The file is located in the /etc/asterisk/ directory.

There are two ways of displaying IAX (Inter-Asterisk eXchange) channels in Asterisk. The first one is when you make ougoing call (Outgoing). The second one is for incominng calls (Incoming).

1.1 Outgoing

IAX2/[<user>[:<secret>]@]<peer>[:<port_number>][/<extension>[@<context>][/<option>]]

<user> and <secret> are used for username and the password on the server represented by <peer> at port <port_number>. <extension> is used to request a specific extension number, which exist in <context> context. You can define optionally special connection option (<option>) &#8211; at this time you can use only a for &#8220;request auto answer&#8221;.

1.2 Incoming

IAX2/[[<username>@]<host>]/<call_number>

If the username (<username>) is known, it will be displayed. <host> is the address from which is coming the call. <call_number> is the number of local call.


2. iax.conf (CVS-HEAD-07/30/05)
 

Inter-Asterisk eXchange (IAX) configuration file is divided in contexts. The context [general] contains general settings for the IAX protocol, like on which port Asterisk will listen, to use jitterbuffer, which audio codecs are allowed and which are disallowed, etc ...

Every other context is consider for user account configuration. But what is context?
Context is the group of context name and all of the following after that name lines (the end is the begining of new context):

Example:
start-->[my_first_context]
           option1=something
           ......
end--->
            [my_second_context]
            option1=something
            .....

2.1 context [general]

All possible options that can be find in this context:

bindport <port_number> Port number to bind to (default 4569).

example: bindport=4569

bindaddr <ip_address> IP address to bind to (default is to bind to local address)

example: bindaddr=192.168.0.1

iaxcompact yes | no If you are using layered switches, set this option to &#8216;yes&#8217; to get a small performance hit.

example: iaxcompact=no

nochecksumYes | no Disable UDP checksums (if nochecksums is set, then no checkums will be calculated/checked on systems supporting this feature)

example: nochecksum=no

delayreject yes | no To increase security against brute force attacks, enable this option. It will delay the sending of authentication reject for REGREQ or AUTHREP.
example: delayreject=yes

amaflags default | omit | billing | documentation This flags are used for generation of iaxtel call detailed records.
example: amaflags=default

accountcode <some_code> To use default account code except the per-user accounting.

example: accountcode=12test45

language <country_code> You can set a default language for all users. Of course you can set per-users basis.

example: language=en

bandwidth low | medium | high With this option you can control which codecs to be used

example: bandwidth=low

allow <codec_name> | all To allow all codecs or specified one. If you are going to enable specific codec/codecs first you must use &#8216;disallow=all&#8217;.

example: allow=lpc10

disallow <codec_name> | all To disallow specific or all codecs.

example: disallow=all

Codecs that can be used in allow/disallow options:
g723.1	g729	h263	slinear	  gsm	alaw	adpcm
g726	  h261	  lpc10	  speex	  ilbc	    ulaw

jitterbuffer yes | no If you want to use jitter buffer, set this option to &#8216;yes&#8217;.

example: jitterbuffer=yes

forcejitterbuffer yes | no This option is used when we have endpoints with poor jitterbuffers, so this option will force Asterisk to jitterbuffer always.

example: forcejitterbuffer=no

dropcount <number> It represents what maximum number of frames can be &#8216;too late&#8217; for the last 2 seconds. It is advised to set to lower number (3 represents 1,5% of frames dropped).

example: dropcount=3

maxjitterbuffer <number> The size of the jitter buffer. Set to reasonable number.

example: maxjitterbuffer=500

maxexcessbuffer <number> If the network delay improves after a period of high jitter, it is possible that the buffer is to bigger than necessary. So if the buffer is above than maxexcessbuffer, Asterisk will start to decrease the amount of the jitter buffer

example: maxexcessbuffer=80

minexcessbuffer <number> This represents the minimum space reserved for the jitter buffer. If the jitter buffer is below this amount, Asterisk will start to increase the amount of the jitter buffer.

example: minexcessbuffer=10

jittershrinkrate <number> This is the milliseconds that are required to shrunk/enlarged the jitter buffer. Use small number, or else you will hear it changing.

example: jittershrinkrate=1

trunkfreq <number> How frequently to send trunk messages (in milliseconds).

example: trunkfreq=20

trunktimestamps yes | no If this option is set, we are going to send timestamps for the individual sub-frames within trunk frames. NOTE: The receiver must also support this feature.

example: trunktimestamps=yes

register <user>[:<password>] @ <remote_host> [:<port>] To register with another IAX server.

example: register => jo:pass@example.net:5506

authdebug yes | no Disable the authentication debuggin to reduce the amount of the debugging traffic.

example: authdebug=no

tos lowdelay | throughput | reliability | mincost | none Setting the TOS bits to improve the performance. (For description look at the table below).

example: tos=lowdelay

Possible TOS settings:
lowdelay:        Minimize delay
throughput:     Maximize throughput
reliability:        Maximize reliability
mincost:	      Minimize cost


mailboxdetail yes | no If set to &#8216;yes&#8217; user receives the actual new/old messages counts. This can e set per-peer basis.

example: mailboxdetail=yes

regcontext <string> If regcontext is specified, Asterisk will dynamically create and destroy a NoOp priority 1 extension for a given peer who registers or unregisters with Asterisk PBX.

example: regexten=iaxregistrations

autokill yes | no | <milliseconds> If we don't get acknowedge packet (ACK) in 2000ms and this option is set to 'yes', then we cancel the whole thing. Except yes and no, we can specify the timeout in milliseconds.

example: autokill=yes

codecpriority caller | host | disabled | reqonly This option controls the codec negotiation of inbound IAX call. If this option is set in the user individual context, it will override the setting in the context general. There is explanation of all possible options for this settings below.

example: codecpriority=host

Codecpriority options:

caller:    Consider the callers preferred order ahead of the host's.
host:       Consider the host's preferred order ahead of the caller's.
disabled:    Disable the consideration of codec preference alltogether.
              (this is the original behaviour before preferences were added)
reqonly:     Same as disabled, only do not consider capabilities if
               the requested format is not available the call will only
              be accepted if the requested format is available.

rtcachefriends yes | no Cache realtime friends by adding them to the internal list just like friends added from the config file only on a as-needed basis.

example: rtcachefriends=yes

rtnoupdate yes | no Do not send the update request over realtime.

example: rtnoupdate=yes

rtautoclear yes | no | <seconds> Auto-Expire friends created on the fly on the same schedule as if it had just registered when the registration expires the friend will vanish from the configuration until requested again. If set to an integer, friends expire within this number of seconds instead of the same as the registration interval.

example: rtautoclear=yes



2.2 context [some_user]

All possible optoins that can be set for individual user:

type user | peer | friend To set the type of the user: friend (allow user to make calls and to be called), peer (user can be only called) or user (user can call only).

context <string> Sets the incoming context fot his user.

auth plaintext | md5 | rsa IAX supports three methods for authentication. Plaintext - is the least secure.Md5 - it uses md5 algorithm to confirm the authentication. RSA - is the most secure one. It uses public/private encryption key, that can be generated by astgenkey application (public key must be manually transferred to the server need put in /var/lib/asterisk/keys/<name>.pub, the private keys are placed in /var/lib/asterisk/keys/<name>.key)

secret <password> This is the authentication password for that user.

disallow <codec_name> | all Same as the option in context general.

allow <codec_name> | all Same as the option in context general.

setvar <some_var>=<some_value> We can set some variable.

dbsecret <familiy>/<key> The authentication password can be stored also in the Asterisk database (astdb).

callerid <string> Specify the Caller ID string that will be used for this user.

inkeys <key> The public keys used to decrypt authentication for the incoming client requests.

outkeys <key> The private key used to encrypt the outgoing requests for this user.

permit <ip_addr> | <network_addr> Permit IP address/network for incoming calls.

deny <ip_addr> | <network_addr> Deny IP address/network for incoming calls.

host <ip_addr> | dynamic You can set static IP which will be associated with this account or to use dynamic one (dynamic).

mask <network_mask> Subnet mask for the host.

defaultip <ip_addr> IP address to be used before registration.

accountcode <string> Billing account code.

qualify yes | no| <value> Check this user for availability. The <value> is in milliseconds.

mailbox <mailbox>@<context> Voicemail box for this account.

trunk yes | no If set to yes,it will be used IAX2 trunking for this context.

notransfer yes | no To disable IAX native transfer, set this option to no.

peercontext <string> Default context to request for calls to peer.

regexten <extension> After registration what extensions to be added.

jitterbuffer yes | no We can turn on/off jitterbuffer individually for every user.


3. Sample configuration
 

To test the below IAX configuration, we need a softphone that supports IAX - like Idefisk (download | manual). Also we need some extenesion numbers, if you are unfamiliar with extensions.conf please take a look at this tutorial.

iax.conf:

[general]
bandwidth=low
disallow=lpc10
jitterbuffer=no
forcejitterbuffer=no
tos=lowdelay
autokill=yes

[guest]
type=user
context=test
callerid="Guest IAX User"

[anatoliy]
callerid=Anatoliy K.
username=anatoliy
secret=anatoliy
type=friend
host=dynamic
context=test
disallow=all
allow=ulaw
allow=alaw
allow=gsm

[ivan]
callerid=Ivan T.
username=ivan
;secret=ivan
dbsecret=Password/ivan_iax
type=friend
host=dynamic
context=test

[iax-test]
type=peer
username=iax-test
host=dynamic
trunk=yes
context=test

extensions.conf:

[general]
static=yes
writeprotect=no
autofallthrough=yes

[globals]
;none

[test]
exten => ivan,1,Dial(IAX2/ivan)
exten => ivan,2,HangUp()
exten => 100,1,Goto(ivan,1)

exten => anatoliy,1,Dial(IAX2/anatoliy)
exten => anatoliy,2,HangUp()
exten => 101,1,Goto(anatoliy,1)

exten => iaxtest,1,Dial(IAX2/iax-test)
exten => iaxtest,2,HangUp()
exten => 102,1,Goto(iaxtest,1)

 
Download the sample configuration files for this tutorial from here: iax_conf.tar.gz
To install them, just make backup copy of your extensions.conf and iax.conf, and then unpack.

 
User Comments
Teariva (impulgepe at mailsphere dot space)
26 May 2024 14:53:24
Ehrlich gesagt habe ich in meiner gesamten Karriere noch niemanden getroffen, der von der Wirkung dieses Medikaments enttäuscht wäre <a href=http://cialis.lat/discover-the-best-prices-for-cialis>buy cialis online from india</a>
PennymaMl (v dot i dot ktor dot s dot h dot ultsp dot o dot ch dot t dot a dot 29 dot 07 dot 19 dot 9 dot 0 at gmail dot com)
28 November 2022 19:41:11
essay buy
<a href=https://buytopessays.com>help me write a essay</a>
best essay writing service canada
EachellemaMl (v dot ikto dot r dot s dot hult dot s dot poch dot ta290 dot 7 dot 1 dot 990 at gmail dot com)
18 September 2022 08:15:45
single seniors dating sites
<a href=https://wowdatingsites.com>st Р°ugstine fl book matches online dateing</a>
single woman dating for free
MavismaMl (vi dot k dot t dot o dot rs dot hultsp dot och dot t dot a2 dot 9 dot 0719 dot 9 dot 0 at gmail dot com)
15 September 2022 05:33:14
dating wites
<a href=https://online-internet-dating.net>onlinelovedating</a>
dating sjtes
MindymaMl (v dot i dot k dot to dot rsh dot u dot ltspo dot c dot hta dot 290719 dot 90 at gmail dot com)
12 September 2022 11:41:42
gay dot com chat room
<a href=https://newgaychat.com>ontario calif gay chat room</a>
freee gay chat
AshleighmaMl (v dot i dot k dot to dot r dot shu dot lts dot poch dot t dot a2 dot 9071990 at gmail dot com)
12 August 2022 03:36:49
business vpn
<a href=https://ippowervpn.net>free trial vpn</a>
best 100% free vpn
TrudeymaMl (vikt dot or dot sh dot u dot lt dot s dot p dot o dot c dot h dot t dot a2 dot 90 dot 7 dot 1990 at gmail dot com)
21 July 2022 17:15:47
fun critical thinking questions with answers
<a href=https://criticalthinking2020.net>critical thinking introduction</a>
critical thinking com
Lbgsoymn (wilfrdbdgd3phi at gmail dot com)
27 January 2021 19:30:27
pay for viagra with paypal <a href="http://genqpviag.com/#">viagra over night shipping</a> viagra cheap online order http://genqpviag.com/ - viagra melbourne victoria ’
hydroxychloroquine generic brand (harrisonatchley at lethau dot ga)
08 September 2020 08:37:48
hydroxychloroquine generic brand https://chloroquine1st.com/
_____ (alexis_sleigh7 at diggle dot walletonlineshop dot com)
15 July 2020 22:41:04
I could not resist commenting. Very well written! https://uricasino114.com
BradleyGof (novital2019 at mail dot ru)
03 January 2020 07:12:16
Натуральные средства для увеличения эрекции https://big-penis.com.ru/80.html - Мощное ! Укрепление мужского здоровья.!..
Clarkzes (jayjohnson93 at gmx dot com)
16 July 2019 04:32:48
Free Local Sex - Find Women Looking For Sex: http://bit.do/eYPkD?dBY4dLk5GRiLN
Ghina (q65ux1azj9f at outlook dot com)
18 December 2015 10:03:17
Kyle Korver. He plays for the Bulls now. I may or may not have a full size card board cut out of him in my room. He might not be the best player but I sure do like to look at him.
khanh (khanh_vctl at yahoo dot com)
05 January 2008 11:39:48
I have configured following your instruction but my two asterisks haven't connected together and it released error: "auto_congestion is due to low responsibility". Could you give me solution for this situation. Thank you so much.
nabeel (nabeel at convergence dot pk)
04 December 2007 08:39:29
what kind of this warning show explain plzzz WARNING[611]: chan_iax2.c:1760 attempt_transmit: Max retries exceeded to host 192.168.200.123 on IAX2/104-30 (type = 6, subclass = 11, ts=3138185, seqno=76)
Shiju Joseph (letterstack at gmail dot com)
18 September 2007 16:42:18
Hi,

How we can add jitterbuffer to individual iax trunks , can we add it in iax_additional.conf?

do we need to give command "iax2 set jitterbuffer" from asterisk cli?

Regards
Shiju V.Joseph
dhiraj (2dhiraj at gmail dot com)
26 March 2007 06:37:20
I have to public ip and asterisk is running in nat mode on both the ip.these two asterisk is not able to communicate with each other. I have tried with sip.conf and not used iax.conf. If iax.conf works then please send me configuration example.
amjad ali amjad (amjadse at yahoo dot com)
26 January 2007 00:26:45
asterisk is no doubt a nice pbx and the asteriskguru is really a guru fro nice learners.
amjad ali amjad (amjadse at yahoo dot com)
26 January 2007 00:21:39
asterisk is no doubt a nice pbx and the asteriskguru is really a guru fro nice learners.
Arben Myrtaj (info at dimal dot com dot al)
30 December 2006 14:38:06
I am trying to use G723 on asterisk and it says no compatible codecs.
Should I buy a license for that ? If yes where can I buy it.
Ezio Vernacotola (ezio2 at uptime dot it)
12 November 2006 22:05:11
There is a typo on notransfer option comment.

notransfer yes | no

As the name suggests to disable IAX native transfer you must set this option to yes
ZABIII (zabiiiiii at hotmail dot com)
12 October 2006 01:00:46
plz help me with this .. i always have error with IAX2/vitel-outbound-1 is ciruuit-busy .. always when i reboot ..
rudra narayan acharya (rudra_ach at yahoo dot com)
26 September 2006 16:31:32
Hi,

I'm experimenting asterisk in a dialup environment.But I get lot of voice breaks while there is a conversation between two remote extentions.Is there any way to reduce that.As jitter buffer is one of the solution but it only works with iax trunk.

thanks
rudra
zhiyong (zhiyong dot m at gmail dot com)
13 September 2006 14:59:01
I use IAX2 trunk between two asterisk server.
At a few calls (less than 30) enviornment, both caller and callee can hear each other clearly. But when calls reach 45 or above, the quality of sounds is bad.

I wonder if a IAX2 Trunk should limit concurrent calls?

I use ILBC codec in the trunk.

any idea?

btw: I use asterisk-1.2.12, zaptel-1.2.8
Elmer (elmer at diavox dot net)
06 September 2006 14:52:40
Hi,

I am new to asterisk and linux. I installed asterisk and already configured SIP extensions and IAX. I made some calls already from a hard phone to E-lite and vice versa. But all of a sudden, I am receiving the error below. I could not call any more from the hard phone. Below is the error message. Thank you. I really need to resolve it urgently.

NOTICE[3537]: chan_iax2.c:6522 socket_read: Rejected connect attempt from 192.3.33.74, who was trying to reach 'TBD@'
effendi (effhal at freebsd dot or dot id)
25 July 2006 08:44:37
is that any possibility for iax use as trunk protocol between asterisk server? but from asterisk server to the client still use sip as a signalling protocol. thanks for the answer
Wolfgang Alper (wolfgang dot alper at altrust dot de)
29 April 2006 10:06:27
Mike,
IAX2 is perfect to connect several asterisk servers. The configuration is quite easy. All it needs is a peer and user account on each system. The advantage i see in comparison to SIP is, that IAX2 is really firewall friendly. Just open one UDP port and you are set.
Mike Keizer (mickel_keizer at bluewin dot ch)
04 April 2006 12:59:40
I'm wondering why I don't seem to find a good example where IAX connects several asterisk servers including a dial plan. Isn't IAX supposed for that? It's called Inter Asterisk Exchange isn't it? Besides that why would I want to use IAX for a telephone? There is SIP, MGCP, Skinny you name it. Do we realy need another (none standard) protocol for telephones?
Eric De Ron (eric dot de_ron at skynet dot be)
18 August 2005 09:58:41
Type=user/peer/friend
It seems that a channel od type "user" cannot be a host="dynamic".
The registration fails.
If the definition of a user is "may only call", I wonder why a user cannot register
Thanks for an answer.

 
Add Comment
Name:
Email:
Comment:
In order to prevent automatic posting on our website, we kindly request you to type in the number you see in the picture below.
Image Verification:
 

Latest Headlines:

  • T.38 faxing with Zoiper 2.15 is now easier than ever
    section: voip software
  • Asterisk 1.4.21 Released
    section: Asterisk
  • Asterisk 1.4.20 Released
    section: Asterisk
  • Asterisk 1.4.20-rc2 Released
    section: Asterisk
  • Asterisk 1.4.20-rc1 Now Available
    section: Asterisk
  • News Archives (older news)

Latest Tutorials:

  • Sending Fax from Zoiper to Zoiper using T.38
    added 08/Dec/2008 18:16
  • VMAuthenticate (dialplan application)
    added 01/Mar/2008 15:57
  • Siptronic ST-530
    added 06/Nov/2007 17:57
  • Siemens C455 IP hardphone
    added 05/Nov/2007 10:24
  • Zoiper
    added 22/Oct/2007 17:53

Latest Comments:

  • https://www.facebook.com/media/set/?vani...
    tutorial: Read (dialplan application)
  • https://nirakkiattiyotep1.graphy.com/cou...
    tutorial: General Installation
  • https://github.com/topmovee/achaacha/dis...
    tutorial: Read (dialplan application)
  • https://www.fimfiction.net/blog/1120729/...
    tutorial: Installation of Asterisk GUI
  • https://www.fimfiction.net/blog/1120662/...
    tutorial: Installation of Asterisk GUI
 
contact us at: support@asteriskguru.com - asterisKGuru.com © all rights reserved   |   *asterisk is registered trademark of © Digium™