SIP Routing in Yate

From Yate Documentation
(Difference between revisions)
Jump to: navigation, search
(Configure a SIP line)
(Configure a SIP line)
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
  
This page describes how to route to a SIP channel and a SIP line(gateway).
+
SIP routing in Yate can be done from a single routing module or from a combination of modules.
 +
 
 +
The calls can be routed directly to a SIP channel from a routing module (e.g regexroute.conf).
 +
 
 +
Another way to route the calls is by using a SIP line(gateway) configured in accfile.conf.
 +
 
 +
== Route to a SIP channel==
  
=== Route to a SIP channel===
 
 
From a [[Routing|routing module]] (e.g regexroute.conf) you can call an sip channel like this:
 
From a [[Routing|routing module]] (e.g regexroute.conf) you can call an sip channel like this:
  
Line 8: Line 13:
 
  ^100$=sip/sip:user@ip:port
 
  ^100$=sip/sip:user@ip:port
  
=== Route to a SIP line===
+
== Route to a SIP line==
 +
 
 +
=== Configure a SIP line===
  
==== Configure a SIP line====
 
 
From [[Accfile|accfile.conf]] you can configure a SIP line. In this case Yate is registers to a remote server.<br>
 
From [[Accfile|accfile.conf]] you can configure a SIP line. In this case Yate is registers to a remote server.<br>
 
Sections with enabled=no are always ignored so you have to changed them to enabled=yes.
 
Sections with enabled=no are always ignored so you have to changed them to enabled=yes.
Line 24: Line 30:
 
*  domain: Authentication domain if any
 
*  domain: Authentication domain if any
 
*  outbound: Optional outbound proxy server if different from registrar. A port can be specified here (e.g. 1.2.3.4:7999)
 
*  outbound: Optional outbound proxy server if different from registrar. A port can be specified here (e.g. 1.2.3.4:7999)
*  ip_transport: Optional SIP transport to use (udp, tcp, tls).
+
*  ip_transport: Optional SIP transport to use (UDP, TCP, TLS).  
*  ip_transport_remoteip: IP address to connect to register the account.
+
*  ip_transport_localip / ip_transport_localport:  
*  ip_transport_remoteport: IP port to connect to register the account.
+
::- UDP: Used to identify the listener to use
*  ip_transport_localip:  
+
::- TCP/TLS: Optional local ip/port to bind on when connecting
::- UDP: This parameter is used in conjuction ip_transport_localport to identify the transport to use.
+
::- TCP/TLS: Optional local ip to use when connecting ip_transport_localport: Local port.
+
  
 
*  localaddress: Local address to set in sent messages
 
*  localaddress: Local address to set in sent messages
Line 35: Line 39:
 
::-    Set it to 'no' or ipaddress (e.g. 1.2.3.4 or 1.2.3.4:5060) to disable NAT detection
 
::-    Set it to 'no' or ipaddress (e.g. 1.2.3.4 or 1.2.3.4:5060) to disable NAT detection
 
*  keepalive: Optional interval for NAT keep alive.
 
*  keepalive: Optional interval for NAT keep alive.
'''Note:''' Default port is 5060 for udp/tcp and 5061 for tls
+
'''Note:''' Default port is 5060 for UDP/TCP and 5061 for TLS
  
 
This is an example:
 
This is an example:
Line 54: Line 58:
 
  localaddress=192.168.0.1:5062
 
  localaddress=192.168.0.1:5062
  
====Route to the configured line====
+
===Route to the configured line===
  
 
Route a call to the [[Accfile|SIP line]] configured above:
 
Route a call to the [[Accfile|SIP line]] configured above:
Line 61: Line 65:
  
 
  ^100$=line/100;line=test_sip
 
  ^100$=line/100;line=test_sip
 +
 +
*  this rule will match the number called: 100 and will route the call through the gateway
 +
* the line parameter is fixed.
 +
* line=test_sip will tell Yate on which gateway/account to route the call.
  
  
 
'''See also'''
 
'''See also'''
  
*[[Routing| Routing in Yate]]
+
* [[Routing| Routing in Yate]]
*[[Accfile| Accfile module]]
+
* [[Accfile| Accfile module]]
*[[Regular expressions|Regular expressions Route Module]]
+
* [[Regular expressions|Regular expressions Route Module]]
 +
* [[Telephony]]
 +
 
 +
[[Category:SIP]] [[Category:Routing]]

Latest revision as of 10:08, 23 November 2017

SIP routing in Yate can be done from a single routing module or from a combination of modules.

The calls can be routed directly to a SIP channel from a routing module (e.g regexroute.conf).

Another way to route the calls is by using a SIP line(gateway) configured in accfile.conf.

Contents

[edit] Route to a SIP channel

From a routing module (e.g regexroute.conf) you can call an sip channel like this:

;extension match rule=sip/sip:user@ip:port
^100$=sip/sip:user@ip:port

[edit] Route to a SIP line

[edit] Configure a SIP line

From accfile.conf you can configure a SIP line. In this case Yate is registers to a remote server.
Sections with enabled=no are always ignored so you have to changed them to enabled=yes.

Parameter description for SIP:

  • protocol: The protocol to register on
  • username: Account username
  • password: Account password
  • interval: Registration interval (in seconds) to request from server
  • description: Caller name to set on outgoing calls on this account if none specified when routing
  • registrar: Registrar address. A port can be specified here (e.g. 1.2.3.4:7999)
  • authname: Authentication name to use instead of username when authenticating
  • domain: Authentication domain if any
  • outbound: Optional outbound proxy server if different from registrar. A port can be specified here (e.g. 1.2.3.4:7999)
  • ip_transport: Optional SIP transport to use (UDP, TCP, TLS).
  • ip_transport_localip / ip_transport_localport:
- UDP: Used to identify the listener to use
- TCP/TLS: Optional local ip/port to bind on when connecting
  • localaddress: Local address to set in sent messages
- Set it to 'yes' to detect NAT and re-register with public ip when NAT is detected
- Set it to 'no' or ipaddress (e.g. 1.2.3.4 or 1.2.3.4:5060) to disable NAT detection
  • keepalive: Optional interval for NAT keep alive.

Note: Default port is 5060 for UDP/TCP and 5061 for TLS

This is an example: Configure a SIP line called [test_sip].

accfile.conf

[test_sip]
enabled=yes
protocol=sip
username=me
description=Test SIP account
interval=600
authname=metoo
password=1234
domain=somewhere.org
registrar=10.0.0.1:5060
outbound=10.0.0.1:5061
localaddress=192.168.0.1:5062

[edit] Route to the configured line

Route a call to the SIP line configured above:

regexroute.conf

^100$=line/100;line=test_sip
  • this rule will match the number called: 100 and will route the call through the gateway
  • the line parameter is fixed.
  • line=test_sip will tell Yate on which gateway/account to route the call.


See also

Personal tools
Namespaces

Variants
Actions
Preface
Configuration
Administrators
Developers