IAX
The IAX channel module (yiaxchan) has a configuration file for IAX Protocol in Yate called: yiaxchan.conf.
This module is a VoIP IAX2 driver based on ours Yiax library.
Using the default configuration for this file Yate will act as a IAX Server.
Yate can be used as a IAX Server and also as a IAX Client by using YateClient see more on how to make this setups.
Contents |
Trunking
IAX trunking means that audio data between 2 peers (same ip/port) can be combined into a single packet for multiple calls.
E.g. an entity wanting to send trunked media packets from local ip 1.2.3.4:4569 to 1.2.3.5:4569 would gather media packets from multiple calls into a single packet and send it when a certain amount of time had ellapsed or the packet had reached some length limit.
It is essential to understand that trunking can occur between same local/remote ip/port: packets for calls with different local or remote ip/port can't be put together in a trunked packet.
The advantage of using trunking is to lower the bandwidth: the number of sent packets decreases leading to lower IP overhead.
In the next images the green, blue and red rectangles represents audio packets sent by different IAX calls.
The images show how audio packets are sent without trunking and with trunking.
Note: The order of audio packets inside a trunked packet is not important.
For all calls the remote party can send trunked audio frames.
They will be handled automatically, there is no configuration for it.
To send trunked frames each call must be configured explicitly, as we can see below for incoming and outgoing calls.
Outgoing calls
- The 'call.execute' message must have a trunkout=true parameter
^200$=iax/diana@10.0.0.1:4569/123;trunkout=true
Incoming calls
- A trunkin=true parameter must be set when routing or executing an incoming IAX call:
[contexts] ${module}iax=if ${ip_host}^10\.0\.0\.1=;trunkin=true
- or
[default] ^300$=sip/sip:1234@1.2.3.4;trunkin=true
Configuration
File yiaxchan.conf:
[general] ; This section sets global variables of the implementation ; port: int: UDP port for incoming connections ;port=4569 ; addr: ipaddress: IP address to bind to ;addr=0.0.0.0 ; force_bind: boolean: Try to use a random port if failed to bind on configured one ; Defaults to yes ;force_bind=yes ; calltoken_in: boolean: Use call token ip address authentication on incoming calls ; Note: If the caller don't support the call token IAX extension the call request ; will be ignored anyway ; This parameter is applied on reload ; Defaults to no ;calltoken_in=no ; calltoken_out: boolean: Offer call token ip address authentication on outgoing calls ; This parameter is applied on reload and can be overridden from routing ; Defaults to yes ;calltoken_out=yes ; calltoken_rejectmissing: boolean: Reject incoming calls without call token support ; when calltoken_in is enabled ; If disabled the requests will be ignored (dropped) ; This parameter is applied on reload ; Defaults to yes ;calltoken_rejectmissing=yes ; tos: keyword: Type Of Service to set in outgoing UDP packets ; numeric TOS value or: lowdelay, throughput, reliability, mincost ;tos=0 ; read_threads: int: Number of threads that read packets from socket ;read_threads=1 in client mode, 3 in server mode ; event_threads: int: Number of threads that process events ;event_threads=1 in client mode, 3 in server mode ; trunk_threads: int: Number of threads that service trunked voice packets ;trunk_threads=1 ; thread: keyword: Default priority of the data service threads (socket listener and data trunking) ; Can be one of: lowest, low, normal, high, highest ; It is a bad idea to set a low priority for anything but testing ;thread=normal ; maxchans: int: Maximum number of channels running at once ; A value of 0 specifies that there is no limit enforced. ; Defaults to the value set by the maxchans setting from yate.conf ;maxchans= ; printmsg: boolean: Print sent/received frames to output if the module's debug ; level is at least 9 ; This parameter is applied on reload ; Defaults to yes ;printmsg=yes [registrar] ; Controls the behaviour when acting as registrar ; expires_min: int: Minimum allowed expiration time in seconds ; This parameter is applied on reload ; Minimum allowed value is 1 ; Defaults to 60 if missing ;expires_min=60 ; expires_max: int: Value used to limit the expiration time to something sane ; This parameter is applied on reload ; Minimum allowed value is the value set in expires_min ; Defaults to 3600 if missing ;expires_max=3600 ; expires_def: int: Default expiration time if not present in register requests ; This parameter is applied on reload ; The value is checked to be between expires_min and expires_max ; Defaults to 60 if missing ;expires_def=60 [formats] ; This section allows to individually enable or disable the codecs ; default: bool: Default enabling state for codecs ;default=enable ; preferred: string: Preferred format to use ;preferred= ; slin: bool: Uncompressed 16-bit signed linear ;slin=enable ; mulaw: bool: Companded-only G711 mu-law ;mulaw=enable ; alaw: bool: Companded-only G711 a-law ;alaw=enable ; gsm: bool: European GSM 06.10 ;gsm=enable ; lpc10: bool: LPC 10 ;lpc10=enable
Routing a IAX channel
From a routing module you can call an IAX channel like this:
extension=iax/iax:user@ip:port/called_number
For example, in regexroute.conf you can have:
^200$=iax/iax:diana@10.0.0.1/123
if you want to use the default protocol port (4569), or:
^200$=iax/iax:diana@10.0.0.1:4570/123
if you know that the called party is using the given port for incoming connections.
Notes
- The port you set it's the port the library is using to listen for incoming connections. If you change the default protocol port the callers might not know the new one, so any call they made will fail.
- When you set a route, be sure you know the destination's port. Again, if the port is incorrect the call will fail.
- If you set the preferred format to a non existing or not enabled one another format will be chosen for library use.
See also