SIP Trunk
The SIP Trunk module is designed to connect IP-PBX's and other SIP endpoints (phones) to Internet Telephony Service Providers by acting as a B2BUA (Back-To-Back User Agent) with one interface to the ITSP and the other to the IP-PBX and SIP phones. The ITSP interface is called SIP Trunk and the protocol used on both interfaces are SIP. The main function performed by this module is to provide a demarcation point where all communication on the SIP trunk behaves in a predictable way regardless of what equipment connects on the PBX interface.
Interoperabilty
Interoperability problems between different SIP equipment may hinder SIP deployments, with this module such problems can be avoided as SIP messages gets translated to support requirements on the SIP Trunk. Interoperability problems often arises due to presence of certain information in header fields of SIP messages, most common issues are addressed by GUI settings, however there is also a way to manipulate generic SIP message header fields, see the section on "Header manipulation".
PSTN Access and Pools
As this module gives PSTN access to SIP devices connected to this unit it has options of sharing PSTN numbers as well as using individual PSTN numbers for each SIP user. Sharing can be done so that the same number (caller-id) is always used for a particular set of users or a pool of PSTN numbers can be used by a group of SIP users. The idea of the pooling feature is that if the SIP Trunk does not support multiple calls using the same number, the pool will automatically select a number that is not busy. The pooling feature is configured though the "User Name" field in Trunk Lines below.
Routing calls
To make an outgoing call use the SIP Trunk module the Dial Plan on the SIP Switch page is used. The call is routed to the SIP Trunk module if the "Forward to" field of the Dial Plan equals the string "SIPTRUNKx" where x is the SIP Trunk module number (1-9).
Firewall/NAT traversal
The SIP Trunk module communicates with the builtin SIP proxy and firewall/NAT to support communication through the firewall and NAT.
Header manipulation and variable substitution
A generic SIP header manipulation tool for SIP requests passing through the box is available through configuration using the grammar for the header field component in a SIP URI using '?', '=', '%' and '&', as described in RFC 3261. In short, header fields for usage in SIP messages are put at the end of a SIP URI after a '?'. The header is written on the form header_name=header_value and additional headers are separated by a '&'. Any characters not allowed in this header component according to RFC 3261 must be escaped with %HEX construction where HEX is the 2-digit hexadecimal number representing the escaped character. Specific to IX products is that the string "__remove" put as header_value means the header should be removed. Also the IX products supports variable substitution in the form $(variable_name) so the "$(" sequence is treated specially. If a specified header field is already present in the SIP request it is replace, else the header field is added. Variables that can be used for variable substitution are:
- ruri.user = user from Request-URI
- ruri.host = host from Request-URI
- to.user = user from To header
- to.host = host from To header
- from.user = user from From header
- from.host = host from From header
- hdr.header_name = The complete header value of header "header_name".
- net.if.ip=[et1] = The IP adress of network interface "et1"
Example: ?User-Agent=$(hdr.user-agent)&Contact=sip:foo%40$(net.if.ip=[et4])%3buser%3dphone&Organization=mycompany&Privacy=__remove
Assuming the IP address of et4 is 1.2.3.4 and the received request contains a Privacy and a User-Agent header field, the following will happen:
- Privacy header field will be removed
- User-Agent will be kept unchanged (an IX may otherwise change User-Agent if used in b2bua mode)
- The following fields are added:
  Contact: sip:foo@1.2.3.4;user=phone
  Organization: mycompany
