IAX
(→IAX channel) |
|||
Line 5: | Line 5: | ||
From a routing module you can call an IAX channel like this: | From a routing module you can call an IAX channel like this: | ||
− | extension=iax/iax:user@ip:port/called_number | + | extension=iax/iax:user@ip:port/called_number |
For example, in regexroute.conf you can have: | For example, in regexroute.conf you can have: | ||
Line 65: | Line 65: | ||
File yiaxchan.conf: | File yiaxchan.conf: | ||
− | |||
− | |||
− | |||
− | |||
− | ; port: int: UDP port for incoming connections | + | [general] |
− | ;port=4569 | + | ; This section sets global variables of the implementation |
− | + | ||
− | ; addr: ipaddress: IP address to bind to | + | ; port: int: UDP port for incoming connections |
− | ;addr=0.0.0.0 | + | ;port=4569 |
− | + | ||
− | ; force_bind: boolean: Try to use a random port if failed to bind on configured one | + | ; addr: ipaddress: IP address to bind to |
− | ; Defaults to yes | + | ;addr=0.0.0.0 |
− | ;force_bind=yes | + | |
− | + | ; force_bind: boolean: Try to use a random port if failed to bind on configured one | |
− | ; calltoken_in: boolean: Use call token ip address authentication on incoming calls | + | ; Defaults to yes |
− | ; Note: If the caller don't support the call token IAX extension the call request | + | ;force_bind=yes |
− | ; will be ignored anyway | + | |
− | ; This parameter is applied on reload | + | ; calltoken_in: boolean: Use call token ip address authentication on incoming calls |
− | ; Defaults to no | + | ; Note: If the caller don't support the call token IAX extension the call request |
− | ;calltoken_in=no | + | ; will be ignored anyway |
− | + | ; This parameter is applied on reload | |
− | ; calltoken_out: boolean: Offer call token ip address authentication on outgoing calls | + | ; Defaults to no |
− | ; This parameter is applied on reload and can be overridden from routing | + | ;calltoken_in=no |
− | ; Defaults to yes | + | |
− | ;calltoken_out=yes | + | ; calltoken_out: boolean: Offer call token ip address authentication on outgoing calls |
− | + | ; This parameter is applied on reload and can be overridden from routing | |
− | ; calltoken_rejectmissing: boolean: Reject incoming calls without call token support | + | ; Defaults to yes |
− | ; when calltoken_in is enabled | + | ;calltoken_out=yes |
− | ; If disabled the requests will be ignored (dropped) | + | |
− | ; This parameter is applied on reload | + | ; calltoken_rejectmissing: boolean: Reject incoming calls without call token support |
− | ; Defaults to yes | + | ; when calltoken_in is enabled |
− | ;calltoken_rejectmissing=yes | + | ; If disabled the requests will be ignored (dropped) |
− | + | ; This parameter is applied on reload | |
− | ; tos: keyword: Type Of Service to set in outgoing UDP packets | + | ; Defaults to yes |
− | ; numeric TOS value or: lowdelay, throughput, reliability, mincost | + | ;calltoken_rejectmissing=yes |
− | ;tos=0 | + | |
− | + | ; tos: keyword: Type Of Service to set in outgoing UDP packets | |
− | ; read_threads: int: Number of threads that read packets from socket | + | ; numeric TOS value or: lowdelay, throughput, reliability, mincost |
− | ;read_threads=1 in client mode, 3 in server mode | + | ;tos=0 |
− | + | ||
− | ; event_threads: int: Number of threads that process events | + | ; read_threads: int: Number of threads that read packets from socket |
− | ;event_threads=1 in client mode, 3 in server mode | + | ;read_threads=1 in client mode, 3 in server mode |
− | + | ||
− | ; trunk_threads: int: Number of threads that service trunked voice packets | + | ; event_threads: int: Number of threads that process events |
− | ;trunk_threads=1 | + | ;event_threads=1 in client mode, 3 in server mode |
− | + | ||
− | ; thread: keyword: Default priority of the data service threads (socket listener and data trunking) | + | ; trunk_threads: int: Number of threads that service trunked voice packets |
− | ; Can be one of: lowest, low, normal, high, highest | + | ;trunk_threads=1 |
− | ; It is a bad idea to set a low priority for anything but testing | + | |
− | ;thread=normal | + | ; thread: keyword: Default priority of the data service threads (socket listener and data trunking) |
− | + | ; Can be one of: lowest, low, normal, high, highest | |
− | ; printmsg: boolean: Print sent/received frames to output if the module's debug | + | ; It is a bad idea to set a low priority for anything but testing |
− | ; level is at least 9 | + | ;thread=normal |
− | ; This parameter is applied on reload | + | |
− | ; Defaults to yes | + | ; maxchans: int: Maximum number of channels running at once |
− | ;printmsg=yes | + | ; A value of 0 specifies that there is no limit enforced. |
− | + | ; Defaults to the value set by the maxchans setting from yate.conf | |
− | + | ;maxchans= | |
− | [formats] | + | |
− | ; This section allows to individually enable or disable the codecs | + | ; printmsg: boolean: Print sent/received frames to output if the module's debug |
− | + | ; level is at least 9 | |
− | ; default: bool: Default enabling state for codecs | + | ; This parameter is applied on reload |
− | ;default=enable | + | ; Defaults to yes |
− | + | ;printmsg=yes | |
− | ; preferred: string: Preferred format to use | + | |
− | ;preferred= | + | |
− | + | [registrar] | |
− | ; slin: bool: Uncompressed 16-bit signed linear | + | ; Controls the behaviour when acting as registrar |
− | ;slin=enable | + | |
− | + | ; expires_min: int: Minimum allowed expiration time in seconds | |
− | ; mulaw: bool: Companded-only G711 mu-law | + | ; This parameter is applied on reload |
− | ;mulaw=enable | + | ; Minimum allowed value is 1 |
− | + | ; Defaults to 60 if missing | |
− | ; alaw: bool: Companded-only G711 a-law | + | ;expires_min=60 |
− | ;alaw=enable | + | |
− | + | ; expires_max: int: Value used to limit the expiration time to something sane | |
− | ; gsm: bool: European GSM 06.10 | + | ; This parameter is applied on reload |
− | ;gsm=enable | + | ; Minimum allowed value is the value set in expires_min |
− | + | ; Defaults to 3600 if missing | |
− | ; lpc10: bool: LPC 10 | + | ;expires_max=3600 |
− | ;lpc10=enable | + | |
− | + | ; 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 |
Revision as of 12:18, 15 October 2012
IAX channel
This module supports the IAX protocol by using the Yiax library.
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:
^2$=iax/diana@10.0.0.1/123
if you want to use the default protocol port (4569), or
^2$=iax/diana@10.0.0.1:4569/123
if you know that the called party is using the given port for incoming connections.
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. Attach:iax_trunk.png
NOTE: The order of audio packets inside a trunked packet is not important.
Extra documentation can be found here:
- http://tools.ietf.org/html/rfc5456#section-7.1
- http://www.voip-info.org/wiki/view/Asterisk+bandwidth+iax2
- http://www.voip-info.org/wiki/view/IAX
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:
- * Outgoing calls:
- The 'call.execute' message must have a trunkout=true parameter
^2$=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] ^3$=sip/sip:1234@1.2.3.4;trunkin=true
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.
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