Brekeke SIP Server Version 2.0 Dial Plan Tutorial Brekeke Software, Inc.

Pages 22
Views 33
of 22
All materials on our website are shared by users. If you have any questions about copyright issues, please report us to resolve them. We are always happy to assist you.
Description
Brekeke SIP Server Version 2.0 Dial Plan Tutorial Brekeke Software, Inc. Version Brekeke SIP Server v2.0 Dial Plan Tutorial Revised: January 12, 2007 Copyright This document is copyrighted by Brekeke Software,
Transcript
Brekeke SIP Server Version 2.0 Dial Plan Tutorial Brekeke Software, Inc. Version Brekeke SIP Server v2.0 Dial Plan Tutorial Revised: January 12, 2007 Copyright This document is copyrighted by Brekeke Software, Inc. Copyright Brekeke Software, Inc. This document may not be copied, reproduced, reprinted, translated, rewritten or readdressed in whole or part without expressed, written consent from Brekeke Software, Inc. Disclaimer Brekeke Software, Inc. reserves the right to change any information found in this document without any written notice to the user. Trademark Acknowledgement LINUX is a registered trademark of Linus Torvalds in the United States and other countries. Red Hat is a registered trademark of Red Hat Software, Inc. Windows is a trademark or registered trademark of Microsoft Corporation in the United States and other countries. Mac is a trademark of Apple Computer, Inc., registered in the U.S. and other countries. Java and all Java-based trademarks and logos are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. Other logos and product and service names contained in this document are the property of their respective owners. 2 Brekeke SIP Server Dial Plan Tutorial 1. INTRODUCTION ROUTING Routing Setting by the Destination SIP URI... 7 Ex 1 Routing all calls to 7 Ex 2 Routing a call to if the callee s name is admin ... 7 Ex 3 Routing a call to if the callee s SIP URI is 7 Ex 4 Routing a call to host with the same username if the callee's name prefix is 9 ... 7 Ex 5 Routing a call to host without the prefix if the callee's name prefix is 9 ... 8 Ex 6 Routing a call to host with the prefix 8 if the callee's name prefix is 9 ... 8 Ex 7 Routing a call to if the callee isn't registered... 8 Ex 8 Routing a call to if the caller's name is admin ... 8 Ex 9 Routing a call to if the caller isn't registered... 8 Ex 10 Routing a call to if the call is from Routing Setting by the Destination User Name... 9 Ex 11 Routing a call to the user user if the user is registered... 9 Ex 12 Routing a call to the user user if the callee isn't registered... 9 Ex 13 Routing a call to the user who was registered as the callee's name with the prefix Ex 14 Routing a call to the user user from 10:00AM to 5:59PM... 9 Ex 15 Routing a call to the user user from December 12 to December Routing Setting by the Destination IP Address or FQDN Ex 16 Routing a call to server if the callee's host name is host Ex 17 Routing a call to host.domain if the call is from Ex 18 Routing a call to host.domain if the call is from the localhost Ex 19 Routing a call to if the call is from the port number Ex 20 Routing a call to if the request method is SUBSCRIBE REJECTING...11 Ex 21 Returning a 603 Decline response if the callee isn't registered...11 Ex 22 Returning a 486 Busy response if the callee's SIP URI is Ex 23 Returning a 402 Payment Required response if the callee's name prefix is 9 ...11 Ex 24 Returning a 404 Not Found response if the caller's name is user ...11 Ex 25 Returning a 403 Forbidden response if the call is from an IP address with the prefix 12 Ex 26 Returning a 406 Not Acceptable response if the Content-Type header is application/text Brekeke SIP Server Dial Plan Tutorial Ex 27 Returning a 503 Service Unavailable response if the User-Agent header contains TEST Ex 28 Returning a 483 Too Many Hops response if the Max-Forwards' value is 5 or less Ex 29 Returning a 480 Temporarily Unavailable response from 0:00AM to 7:59AM Ex 30 Returning a 400 Bad Request response if the request method is SUBSCRIBE EDITING SIP HEADERS Replacing an Existing SIP Header Ex 31 Changing the caller's display name to Ted if his/her user name is admin Ex 32 Changing the Expires's value to 200 if it is less than Ex 33 Replacing the User-Agent's value to contain Beta if it contains Alpha Appending SIP Header Ex 34 Appending new header X-Example Deleting SIP Header Ex 35 Deleting the User-Agent header AUTHENTICATION...14 Ex 36 Requiring Authentication if the callee's domain name is host.domain Ex 37 Not Requiring Authentication if the callee's name prefix is 800 Ex 38 Requiring Authentication if the caller isn't registered Ex 39 Requiring Authentication if the call is from an IP address with the prefix Ex 40 Not Requiring Authentication from 10:00AM to 5:59PM LOAD BALANCING...16 Ex 41 Load Balancing by switching 3 destinations every second Ex 42 Load Balancing by switching 2 destinations every 30 minutes Ex 43 Load Balancing based on whether the Session ID is odd or even NAT TRAVERSAL Setting NAT Traversal ON/OFF Ex 44 Enabling NAT Traversal if the callee's domain name is host.domain Ex 45 Disabling NAT Traversal if the call is from Specifying the Interface Address Ex 46 Using as the interface address if the prefix of callee's contact address is Ex 47 Using as the interface address if the call is from an IP address with the prefix RTP RELAY Brekeke SIP Server Dial Plan Tutorial Ex 48 Enabling RTP Relay if the callee's name prefix is 9 Ex 49 Enabling RTP Relay and using PCMA as the codec if the callee's SIP URI is 19 Ex 50 Enabling RTP Relay and assigning the range of ports from to if the is call from SPECIFYING ENVIRONMENT VARIABLES...20 Ex 51 Using G723 as the codec for all calls Ex 52 Not Appending Record-Route header if the callee's name prefix is 9 Ex 53 Not Adding lr parameter to Record-Route header if the callee's host name is host Ex 54 Not Appending rport parameter to Via header if the callee's host name is host Ex 55 Setting the ringing timeout period to 30 seconds if the caller's name is admin Ex 56 Using Upper Registration to host.domain if the caller's name prefix is 9 Ex 57 Adjusting the following registration period as 100 seconds if the current period is less than 100 seconds 21 Ex 58 Not Using Thru Registration if the callee's host name is host USING SESSION PLUG-IN...22 Ex 59 Using RadiusAcct plug-in for all calls Ex 60 Using CDRlog plug-in if the callee's host name is host Brekeke SIP Server Dial Plan Tutorial 1. Introduction This document introduces various samples of Brekeke SIP Server Dial Plan rules. For the basics of Dial Plan, syntaxes, and how to set dial plan rules using the Brekeke SIP Server Admintool, refer to the Brekeke SIP Server Administrator s Guide, Section 6. Dial Plan. The Dial Plan features explained in this document are as follows: Routing Rejecting Editing SIP Headers Authentication Load Balancing NAT Traversal RTP Relay Specifying Environment Variables Using Session Plug-in 2. Routing Routing is the major feature of Dial Plan. There are three ways to define routing using Deploy Patterns. The routing setting will be enabled only when the corresponding conditions in are fulfilled. To = destination SIP URI Example: To = The session will be routed to the host. To = destination user name Example: To = The session will be routed to the destination user s contact address which was registered in the server s register database when REGISTER request was sent from the user. 6 Brekeke SIP Server Dial Plan Tutorial $target = destination IP address or FQDN Example: $target = $target = host The session will be routed to the host. Example: $target = The session will be routed to the Routing Setting by the Destination SIP URI Ex 1 Routing all calls to To = Ex 2 Routing a call to if the callee s name is admin To = To = Ex 3 Routing a call to if the callee s SIP URI is $geturi(to) = To = Ex 4 Routing a call to host with the same username if the callee's name prefix is 9 To = To = 7 Brekeke SIP Server Dial Plan Tutorial Ex 5 Routing a call to host without the prefix if the callee's name prefix is 9 To = To = Ex 6 Routing a call to host with the prefix 8 if the callee's name prefix is 9 To = To = Ex 7 Routing a call to if the callee isn't registered $registered = false To = Ex 8 Routing a call to if the caller's name is admin From = To = Ex 9 Routing a call to if the caller isn't registered $registered( From ) = false To = Ex 10 Routing a call to if the call is from $addr = 192\.168\.0\.1$ To = 8 Brekeke SIP Server Dial Plan Tutorial 2.2. Routing Setting by the Destination User Name Ex 11 Routing a call to the user user if the user is registered $registered( user ) = true To = Ex 12 Routing a call to the user user if the callee isn't registered $registered = false To = $registered( user ) = true Ex 13 Routing a call to the user who was registered as the callee's name with the prefix 9 To = To = Ex 14 Routing a call to the user user from 10:00AM to 5:59PM $time =^1[0-7]: To = Ex 15 Routing a call to the user user from December 12 to December 19 $date = 12/1[2-9]$ To = 9 Brekeke SIP Server Dial Plan Tutorial 2.3. Routing Setting by the Destination IP Address or FQDN BREKEKE SOFTWARE, INC. Ex 16 Routing a call to server if the callee's host name is host $geturi( To ) $target = server Ex 17 Routing a call to host.domain if the call is from $addr = 192\.168\.0\.1$ $target = host.domain Ex 18 Routing a call to host.domain if the call is from the localhost $localhost = true $target = host.domain Ex 19 Routing a call to if the call is from the port number $port = ^15060$ $target = Ex 20 Routing a call to if the request method is SUBSCRIBE $request = ^SUBSCRIBE $target = Brekeke SIP Server Dial Plan Tutorial 3. Rejecting Here are some examples of error messages returned for rejecting calls. Error responses specified in the handling variable $action are sent to the request sender. The session for which an error response was returned will not be routed to the call destination. For the response codes, refer to RFC3261. Ex 21 Returning a 603 Decline response if the callee isn't registered $registered = false $action = 603 Ex 22 Returning a 486 Busy response if the callee's SIP URI is $geturi( To ) = $action = 486 Ex 23 Returning a 402 Payment Required response if the callee's name prefix is 9 To = $action = 402 Ex 24 Returning a 404 Not Found response if the caller's name is user From = $action = Brekeke SIP Server Dial Plan Tutorial Ex 25 Returning a 403 Forbidden response if the call is from an IP address with the prefix $addr = 192\.168\. $action = 403 Ex 26 Returning a 406 Not Acceptable response if the Content-Type header is application/text Content-Type=^application/text$ $action = 406 Ex 27 Returning a 503 Service Unavailable response if the User-Agent header contains TEST User-Agent = TEST $action = 503 Ex 28 Returning a 483 Too Many Hops response if the Max-Forwards' value is 5 or less Max-Forwards = ^[0-5]$ $action = 483 Ex 29 Returning a 480 Temporarily Unavailable response from 0:00AM to 7:59AM $time = ^0[0-7]: $action = 480 Ex 30 Returning a 400 Bad Request response if the request method is SUBSCRIBE $request = ^SUBSCRIBE $action = Brekeke SIP Server Dial Plan Tutorial 4. Editing SIP Headers Editing a SIP header means replacing the SIP header s contents to a specified value or to add a SIP header or to delete a SIP header. If the specified SIP header field exists in the SIP packet, the contents of the SIP header will be replaced with a new value. If it doesn t exist, the header field will be added to the SIP packet. If the setting value is empty (the text length is 0), the SIP header will be removed from the SIP packet. By editing a specified SIP header, it is possible to block leaks of the caller s information or to become interoperable with the call destination Replacing an Existing SIP Header Ex 31 Changing the caller's display name to Ted if his/her user name is admin $geturi(from) = From = Ted %1 $replaceuri = true Ex 32 Changing the Expires's value to 200 if it is less than 200 Expires = ^[01][0-9].$ Expires = 200 Ex 33 Replacing the User-Agent's value to contain Beta if it contains Alpha User-Agent = (.*)Alpha(.*) User-Agent = %1Beta%2 13 Brekeke SIP Server Dial Plan Tutorial 4.2. Appending SIP Header Ex 34 Appending new header X-Example X-Example = hello 4.3. Deleting SIP Header Ex 35 Deleting the User-Agent header User-Agent = 5. Authentication It is possible to enable authentication only for the specified requests using Dial Plan. Even when authentication is enabled in the System s setting (at the [Configuration] page), it is possible to disable the authentication only for a specified request. The handling variable $auth will be used for this purpose. If its value is true, the authentication will be enabled. If it is false, authentication will be disabled. If authentication is enabled, Brekeke SIP Server will send the message 407 Proxy Authentication Required (or 401 Unauthorized) to the request sender and make the sender resend a request with authentication information. If the request does not include the valid authentication information, Brekeke SIP Server will not authorize the request. Ex 36 Requiring Authentication if the callee's domain name is host.domain $geturi( To ) $auth = true 14 Brekeke SIP Server Dial Plan Tutorial Ex 37 Not Requiring Authentication if the callee's name prefix is 800 BREKEKE SOFTWARE, INC. To = $auth = false Ex 38 Requiring Authentication if the caller isn't registered $registered( From ) = false $auth = true Ex 39 Requiring Authentication if the call is from an IP address with the prefix $addr = 192\.168\.\10 $auth = true Ex 40 Not Requiring Authentication from 10:00AM to 5:59PM $time =^1[0-7]: $auth = false 15 Brekeke SIP Server Dial Plan Tutorial 6. Load Balancing You can change the routing destinations by using some unique value, for example, by time or by session ID. For example, you can reduce the load of a gateway by allocating the calls to multiple VoIP gateways. Ex 41 Load Balancing by switching 3 destinations every second $time = [0369]$ $time = [147]$ $target = server1 $target = server2 $target = server3 Ex 42 Load Balancing by switching 2 destinations every 30 minutes $time = ^..:[0-2] $target = server1 $target = server2 Ex 43 Load Balancing based on whether the Session ID is odd or even $sid = [13579]$ $target = server1 $target = server2 16 Brekeke SIP Server Dial Plan Tutorial 7. NAT Traversal Brekeke SIP Server decides automatically whether to handle NAT traversal. The Administrator can also specify whether Brekeke SIP Server handles NAT traversal or not for each session using Dial Plan. The following handling variables will be related to NAT traversal: $nat = true or false Whether to apply NAT traversal or not $ifdst = IP address or FQDN The interface address of Brekeke SIP Server for communicating with the session s destination (the callee). This address is used for Via, Record-Route and etc. $ifsrc = IP address or FQDN The interface address of Brekeke SIP Server for communicating with the session s source (the caller). This address is used for Via, Record-Route and etc Setting NAT Traversal ON/OFF Ex 44 Enabling NAT Traversal if the callee's domain name is host.domain $geturi( To ) $nat = true Ex 45 Disabling NAT Traversal if the call is from $addr = 192\.168\.0\.1$ $nat = false 17 Brekeke SIP Server Dial Plan Tutorial 7.2. Specifying the Interface Address Ex 46 Using as the interface address if the prefix of callee's contact address is $registeredaddr = ^192\.168\.1\. $ifdst = Ex 47 Using as the interface address if the call is from an IP address with the prefix $ addr = ^192\.168\.2\. $ifsrc = Brekeke SIP Server Dial Plan Tutorial 8. RTP Relay Brekeke SIP Server decides whether to do RTP relay or not automatically for each session. The Administrator can also specify whether Brekeke SIP Server should do RTP relay or not using a Dial Plan. RTP relay will be enabled automatically for the session where NAT traversal is handled. The following handling variables are related to RTP relay: $rtp = true or false Whether to apply RTP Relay or not $ifdst = IP address or FQDN The interface address of Brekeke SIP Server for communicating with the session s destination (the callee). This address is used for receiving RTP packets from the destination UA. $ifsrc = IP address or FQDN The interface address of Brekeke SIP Server for communicating with the session s source (the caller). This address is used for receiving RTP packets from the source UA. Ex 48 Enabling RTP Relay if the callee's name prefix is 9 To = $rtp = true Ex 49 Enabling RTP Relay and using PCMA as the codec if the callee's SIP URI is $geturi(to) = $rtp = true &net.rtp.audio.payloadtype = 8 19 Brekeke SIP Server Dial Plan Tutorial Ex 50 Enabling RTP Relay and assigning the range of ports from to if the is call from $rtp = true &net.rtp.port.min = $addr = 192\.168\.0\.1$ &net.rtp.port.max = Specifying Environment Variables The environment variable is for setting the server s behavior, administrative information, various internal parameters. To set an environment variable using the Dial Plan, please add the prefix & before the variable name. The environment variable s value set using the Dial Plan is valid only for the session the rule is applied. Ex 51 Using G723 as the codec for all calls &net.rtp.audio.payloadtype = 4 Ex 52 Not Appending Record-Route header if the callee's name prefix is 9 To = &net.sip.addreordroute = false Ex 53 Not Adding lr parameter to Record-Route header if the callee's host name is host $geturi( To ) &net.sip.addreordroute.lr = false 20 Brekeke SIP Server Dial Plan Tutorial Ex 54 Not Appending rport parameter to Via header if the callee's host name is host $geturi( To ) &net.sip.addrport = false Ex 55 Setting the ringing timeout period to 30 seconds if the caller's name is admin From = &net.sip.timeout.ringing = Ex 56 Using Upper Registration to host.domain if the caller's name prefix is 9 $request = ^REGISTER From = &net.registrar.upper.allow = true &net.registrar.upper.url = host.domain $continue = true Ex 57 Adjusting the following registration period as 100 seconds if the current period is less than 100 seconds $request = ^REGISTER Expires = ^[0-9].$ &net.registrar.adjust.expires=100 $continue = true Ex 58 Not Using Thru Registration if the callee's host name is host $request = ^REGISTER $geturi( To ) &net.registrar.thru.allow = false $continue = true 21 Brekeke SIP Server Dial Plan Tutorial 10. Using Session Plug-in The Session Plug-in is a plug-in which is used for controlling sessions and collecting accounting information. The plug-in will be loaded by setting the plug-in name for the handling variable $session. Ex 59 Using RadiusAcct plug-in for all calls $session=com.sample.radius.proxy.radiusacct Ex 60 Using CDRlog plug-in if the callee's host name is host $geturi( To ) $session = com.user.cdrlog 22 Brekeke SIP Server Dial Plan Tutorial
Advertisements
We Need Your Support
Thank you for visiting our website and your interest in our free products and services. We are nonprofit website to share and download documents. To the running of this website, we need your help to support us.

Thanks to everyone for your continued support.

No, Thanks
SAVE OUR EARTH

We need your sign to support Project to invent "SMART AND CONTROLLABLE REFLECTIVE BALLOONS" to cover the Sun and Save Our Earth.

More details...

Sign Now!

We are very appreciated for your Prompt Action!

x