Header manipulation can be set for outgoing calls in the "User Name" field below and for incoming calls it can be set in the "Forward to" field. If you wish to use header manipulation, append the header string starting with '?' after other things that should go in the respective field.
Software License
The SIP Trunk Module is a software option that is purchased by pressing the Buy link at the top of the page. Without software license this page is not functional.
SIP Trunking Service
This section contains settings for the interface towards the ITSP, the SIP Trunk.
Use settings - Choose whether the settings for SIP Trunk Service should be taken from this page or another SIP Trunk page.
Service Name - A human readable comment that lets you put a name on this trunk.
Service Provider Domain - The FQDN or IP address of the ITSP SIP server. This domain name will be used in the Request-URI and To header field for outgoing SIP requests.
Restrict to calls from - Optional, if specified only calls originating from any of the IP addresses specified here will be handled as an incoming call to this SIP Trunk Module. If not specified a call may origin from anywhere as long as the called number matches any numbers configured here.
Outbound Proxy - Optional, Outbound SIP proxy for this trunk.
Use alias IP address - Optional, if IP aliases have been configured on Network Configuration page you can select one of them for usage when communicating on the SIP Trunk.
Use WAN interface with special SIP QOS - Optional, if an extra WAN interface has been configured for specific SIP traffic you can choose to use this WAN interface when communicating on the SIP trunk.
Diffserv bits for media streams - Optional, sets the diffserv bits according to this setting on all RTP packets related to the SIP Trunk.
Signaling transport - The transport protocol for SIP messages on the SIP trunk. Automatic means the transport protocol is determined by automatic means as defined in RFC 3263 based on "Outbound Proxy" or "Service Provider Domain" settings.
Port number - Optional, the destination port number to use for outgoing SIP requests on this SIP Trunk. If not specified the port number is determined by automatic means as defined in RFC 3263 based on "Outbound Proxy" or "Service Provider Domain" settings.
From header domain - This setting selects the domain name to use in the From header field for outgoing SIP requests on the SIP Trunk.
- Provider domain = Use domain name from "Service Provider Domain" setting.
- Enterprise domain = The domain name is kept as received from the caller.
- External IP address = The IP address of the network interface on which the request is sent.
- As entered = Enter the domain name to use manually in the box to the right.
Host name in Request-URI of incoming calls - Optional, the host part of Request-URI is usually one of this units IP addresses and this setting should then not be used, but if the SIP Trunk Provider uses the host name as a "trunk ID", this setting has to be set. Set it to the trunk ID you get from your provider.
Trunk Group Parameters (RFC 4904) - Optional, with this setting you enable support for trunk group parameters (TGP) according to RFC 4904. Write something like ";tgrp=the_trunk_group;trunk-context=the_trunk_context" (replace the_trunk_group and the_trunk_context with whatever you have got from the SIP Trunk Provider). The selectbox lets you choose how to use the parameters:
- Originating Trunk Group Parameters = The TGP will be used for matching incoming calls from the provider. If they match the call will be forwarded using any matching line or the main trunk line. If the incoming call contains TGP that don't match the call will not be considered for forwarding by any line on this page.
- Destination Trunk Group Parameters = The TGP will be used to signal the destination trunk group and trunk context for outgoing calls to the trunk provider.
- Originating and Destination T.G.P = The TGP will be used for both of the above.
Preserve Max-Forwards - Don't decrease Max-Forwards value of the SIP message as it passes through this trunk interface. Recommended setting is to leave this box unchecked as Max-Forwards helps detecting message loops resulting from bad configuration. But for interoperability with trunks using a very low Max-Forwards, this setting is required. If you calls fail with a "483 Too many hops" message and you don't think there is a message loop, this setting may help you.
Relay media for remote users - Makes this unit relay the media so that it looks to the ITSP that it is coming from this box, although the media endpoint may be located anywhere on the Internet. Solves interoperability problems with some ITSP's. Try this if you have problems with media (one or no way audio) when users are connected to your LAN remotely or calls are transferred externally.
Route incoming based on - Defines where to look for the called number for matching an incoming call to tables below. Request-URI is the default but some ITSP puts this information in To or P-Called-Party-ID.
Service Provider domain is trusted - Select this to enable usage of P-Asserted-Identity header field on the SIP Trunk as defined in RFC 3325. See setting for Identity in tables below. Some trunks may use this field as caller-ID.
Use P-Preferred-Identity in outgoing calls - Put the identity found in the table below into a P-Preferred-Identity field instead of P-Asserted-Identity.
Maximum number of simultaneous calls - Optional, the number of calls supported on the SIP Trunk. If the limit is reached, new calls will not be tried, instead a busy response is sent back to the caller.
Maximum number of simultaneous calls per Trunk Line - Optional, if the pooling feature is used (see above) this defines how many calls each line supports before it should be regarded as busy.
Trunk Lines
The Main Trunk Line defines the SIP account settings for the main trunk number and how to handle incoming calls to the main number. For outgoing calls, the Main Trunk Line is used when a calling user does not have an individual line or pool assigned in PBX Lines or SIP Lines. The PBX and SIP Lines defines SIP account settings for additional numbers on the trunk as well as handling of incoming and outgoing calls. The difference between PBX and SIP Lines is that PBX Lines is for telephones on the PBX and SIP Lines id for any other SIP phones that register to this unit. Note, if no User ID, Password or Identity field is set on PBX or SIP Lines, the values set on Main Trunk Line is used.
Reg. Acc. - Enable this if this is a SIP account that should be registered at the ITSP SIP Server.
From Number/User - Can contain several names/numbers (comma or space separated). For outgoing calls this field is matched to the calling user's user name in the From SIP URI (often a number but can also be a name). If there is a match, this line is selected for usage for the outgoing call. This field does not exist for Main Trunk Line as it is defined as the line to use if there is no match on any individual line.
Display Name - Optional, the SIP display name to use for outgoing calls, intended for presentation to the called party as a human readable string.
User Name - The SIP user name of the SIP account to use in the From SIP URI for outgoing calls and registrations. This is usually the telephone number of the SIP account and usually the number displayed as caller ID on PSTN. In this field you can also assign the SIP account to a pool by appending the suffix ";POOL1" for pool #1 or ";POOL2" for pool #2 etc. Or you can set the complete field to "POOL1" or "POOL2" etc which means a non-busy SIP account from the specified pool should be used for the outgoing call.
Identity - Optional, the value to use in P-Asserted-Identity or P-Preferred-Identity for outgoing calls. See "Use P-Preferred-Identity in outgoing calls" above. The ITSP may take this as the caller ID to use on PSTN.
User ID - Optional, the username for digest authentication if the trunk requires authentication.
Password - Optional, the password for digest authentication if the trunk requires authentication.
Dyn. Regs. - Shows number of live succesful registrations of the SIP account
Incoming Trunk match - Can contain several numbers (comma or space separated), this is the number(s) that has to match an incoming call to enable forwarding as specified in the "Forward to" field.
Forward to - Optional, for PBX Lines this the number incoming calls will be forwarded to on the PBX. For SIP Lines this is the complete SIP URI an incoming call will be forwarded to or a SIP user name/number on this unit's SIP Server. Leave this fiels empty to enable a DID function (several numbers on the same trunk line). If it is empty, the number/user of the incoming call will not be changed when forwarding the call.
Ext. - Optional, if this unit has the SIP Server license installed, this is an extension number that can be used by other SIP devices on this unit to reach the PBX on this line. Only for PBX Lines and Main Trunk Line as SIP users have their extension number configured on the SIP Switch page.
Setup for the PBX
This section deals with settings for the PBX, where it is located and how it is contacted on SIP.
Use settings - Choose whether the settings for PBX should be taken from this page or another SIP Trunk page.
PBX Name - A human readable comment that lets you put a name on this PBX.
Use alias IP address - Optional, if IP aliases have been configured on Network Configuration page you can select one of them for usage when communicating with the PBX.
PBX SIP Address - Optional, if the PBX register on this unit, this is the SIP account (address-of-record) it registers to.
User ID - Optional, the user ID for digest authentication of the PBX.
Password - Optional, the password for digest authentication of the PBX.
PBX IP address - Optional, the IP address of the PBX. Required if the PBX does not register.
PBX Domain Name - Optional, the SIP domain name of the PBX in case the PBX wants incoming calls be addressed to sip:number@domain instead of sip:number@ip-address
Forward incoming calls to PBX using - Choose how the PBX is located:
- IP Address = incoming calls are forwarded to "PBX IP Address".
- Domain name = incoming calls are forwarded to "PBX Domain Name".
- Registered Address = incoming calls are forwarded to the registered binding of the PBX.
Signaling transport - The transport protocol for SIP messages sent to the PBX. Automatic means the transport protocol is determined automatically by applying the rules of RFC 3263 on the SIP URI sent to PBX.
Port number - Optional, the destination port number to use for SIP requests sent to the PBX. If not specified the port number is determined automatically by applying the rules in RFC 3263 on the SIP URI sent to the PBX.
SIP host name(s) used by PBX - Optional, the host or domain name used in the From SIP URI by the PBX for outgoing calls. Required if the PBX does not put a local IP address in the From Field.
To header field - Set the To header field to use for incoming calls to the PBX:
- Same as Request-URI = The To header field is set to the same value as the Request-URI.
- Copy from Trunk = Copy the To URI from the incoming call on the Trunk interface.
- As entered = Enter the URI to use in To header manually in the box to the right. Variable substituion as decribed above is available in this box.
Trunk Group Parameters usage - Optional, this setting makes it possible to use the Trunk Group Parameters defined above also on the PBX interface.
- Originating Trunk Group Parameters = The TGP will be used for signalling originating TGP when forwarding calls to the PBX.
- Destination Trunk Group Parameters = The TGP will be used for matching destination TGP on outgoing calls. If they match the configuration in this page will be used regardless of what is written is Dial Plan of SIP Switch page. If there is no match, nothing happens.
- Originating and Destination T.G.P = The TGP will be used for both of the above.
Read more online:
SIP Trunk Module