Listeners in Yate
Using the default configuration from ysipchan.conf file, Yate will behave as a SIP server, that will listen on all interface. A set of listeners can be set so that Yate will listen to that interfaces.
In Yate the advantage is that you can set on which interface he will listen and that it is done configuring your own listeners by creating sections like [listener your_listener_name] that will have the IP address, port and the type of the listener. 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 default listener and a UDP listener in ysipchan.conf.
[listener general] addr=x.y.z.w [listener my_listener_name] port=5060 addr=a.b.c.d
The default listener it is set in section [listener general] and will build a UDP listener that will have the parameters used only for UDP.
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 general listener to set on which IP to send outbound call legs and sip channel like this:
regexroute.conf
[default] ; Set on which IP to send outbound call legs .*=;oconnection_id=general ; call an sip channel extension=sip/sip:user@ip:port.