Listeners in Yate

From Yate Documentation
Revision as of 12:33, 7 November 2012 by Dana (Talk | contribs)

Jump to: navigation, search

This page describes the role of a listener in Yate.

Contents

What is a Listener in Yate

A listener is a way of telling Yate on which network interfaces to listen.
Yate supports 3 types of listeners: TCP, TLS, UDP and allows you to bind Yate one one ore more network interfaces on different ports.
Using the default configuration from ysipchan.conf file, Yate will behave as a SIP server, that will listen on all interface.

IMPORTANT Starting with Rev. 5310 the SIP listener 'general' configuration is done in 'general' section of 
ysipchan.conf.  
The 'listener general' section was removed.
This change will affect those who used this section: if Yate is updated move the 'general' listener config to 'general' section.
Also in 'general' section the listener can be an UDP/TCP/TLS listener.

How to set Listeners in Yate

In Yate the advantage is that you can set on which interface he will listen and that it is done configuring your own listeners in ysipchan.conf, by creating sections like [listener your_listener_name] that will have the IP address, port and the type of the listener and other useful parameters. If the type is invalid or is not set the an UDP listener will be build by default.

Parameters that can be set for each listener that is configured in a section:

  • type: the type values allowed:
- udp - build a UDP listener
- tcp - build a TCP listener
- tls - build a TLS listener ( that is a encrypted TCP)
  • enable: Enable or disable this listener
  • default:used only for UDP to specify if this is the default transport to use when none specified
  • udp_force_bind: UDP only, if is set Yate will try to use a random port if failed to bind on configured one
  • addr: is the IP address to bind to
  • port: is the port to bind to.Defaults to 5060 for UDP and TCP, 5061 for TLS listeners
  • rtp_localip: the IP address to bind local RTP to
  • backlog: the maximum length of the queue of pending connections.This parameter is ignored for UDP listeners.
  • sslcontext: SSL context if this is an encrypted connection. Required for TLS listeners.
  • thread: the listener thread priority. Can be one of: lowest, low, normal, high, highest.

Here is an example to set a UDP listener in ysipchan.conf.

[listener your_listener_name]
 type=udp
 addr=x.x.x.x
 port=5060

If you have only one listener in your system then you can set it like default listener in section [general] that will build a UDP/TCP/TLS listener.

How to use Listeners in routing

In a routing module: parameter oconnection_id it can be used to set on which IP to send outbound call legs for routing. We will choose the listener created above to set on which IP to send outbound call legs and create a sip channel like this:

regexroute.conf

[default]
; Set on which IP to send outbound call legs
.*=;oconnection_id=your_listener_name
; call an sip channel
extension=sip/sip:user@ip:port.

What's a Listener for Yate

For the internal structure of Yate a Listener is a way to make good scalling to the system.

Personal tools
Namespaces

Variants
Actions
Preface
Configuration
Administrators
Developers