====== SIP Switch ====== (This page is called SIP Switch Advanced in releases 5.33 and later.) ====== SIP Switch Advanced ====== (This page was called SIP Switch in releases older than 5.33.) The [[sip:SIP Switch]] gives you PBX-like functions and can give all users of Internet Gate connectivity with the old telephone network, using SIP service provider's single user SIP accounts! ^ :!: To be able to use the SIP switch you need to purchase a [[:license]]. ^ | Without the licenses only the SIP address, id and password in the SIP Account table are functional. | To evaluate the SIP Switch (without having to buy it), press the "Evaluate" link or the "View/Get Example" link below the Dial Plan table! You then get access to the full SIP Switch including 5 user accounts for testing purposes, for a maximum period of 10 days or until the unit is restarted. {{ :web_gui:sip_switch.png?267|SIP Switch in rel 5.30}} Read more about the [[sip:SIP Switch]]. [[web GUI:SIP Trunk]] [[web GUI:Advanced SIP Settings]] ===== Outgoing call number processing ===== A SIP user may enter a full URI (e.g. peter@company.com), an ordinary telephone number or an extension number, when wanting to dial someone. This section determines the interpretation of the entry and the action taken. **Route numbers starting with** - If an operator does the processing of dialled numbers, e.g. for connecting to ordinary telephones, this setting can be used instead of the Dial Plan. A SIP address, a domain name or an IP address may be specified in the operator account field. One or several prefixes (separated by space or comma) can be specified. Leaving the prefix field empty, means that all outgoing calls will be routed to the specified operator. The Dial Plan must be OFF or in FB mode for this setting to be active. **Reserved range for internal numbers** - A range for internal "extension" numbers can be defined here. (Each individual internal number must be entered in the SIP Account table.) Numbers within this range will not be processed in the Dial Plan table. ===== Emergency number ===== One or several numbers (separated by space or comma), e.g. "911 112" can be specified here to directly route emergency calls to a local gateway. The gateway is specified by its domain name or IP address. When this product is equipped with a telephone line port (FXO port), its default name "localgw" is entered so it will be used for the emergency calls. You can select for which SIP clients the routing will be used: * "Local phones" means telephones connected to any FXS ports on this product. * "All inside phones" means any local phone and any SIP phone or soft SIP client on the LAN. * "All phones" means all SIP clients using this product, including remote users registered to this product. * "None" means this emergency routing is not used. ===== Dial Plan ===== The [[SIP:Dial Plan]] will process an entered telephone number and take the appropriate action - e.g. forward the call to a PSTN gateway - according to rules entered. To be able to use the Dial Plan you need to purchase a [[:license]]. :!: Running the Dial Plan wizard at the web page you reach by the "View/Get Example" link will create a Dial Plan that you thereafter can modify for specific needs. The Dial Plan can be turned On, Off or used in fallback (FB) mode. In fallback mode, the dial plan is inactive unless the WAN connection is down or a particular SIP Server to be routed to is out of order. As a backup, the Dial Plan then becomes active. ==== The Dial Plan Table ==== A dialled number is matched against the four first columns in the table, Prefix, Head, Tail and Minimum Tail. The callers From header (caller-ID) is matched against the column From Number/User. If the row matches the call, the Action is performed; else the next row in table is checked for a match. The processing order is from top down, until a match is found. * Prefix - The characters in the Prefix+Head+Tail field are compared against the dialled number. The characters in the Prefix field (e.g. 0 for an outside line or * for some special service) must be an exact match to the beginning of the dialled number and are stripped off before an Action is taken. * Head - The Prefix+Head field must also be an exact match to the beginning of the dialled number. * Tail - The Tail field specifies the characters that are allowed in the remainder of the dialled number (after an exact match of Prefix+Head). * Minimum Tail - If, after a match in the three previous fields, the length of the tail part is less than specified in this field, the dialled number is regarded as incomplete. * From Number/User - Select callers (caller-ID) this row should apply to. This way you can choose which ITSP account/trunk to use based on which extension/user is calling. Enter the number or username of the calling phone. Wildcards (*?!) can be used to select a group of callers with a specific number pattern. For example 1* means all numbers starting with 1. The field can be empty to match all callers. * Action - This field specifies the action(s) that should be performed after a dialled number has been matched by the previous fields. * "Allow" means that the SIP URI is used as is. * "Forward" means that the number is sent (as a SIP user name) to the domain specified in the "Forward to" field (typically used for routing calls for an ordinary telephone, to a PSTN gateway). * "Enum" results in an [[SIP:ENUM]] request to find whether a SIP address exists for the particular number. If a SIP URI is found, the call is forwarded to that URI. * "Force" means that the call is forwarded to the domain specified, irrespective of from where the call originated (e.g. used for emergency calls). * "Deny" means that the call will be rejected (e.g. used for too short numbers). * "A&" before an action instructs this proxy to Authenticate (check user id and password) before the action is performed.\\ When two actions are specified, the second is performed if the first fails. * Forward to - Normally, the domain name or IP address of the PSTN gateway to which a call shall be forwarded to is specified here. However, you can also specify a SIP user that has an account with a SIP service provider, in which case all users of this product can use that account as a gateway to the ordinary telephone network! (The correct account type has to be set up in SIP Account table.) The dialled number, stripped from the Prefix and preceded by the new Add Prefix Forward in the next column, is passed on as the SIP user name. If there are several entries (separated by space or comma), the next will be tried if the first fails. If the Action is Forward, but nothing is specified in this field, the Default PSTN Gateway specified below this column will be used. * Add Prefix Forward - This prefix will be added in front of the dialled number before the call is forwarded. It may, e.g. be used for adding a country or an area code before sending the dialled number to a gateway. * Add Prefix Enum - This prefix will be added in front of the dialled number before an Enum lookup is done. Typical usage is for adding country code, since Enum uses the full E.164 number. * Enum Root - In the public Enum service, the root is ".e164.arpa". However, for local use or testing, other roots may be used. You can also add several roots (separated by space or comma), that each will be searched until a SIP address is returned. Last, preceded by an exclamation mark, you may also add a root for searching a directory with entries that shall NOT be forwarded to a gateway. Thus, if an entry is found in e.g. the "!nopstnphone.com" root, the call will NOT be forwarded, thus avoiding the risk for loops. The dialled number, stripped from the Prefix and preceded by Add Prefix Enum in the previous column (in reverse order and with dots between each digit) will precede each root searched in the Enum DNS lookup. * Default PSTN Gateway - The domain or IP address entered here will be used if the Action is forward, but no Forward to address is entered. You may also specify a SIP user that has an account with a SIP service provider as described above under the "Forward to" field. If more than one domain is entered (separated by space or comma), the next will be tried if the first fails. Since the order in which the rows comes in the Dial Plan table is of importance, there are radio buttons to mark a particular row, and a Move button to move a row before another specified row. ===== SIP Accounts and Incoming Call Processing ===== The SIP Account table is used for authentication of SIP users and for extra functionality (columns unlined with pink) that requires [[:license]] to use. ==== Voice mail server ==== Enter the domain or IP address of the voice mail server. If more than one domain is entered (separated by space or comma), the next will be tried if the first fails. If the voice mail server requires specifics in the Request-URI, you can specify it as exemplified: * sip:$(cfg.user)@vmserver.com * sip: vmserver.com;mailbox="$(cfg.user)@$(cfg.host)" * sip:$(to.user)@$(to.host);maddr= vmserver.com The variables within $() can be: * cfg.user = user from SIP Account table * cfg.host = host from SIP Account table * 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 and will be replaced with strings from the configuration or SIP message. "user" and "host" refers to the user and host parts in a SIP address sip:user@host. Allow external callers to use internal numbers - If checked, an outside caller can use the internal "extension" number to call a local user, e.g. by calling 12@thissipserver.com. ==== Accounts Table ==== * Account Type - If the Dial Plan forwards using a account as specified in the SIP Account table, it will be processed as specified by the type below. This allows all users of the SIP Switch to e.g. share a single SIP account with connectivity to the ordinary telephone network. All accounts except type "User" can be referenced from dial plan and these accounts are called B2BUA accounts. The full user@host SIP address needs to be specified for B2BUA accounts. Incoming calls can be forwarded to any users as specified in the user action columns. * "User" Ordinary user account with authentication credentials for server side authentication. Not a B2BUA. * "Reg" Register on behalf of client - No SIP phone is connected so the SIP Switch registers the user on the SIP Server. * "XF" Exchange From header - When used by another client, the From header is exchanged to the account owner's. * "XF&Reg" Exchange From header and Register - The From header is exchanged and the SIP Switch registers (both as described above). * "Vng" Vonage - Special type for Vonage SIP accounts with soft PC client. Only phone number (not full URI) needs to be entered as SIP User name. * "Vng&Reg" Vonage and Register - For Vonage SIP accounts without using a Vonage client - the SIP Switch registers. * "MR" Media Relay - In addition to the From header exchange, media is always sent via the SIP Switch. * "MR&Reg" Media Relay and Register - Media is relayed, the From header is exchanged and the SIP Switch registers. * "Domain" Domain with authentication - The SIP Switch authenticates all users e.g. towards a gateway at the specified host address. * Ext. = Internal extension number - Here you specify the internal "extension" number you want to assign to each user. You select any unique number from the reserved range specified above the Dial Plan table. * SIP User Name or SIP Address (URI) - Enter a complete SIP URI or just the username part of a SIP adress. If only the username is set it means that the user belongs to all SIP domains handled by this unit. This is also the User Name you enter when logging into the personal page through "User Log in" at the first web page of this product. (For B2BUA accounts, the full URI always has to be specified). Some attributes can be configured for B2BUA accounts using SIP parameter syntax: * ";hrr" - Hide Record-Route * ";hvia" - Hide Via * ";htt" - Show only one To tag * ";expires=[seconds]" - Sets proposed registration expires value to [seconds] * ";nua" - No User-Agent header added to SIP messages. * ";rhd" - Set domain in (3xx) redirection URI's to home/service domain * ";rcd" - Set domain in (3xx) redirection URI's to caller domain * ";POOL[n]" - assign the B2BUA to pool [n] (see help on SIP Trunk page). * ";max-calls=[nr]" - number of maximum concurrent calls using the B2BUA account. * Authentication User ID - This is the User ID used for authentication of SIP requests. Authentication for registering at this SIP server can be turned on in the General SIP Server Settings above and authentication may also be forced in the Dial Plan. If authentication is turned on, the User ID in the SIP client must match the one entered here. The user can change this field on his personal page. * Authentication Password - This is the Password used for authentication and for logging in to the personal page. If authentication is turned on, the Password in the SIP client must match the one entered here. The user can change this field on his personal page. * Comment - It is useful to enter the user's name here, if he has a numeric SIP name. * Dyn. Regs. - Dynamic Registrations. The number of SIP clients that have been registered for each user is shown here. * Forward Action - Specifies if and how this user's calls are to be forwarded. The user can change this setting on his personal page. * "No" No forwarding is made. Only the Dynamically Registered clients will ring. * "Forward" The Dynamically Registered client(s) will not ring - only the one(s) listed in the next column will ring. * "Parallel" All SIP clients will ring simultaneously, both the Dynamically Registered and the ones specified in the next column. * "Sequence" The SIP clients will ring one after another, for 25 seconds each until there is an answer. The Dynamically Registered will ring first, followed by the ones specified in the next column in the given order. You can control the ringing order by adding the q-parameter after the SIP user name. q is a value between 0 and 1 and if no value is given, q=0.5 is assumed. SIP clients with the highest q-value, e.g. "john@company.com;q=0.6", will ring first. The default ring length will be overridden if another time is specified in the Voice Mail column. You can also set the ring length in seconds by adding the t-parameter after a user name, e.g. "john@company.com;t=15" will make john ring for 15 seconds. * "Random" All SIP clients will ring in random order, both the Dynamically Registered and the ones specified in the next column. * "Deny" means that this user will not accept any calls at all. * to SIP URI, IP Address, Phone Number or Ext. - Here you specify the SIP PC clients, the SIP phones or the PSTN phones that the calls for this specific user will be forwarded to. An entered phone number will be processed by the Dial Plan. For a SIP phone on the same LAN using an external SIP server, it is recommended that you specify the internal extension number or the local IP address (e.g. john@192.168.0.36 instead of john@company.com) to avoid restrictions in the external SIP server. You can enter several receivers separated by space or comma. The user can change this field on his personal page. * Voice Mail - Here you select whether, and on which condition, this user's calls shall be redirected to the Voice mail server (specified above this table). * BU = Block User - When checked, this user will not be allowed to log in to his personal page to change his settings. The personal page is reached through the "User Log in" on the first web page of this product. You use the SIP name of column 3 and the Password of column 5 to log in. * RI = Restrict Incoming - By checking this box, the user will only be reachable for callers defined by the "Allowed Incoming Callers" lists. Also see next point! * AC = Accept Common - There is both a personal list (controlled from the personal page, see BU above) and a common list (on this page) to specify the Allowed Incoming Callers. If RI is selected, then this box selects whether the common list on this page will be used in addition to the user's own list. * Incoming Call Matching - A PSTN gateway may pass an incoming call with the dialled number in the Request-URI. Here you can match one or several incoming PSTN numbers (separated by space or comma) to specific users. If the account is of "Reg"-type, the SIP Switch will use the number entered here in the contact header when registering. * Show other dynamically registered SIP users - There may be other SIP users registered, that you have not created a SIP account for (which is not necessary). You can view these by checking this box. When viewing these, you can mark and add such users to the SIP Account table. ===== Incoming Call Blacklist ===== Users with SIP addresses listed here are not allowed make incoming calls or otherwise use this SIP server. The SIP addresses may include wildcards. ? represents any single character while * represents a string of characters of any length. * is only allowed first, last and just before or after @ (e.g. sex*@* and *@sex*). Each user can also set up his own blacklist in addition to this one, on his personal page. :!: It is easy for a caller to change SIP address, so this method is quite easy to bypass. ===== Allowed Incoming Callers ===== When the RI box in the SIP Account table is checked, no calls are allowed for that user unless specified in the personal "Allow Incoming Callers" section or, when AC is checked, unless specified in the common "Allow Incoming Callers" section here. * Local users (on this server) - Here you can select if calls from users handled by this SIP server should be allowed or allowed only after authentication. :!: Note that it is not difficult for a non-authorized user to assume a local user's SIP address (spoof) and make incoming calls when Authentication is not selected. * Authenticated - Callers with any of the entered User IDs and Passwords are allowed. * Not Authenticated - Callers with any of the SIP addresses entered here are allowed. You can use wildcards to specify allowed callers. ? represents any single character while * represents a string of characters of any length. * is only allowed first, last and just before or after @ (e.g. *@partner.com). ===== Export/Import Settings ===== You can save the settings on this page as a file on you hard disk by pressing Export. When Importing settings from a previously stored file, you can select which parts of the settings you want to restore. The specific SIP Switch Settings will not be restored if you have not purchased the SIP Switch. :!: It is recommended that you make a security back-up of your settings by Exporting them to a file on your hard disk! ====== ====== [[web GUI:SIP Trunk]] [[web GUI:Advanced SIP Settings]]