Question? Leave a message!




How configure voice gateway

configure calling privileges on a voice gateway
Dr.MohitBansal Profile Pic
Dr.MohitBansal,Canada,Teacher
Published Date:26-10-2017
Your Website URL(Optional)
Comment
Implementing Dial Plans After reading this chapter, you should be able to perform the following tasks: ■ Describe how to configure a gateway for digit manipulation. ■ Explain how to configure a gateway to perform path selection. ■ Describe how to configure calling privileges on a voice gateway. Although a Cisco Unified Communications Manager (UCM) server can perform digit manipulation, perform path selection, and enforce calling privileges (for example, through the use of partitions and calling search spaces), voice-enabled Cisco IOS gateways can perform similar functions. In fact, Cisco IOS gateways have even more granular control of call routing, as compared to UCM (for example, being able to route a call based on caller ID information). This chapter demonstrates a variety of approaches to manipulate num- bers on Cisco IOS gateways. Additionally, path selection is discussed, and you will learn how to use the Class of Restriction (COR) feature to implement calling restrictions on dial peers. Configuring Digit Manipulation At times, you might need to manipulate the digits of the telephone numbers that come into and go out of your voice gateway. You might need to remove site codes for intersite calls or add area codes and other digits for routing calls through the PSTN. This section covers digit manipulation and digit manipulation tools. Digit Collection and Consumption If an endpoint sends dialed digits one-by-one, Cisco Unified Communications Manager Express starts digit analysis immediately upon receiving the first digit. With each addi- tional digit that is received, Cisco Unified Communications Manager Express can reduce the list of potential matches (that is, the call-routing table entries that match the digits422 Implementing Cisco Unified Communications Voice over IP and QoS (CVoice) Foundation Learning Guide that have been received so far). After a single entry, such as the directory number 1001 in Figure 5-1, is matched, the so-called current match is used and the call is sent to the cor- responding device. 1000 Dialed Digits Destination Patterns 1… none Potential Matches 10… 1 Potential Matches 0 Potential Matches 0 Potential Matches 1 Find the Most Explicit Match Call Setup Dialed Digits 1001 1001 Find the Most Explicit Match Figure 5-1 Digit Collection Methods—Digit-by-Digit and En Block Note Cisco Unified Communications Manager Express does not always receive dialed digits one-by-one. Skinny Client Control Protocol (SCCP) phones always send digit-by- digit. Session Initiation Protocol (SIP) phones can use either en bloc dialing, to send the whole dialed string at once, or Keypad Markup Language (KPML), to send digit-by-digit. If digits are received en bloc, the whole received dial string is checked at once against the dial plan. Cisco Unified Communications Manager Express Addressing Method Table 5-1 shows the addressing methods that Cisco Unified Communications Manager Express supports for different devices. With SIP, en bloc dialing or KPML can be used. With en bloc dialing, the whole dialed string is sent in a single SIP Invite message. KPML allows digits to be sent one-by-one. SIP dial rules are processed inside the SIP phone. Therefore, a SIP phone can detect invalid numbers and play a reorder tone, without sending any signaling messages to Cisco Unified Communications Manager Express. If dialed digits match an entry of a SIP dial rule, the dialed string is sent in a single SIP Invite message to Cisco Unified Communications Manager Express. If Cisco Unified Communications Manager Express requires more digits, KPML can be used to send the remaining digits one-by-one, from the SIP phone to Cisco Unified Communications Manager Express.Chapter 5: Implementing Dial Plans 423 Table 5-1 Cisco Unified Communications Manager Express Addressing Method Device Signaling Protocol Addressing Method IP phone SCCP Digit-by-digit or En bloc (Type B phones only) IP phone SIP En bloc or KPML (Type B phones only) or SIP dial rules Gateway MGCP/SIP/H.323 En bloc or Overlap sending and receiving (ISDN PRI only) ISDN PRIs can be configured for overlap sending and receiving, allowing digits to be sent or received one-by-one over an ISDN PRI. User Input on SCCP Phones Whether a number is signaled digit-by-digit or en bloc depends not only on the config- ured signaling protocol but also on the phone model (Type A or Type B) that is used and on how the phone number is dialed. Examples of Type A phones include Cisco Unified IP Phones 7940 and 7960, while examples of Type B phones include Cisco Unified IP Phones 7941, 7942, 7945, 7961, 7962, 7965, 7970, and 7970. For Cisco SCCP IP phones, the following rules apply: ■ Type A IP phones support only digit-by-digit signaling. ■ Type B IP phones support digit-by-digit signaling as well as en bloc signaling. ■ En bloc dialing is used when a call is placed by the user entering the number while the phone is on-hook and then pressing the Dial softkey. Calls that are set up via call list entries or speed dials also use en bloc signaling. ■ En bloc dialing, which is enabled by default, can be disabled via the product-spe- cific Enbloc Dialing configuration parameter from the Phone Configuration page. ■ Digit-by-digit dialing is used whenever the number is dialed after the phone is put off-hook. Note The dialing behavior might vary based on the phone load version that is used.424 Implementing Cisco Unified Communications Voice over IP and QoS (CVoice) Foundation Learning Guide SCCP Digit Collection As depicted in Figure 5-2, an SCCP endpoint detects all user events and individually relays them to the Cisco Unified Communications Manager Express. A user who goes off-hook and then dials 1000 would trigger five individual signaling events from the phone to the gateway. All the resulting feedback that is provided to the user, such as screen messages, playing dial tone, secondary dial tone, ringback, and reorder tone, are commands that are issued by the Cisco Unified Communications Manager Express to the phone in response to the dial plan configuration. SCCP message sent Dial Plan with each user action. (Digit Analysis) Off-Hook, Digit 1, Digit 0, Digit 0, Digit 0 SCCP Dial Tone On/Off, Screen Update, etc. Phone Dialing Actions: 1 0 0 0 Figure 5-2 SCCP Digit Collection It is neither required nor possible to configure dial plan information on Cisco Unified IP Phones running SCCP. All dial plan functionality is contained in the Cisco Unified Communications Manager Express system, including the recognition of dialing patterns as user input is collected. If a user dials a pattern that is denied by Cisco Unified Communications Manager Express, a reorder tone is played to the user when that pattern becomes the best match in Cisco Unified Communications Manager Express digit analysis. For instance, if all calls to 92000 are denied, a reorder tone would be sent to the user phone as soon as the user dials 92000. SIP Digit Collection (Simple Phones) With en bloc number reporting, a phone accumulates all user input events until the user presses either the key or the Dial softkey. This function is similar to the Dial button used on many mobile phones. For example, consider Figure 5-3. A user making a call to extension 1000 would have to press 1, 0, 0, and 0 followed by the Dial softkey or the key. The phone would then send a SIP Invite message to Cisco Unified Communications Manager Express to indicate that a call to extension 1000 is requested. As a call reaches a gateway, it is subjected to the dial plan, including all the class of service and call-routing logic.Chapter 5: Implementing Dial Plans 425 SIP INVITE message sent when user presses Dial Plan (Digit Analysis) the Dial key. “Call for 1000” Simple SIP Call in progress, call connected, call denied, etc. Phone Dialing Actions: 1 0 0 0 Dial Figure 5-3 SIP Digit Collection (Simple Phones) SIP Digit Collection (Enhanced Phones) Type B SIP phones offer functionality that is based on KPML to report user activities. Each one of the user input events generates its own KPML-based message to Cisco Unified Communications Manager Express. From the standpoint of relaying each user action immediately to Cisco Unified Communications Manager Express, this mode of operation is similar to that of phones running SCCP. Every user key press triggers a SIP NOTIFY message to Cisco Unified Communications Manager to report a KPML event corresponding to the key pressed by the user. This messaging enables Cisco Unified Communications Manager Express digit analysis to rec- ognize partial patterns as they are composed by the user, and to provide appropriate feedback such as an immediate reorder tone if an invalid number is being dialed. In contrast to Type A IP phones running SIP, Type B SIP phones have no Dial key to indi- cate the end of user input. In Figure 5-4, a user dialing 1000 would be provided call progress indication (either a ringback tone or reorder tone) after dialing the last 0 and without having to press the Dial key. This behavior is consistent with the user interface on phones running the SCCP protocol. Dial Plan KPML events reported in SIP NOTIFY messages. (Digit Analysis) Off-Hook, Digit 1, Digit 0, Digit 0, Digit 0 SIP Enhanced Call in progress, call connected, call denied, etc. Phone Dialing Actions: 1 0 0 0 Figure 5-4 SIP Digit Collection (Enhanced Phones)426 Implementing Cisco Unified Communications Voice over IP and QoS (CVoice) Foundation Learning Guide Dial-Peer Management Examples 5-1, 5-2, and 5-3 demonstrate the impact that overlapping destination patterns have on the call-routing decision. The first two examples illustrate dial-peer management using digit-by-digit collection. In Example 5-1, the destination pattern (555) in dial peer 1 is a subset of the destination pattern (555....) in dial peer 2. With digit-by-digit number collection, the router matches one digit at a time against available dial peers. This means that an exact match will always occur on dial peer 1, and dial peer 2 will never be matched. Example 5-1 Dialed Digits 5550124 (One-by-One) Router(config)dial-peer voice 1 voip Router(config-dial-peer)destination-pattern 555 Router(config-dial-peer)session target ipv4:10.18.0.1 Router(config-dial-peer)exit Router(config)dial-peer voice 2 voip Router(config-dial-peer)destination-pattern 5550124 Router(config-dial-peer)session target ipv4:10.18.0.2 In Example 5-2, the length of the destination patterns in both dial peers is the same. Dial peer 2 has a more specific value than dial peer 1, so it will be matched first. If the path to IP address 10.18.0.2 is unavailable, dial peer 1 will be used. Example 5-2 Dialed Digits 5550124 (One-by-One Continued) Router(config)dial-peer voice 1 voip Router(config-dial-peer)destination-pattern 555.... Router(config-dial-peer)session target ipv4:10.18.0.1 Router(config-dial-peer)exit Router(config)dial-peer voice 2 voip Router(config-dial-peer)destination-pattern 5550124 Router(config-dial-peer)session target ipv4:10.18.0.2 Example 5-3 examines the dial-peer management when the called number has been received en block. Because the entire called number is available immediately, the second dial peer will match, because it offers the most explicit match. The entire called number (5550124) will be forwarded to the session target. Example 5-3 Dialed Digits 5550124 (En Bloc) Router(config)dial-peer voice 1 voip Router(config-dial-peer)destination-pattern 555 Router(config-dial-peer)session target ipv4:10.18.0.1 Router(config-dial-peer)exitChapter 5: Implementing Dial Plans 427 Router(config)dial-peer voice 2 voip Router(config-dial-peer)destination-pattern 5550124 Router(config-dial-peer)session target ipv4:10.18.0.2 Digit Manipulation Digit manipulation is the task of adding or subtracting digits from the original dialed number to accommodate user dialing habits (for example, the habit of prepending an area code to a seven-digit dial string) or gateway needs. Digit manipulation incorporates adding, subtracting, and changing telephone numbers. For example, you might need to add the area code to a call that will be routed out to the PSTN or remove a site code from an intersite call with the same company. You can manipulate called numbers, calling numbers, and redirected numbers, as well as the number type. You can apply digit manip- ulation to incoming or outgoing calls or to all calls globally. You can manipulate digits before or after matching a dial peer. Because the call agent performs digit manipulation in a Media Gateway Control Protocol (MGCP) network, digit manipulation might be performed only on H.323 and Session Initiation Protocol (SIP) gateways. Digit manipulation is an important aspect of any dial plan, and various tools exist on Cisco IOS gateways to perform this task, including the following: ■ Basic digit manipulation: Digit manipulation covers a spectrum of possibilities, in- cluding prepending digits, stripping digits, or changing specific digits. Examples are ■ The digit-strip command is a dial-peer command that strips off the matched digits in a destination pattern of a dial peer. The digit-strip command is sup- ported on plain old telephone service (POTS) dial peers only. Digit stripping occurs after the outbound dial peer is matched and before any digits are sent out. The called number is manipulated using digit stripping. Digit stripping is enabled by default on POTS dial peers. ■ The forward-digits num-digits all extra command is a dial-peer command that specifies how many matched digits should be forwarded. To specify which digits to forward for voice calls, use the forward-digits command in dial-peer configuration mode. To specify that any digits not matching the destination- pattern are not to be forwarded, use the no form of this command. This com- mand applies only to POTS dial peers. Forwarded digits are always right-justified so that extra leading digits are stripped. The destination-pattern includes both explicit digits and wildcards if present. Digit forwarding occurs after the outbound dial peer is matched and before any digits are sent out. The called number is manipulated using digit forwarding. ■ The prefix command is a dial-peer command that prefixes the specified digits to the number forwarded by the dial peer. Use this command to specify a prefix for a specific dial peer. When an outgoing call is initiated to this dial peer, the428 Implementing Cisco Unified Communications Voice over IP and QoS (CVoice) Foundation Learning Guide prefix string value is sent to the telephony interface first, before the telephone number, associated with the dial peer. If you want to configure different pre- fixes for dialed numbers on the same interface, you need to configure different dial peers. This command is applicable only to POTS dial peers. This command also applies to off-ramp store-and-forward fax functions. Digit prefixing occurs after the outbound dial peer is matched and before any digits are sent out. The called number is manipulated using digit prefixing. ■ The num-exp command is a global command that applies to all calls and per- forms a match-and-replace operation to inflate or deflate numbers. This com- mand is typically used for short dials and site codes. Number expansion occurs prior to matching a dial peer. The called number is manipulated using number expansion. For example, a four-digit number could be used by an employee to call a co-worker. That four-digit number could then be translated to that co- worker’s home phone number and forwarded out to the PSTN. ■ The clid command can be used to modify the calling line ID (CLID, and also known as caller ID); for example, to restrict caller ID information. CLID manipu- lation occurs after the outbound dial peer is matched and before any digits are sent out. The calling number and name are manipulated using CLID manipulation. ■ Voice translation rules and profiles: Voice translation rules and profiles are the most powerful Cisco IOS tools you can use to perform digit manipulation. Using regular expressions, a numbering plan, and Type of Number (TON) matching, you can make nearly any possible modification. The only drawback is the complex syntax. Thus, voice translation rules are often combined with simpler mechanisms. The order of operation in digit manipulation follows the call through the gateway, as shown in Figure 5-5. For inbound POTS calls, rules configured on the voice port are applied first, followed by the incoming dial peer, and then the outgoing dial peer. For inbound Voice over IP (VoIP) calls, global voice translation profiles are applied first, fol- lowed by the incoming dial peer, and then the outgoing dial peer. Note the num-exp command is applied globally before any dial-peer matching. When possible, you should use a single method of accomplishing the required digit manipulations. For example, do not use both the forward-digits and the prefix com- mands in a dial-peer configuration. It is possible to use all the digit manipulation methods in a gateway. A single dial peer can be configured with prefixes, voice translation rules, and clid commands. A call can be modified by the voice port, number expansion, inbound dial-peer, and outbound dial- peer configuration commands in single or multiple gateways. Understanding the order of operation in digit manipulation is important not only for configuration and test purposes, but also for assisting in troubleshooting.Chapter 5: Implementing Dial Plans 429 POTS VoIP 1. Inbound Voice Port Digit Manipulation 1. Match Outbound Dial Peer 2. Number Expansion 2. CLID 3. Match Inbound Dial Peer 3. Voice Translation Profile 4. CLID 5. Voice Translation Profile POTS VoIP 1. Match Outbound Dial Peer 1. Global Voice Translation 2. Voice Translation Profile Profiles 3. CLID 2. Number Expansion 4. Digit Strip 3. Match Inbound Dial Peer 5. Prefix 4. CLID 6. Forward Digits 5. Voice Translation Profile Figure 5-5 Digit Manipulation Order of Operations Digit Stripping Digit stripping strips any outbound digits that explicitly match the destination pattern of a particular dial peer. By default, POTS dial peers strip any outbound digits that explic- itly match their destination pattern, whereas VoIP dial peers transmit all digits in the called number. For example, given a destination pattern of 5551..., the number transmit- ted to the PSTN would contain the last three digits. The first four digits, 5551, would be stripped because they explicitly match the destination pattern. In Figure 5-6, users dial 9 to reach an outside number. If the configured destination pat- tern is 9T, the 9 is matched and stripped from the called number sent to the PSTN. On the other hand, you might have a dial peer for an emergency number, such as 911 in the United States. If the destination pattern is 911, you would not want the numbers stripped when they are explicitly matched. In this case, you could use the no digit-strip command to disable the automatic digit stripping function. This allows the router to match digits and pass them to the telephony interface. Figure 5-6 shows an example of this behavior. Digit Forwarding If you need more control over the digits that are being transmitted to the PSTN, you can use digit forwarding. Digit forwarding specifies the number of digits that must be for- warded to the telephony interface, regardless of whether they match explicitly or with wildcards. When a specific number of digits are configured for forwarding, the count is right-justified. For example, in Figure 5-7, the POTS dial peer has a destination pattern configured to match all extensions in the 1000 range. By default, only the last three digits are forwarded to the PBX that is connected to the specified voice port. If the PBX needs all four digits to route the call, you could use the forward-digits 4 or forward-digits all command so that the appropriate number of digits are forwarded. Incoming Call430 Implementing Cisco Unified Communications Voice over IP and QoS (CVoice) Foundation Learning Guide dial-peer voice 9 pots destination-pattern 9T Dialed Number: Transmitted Number: 9 281 555-1234 281 555-1234 PSTN V Dialed Number: Transmitted Number: 911 None Reorder Tone dial-peer voice 911 pots destination-pattern 911 Dialed Number: Transmitted Number: 911 911 dial-peer voice 911 pots destination-pattern 911 no digit-strip Figure 5-6 Digit Stripping Example dial-peer voice 1000 pots destination-pattern 1... Transmitted Number: Dialed Number: 234 1234 V Ext.1234 PBX Transmitted Number: Dialed Number: 1234 1234 dial-peer voice 1000 pots destination-pattern 1... forward-digits 4 Figure 5-7 Digit Forwarding Example Note Digit forwarding applies only to POTS dial peers.Chapter 5: Implementing Dial Plans 431 Digit Prefixing Digit prefixing adds digits to the front of a dial string before it is forwarded to a teleph- ony interface. Use the prefix command when the dialed digits leaving the router must be changed from the dialed digits that had originally matched the dial peer. For example, consider Figure 5-8. A call is dialed using a four-digit extension, such as 2123, but the call needs to be routed to the PSTN, which requires ten-digit dialing. If the four-digit extension matches the last four digits of the actual PSTN number, you can use the prefix 5125552 command to prepend the seven additional digits needed for the PSTN to route the call to 512 555-2123. After the POTS dial peer is matched with the destination pat- tern of 2123, the prefix command prepends the additional digits and the string “5125552123” is sent out of the voice port to the PSTN. dial-peer voice 2000 pots destination-pattern 2... PSTN preference 1 prefix 5125552 port 0/1:23 V V WAN is down 10.1.1.1 512 555-2123 Dialed Number: 2123 dial-peer voice 3000 voip destination-pattern 2... WAN session target ipv4:10.1.1.1 Figure 5-8 Digit Prefixing Example Number Expansion Number expansion is an alternative method of adding digits to outgoing calls. Whereas prefixing is applied to a single dial peer, number expansion is applied globally to all calls, not just to calls matching a single designated dial peer. The num-exp global command expands a partial telephone number into a full telephone number or replaces one number with another. The number expansion table manipulates the called number. Because number expansion occurs before the outbound dial peer is matched, for the call to be successful you must configure the outbound dial peer with the expanded number in the destination pattern instead of the original number. The number Transmitted Number: 5125552123432 Implementing Cisco Unified Communications Voice over IP and QoS (CVoice) Foundation Learning Guide expansion table becomes useful when the PSTN changes the dialing requirements from seven-digit dialing to ten-digit dialing. In this scenario, you can do one of the following: ■ Make all the users dial all ten digits to match the new POTS dial peer that is pointing to the PSTN. ■ Allow the users to continue dialing the seven-digit number as they have before, but expand the number to include the area code before the ten-digit outbound dial peer is matched. Consider Figure 5-9 and Example 5-4. Using the number expansion feature, a caller is using a seven-digit dial string. However, the number expansion feature configured in the router prepends the area code of 281 to the dial string. This ten-digit dial string is then passed to the PSTN. Dialed Number: Transmitted Number: 555-1234 281 555-1234 PSTN V 281 555-1234 Figure 5-9 Number Expansion Topology Example Example 5-4 Number Expansion Configuration Router(config)num-exp 5551... 2815551... Router(config)dial-peer voice 2000 pots Router(config-dial-peer)destination-pattern 2815551... Router(config-dial-peer)port 0/1:23 Router(config-dial-peer)forward-digits all Note You can use the show num-exp command to view the configured number expan- sion table. You can use the show dialplan number string command to confirm the pres- ence of a valid dial peer to match the newly expanded number. Simple Digit Manipulation for POTS Dial Peers Example Figure 5-10 shows the operation of simple digit manipulation for POTS dial peers. A user dials 9 1 312 555-0123, and the call is handled by the dial-peer voice 9 pots com- mand on the H.323 gateway. Depending on the commands, the Dialed Number Information Service (DNIS) information will be modified differently: ■ If the no digit-strip command is used, the DNIS will be 913125550123. No digits are modified.Chapter 5: Implementing Dial Plans 433 ■ If the digit-strip command is used, which is the default on all POTS dial peers, the matched 9 will be stripped off, resulting in a DNIS of 13125550123. ■ If the forward-digits 4 command is used, only the last four digits will be forwarded, resulting in a DNIS of 0123. ■ If the prefix 9 and digit-strip commands are used in combination, the 9 is first stripped off and then prefixed again, resulting in a DNIS of 913125550123. dial-peer voice 9 pots User Dials destination 9T 9 1 312 555-0123 PSTN V 1 312 555-0123 Phone1-1 H.323 Gateway 2001 DID: 4085552XXX Command DNIS no digit-strip 913125550123 digit-strip (default) 13125550123 forward-digits 4 0123 prefix 9 and digit-strip 913125550123 Figure 5-10 Simple Digit Manipulation for a POTS Dial Peer Number Expansion Example Figure 5-11 and Example 5-5 show how the num-exp command defines short dials. 1 3 User Dials 0123 Phone Rings Router PSTN V 13125550123 2001 2 Number Is Expanded to 13125550123 and Routed to PSTN Figure 5-11 Digit Manipulation with Number Expansion434 Implementing Cisco Unified Communications Voice over IP and QoS (CVoice) Foundation Learning Guide Example 5-5 Digit Manipulation with Number Expansion Configuration Router(config)num-exp 0... 913125550... Router(config)dial-peer voice 9 pots Router(config-dial-peer)destination 9T If a user dials 0123, the call should be routed to DNIS 913125550123: 1. A user dials 0123. 2. Because the gateway has the configuration num-exp 0... 913125550..., DNIS 0123 is matched and modified to 913125550123. This DNIS matches dial peer 9, which routes the call to the PSTN. 3. The PSTN phone rings. Note This example shows how digit manipulation occurs prior to outbound dial-peer matching. Caller ID Number Manipulation You can use the clid command to modify caller ID information. The CLID message can include two calling numbers: one “user provided, unscreened” and one “network provided.” CLID Commands Following are some of the clid commands: ■ clid network-number number: Sets the network-provided number in the Information Element (IE) message and sets the presentation bit to allow the calling-party number to be presented. ■ clid second-number strip: Removes the user-provided number, or second number, from this IE message. You can also leave the existing network number unaltered while removing the user-provided number from the IE. ■ clid restrict: Sets the presentation bit to prevent the display of the CLID information. This command does not remove the calling numbers from the IE message. It is possi- ble to remove the numbers completely using the clid strip command. To remove both the calling number and the calling name, you must enter the clid strip command twice: once with the name option and once without. Station ID Commands You can use the station-id command to control the caller ID information sent by an FXS or FXO port. The information specified with this command shows up as the caller ID of the device connected to the FXS port. This command is often used on FXS portsChapter 5: Implementing Dial Plans 435 connected to fax machines that make on-net calls, as illustrated in Figure 5-12 and Example 5-6. FXS Port 0/0/0 WAN Router Figure 5-12 Caller ID Number Manipulation Example 5-6 Caller ID Number Manipulation Example Router(config)voice-port 0/0/0 Router(config-voiceport)station-id name HQ Fax Router(config-voiceport)station-id number 7135551003 Following are some of the station-id commands: ■ station-id name string: Specifies the name sent in the CLID information ■ station-id number number: Specifies the number sent in the CLID information Displaying Caller ID Information Sometimes, it is useful to display the CLID information that will be sent. Use the show dialplan number number command to determine what CLID information will be sent in an IE message. Example 5-7 shows the dial-plan information with no CLID commands applied. Example 5-7 show dialplan number Command—First Example Routershow dialplan number 914085551234 Macro Exp.: 914085551234 VoiceEncapPeer91 peer type = voice, information type = voice, description = ‘’, tag = 91, destination-pattern = ‘91..........’, answer-address = ‘’, preference=0, CLID Restriction = None CLID Network Number = ‘’ CLID Second Number sent CLID Override RDNIS = disabled, source carrier-id = ‘’, target carrier-id = ‘’, source trunk-group-label = ‘’, target trunk-group-label = ‘’, numbering Type = ‘unknown’436 Implementing Cisco Unified Communications Voice over IP and QoS (CVoice) Foundation Learning Guide Example 5-8 shows the result of adding a clid network-number command to the dial peer. Example 5-8 show dialplan number Command—Second Example Router(config-dial-peer)clid network-number 5551234 Routershow dialplan number 914085551234 Macro Exp.: 914085551234 VoiceEncapPeer91 peer type = voice, information type = voice, description = ‘’, tag = 91, destination-pattern = ‘91..........’, answer-address = ‘’, preference=0, CLID Restriction = None CLID Network Number = ‘5551234’ CLID Second Number sent CLID Override RDNIS = disabled, source carrier-id = ‘’, target carrier-id = ‘’, source trunk-group-label = ‘’, target trunk-group-label = ‘’, numbering Type = ‘unknown’ Example 5-9 shows the result of using the clid strip command. Example 5-9 show dialplan number Command—Third Example Router(config-dial-peer)clid strip Routershow dialplan number 914085551234 Macro Exp.: 914085551234 VoiceEncapPeer91 peer type = voice, information type = voice, description = ‘’, tag = 91, destination-pattern = ‘91..........’, answer-address = ‘’, preference=0, CLID Restriction = clid strip CLID Network Number = ‘’ CLID Second Number sent CLID Override RDNIS = disabled, source carrier-id = ‘’, target carrier-id = ‘’, source trunk-group-label = ‘’, target trunk-group-label = ‘’, numbering Type = ‘unknown’Chapter 5: Implementing Dial Plans 437 Voice Translation Rules and Profiles Number translation occurs several times during the call-routing process. In both the originating and terminating gateways, the incoming call is translated before an inbound dial peer is matched, before an outbound dial peer is matched, and before a call request is set up. Your dial plan should account for these translation steps when translation rules are defined. Digit translation is a two-step configuration process. First, the translation rule is defined at the global level. Then, the rule is applied at the dial-peer level either as inbound or out- bound translation on either the called or calling number. Translation rules also convert a telephone number into a different number before the call is matched to an inbound dial peer or before the outbound dial peer forwards the call. For example, an employee might dial a five-digit extension to reach another employee of the same company at another site. If the call is routed through the PSTN to reach the other site, the originating gateway might use translation rules to convert the five-digit extension into the ten-digit format that is recognized by the central office (CO) switch. A translation rule might manipulate a calling-party number (Automatic Number Identification ANI) or a called-party number (DNIS) for incoming, outgoing, and redi- rected calls within voice-enabled gateways. You can also use translation rules to change the numbering type for a call. For example, some gateways might tag a number with more than 11 digits as an international number, even when the user must dial 9 to reach an outside line. In this case, the number that is tagged as an international number needs to be translated into a national number, without the 9, before it is sent to the PSTN. Voice translation rules might define up to 15 rules that include Stream Editor (SED)-like expressions (that is, similar to expressions used with the UNIX SED utility) for process- ing the call translation. A maximum of 128 translation rules are supported. These transla- tion rules are grouped into profiles that are referenced by trunk groups, dial peers, source IP groups, voice ports, and interfaces. The voice translation rules are associated with a voice translation profile, which can refer- ence up to three voice translation rules: ■ A voice translation rule that is used to manipulate the called number (that is, the DNIS) ■ A voice translation rule that is used to manipulate the calling number (that is, the ANI) ■ A voice translation rule that is used to manipulate the redirected called number (that is, the Redirected Dialed Number Identification Service RDNIS)438 Implementing Cisco Unified Communications Voice over IP and QoS (CVoice) Foundation Learning Guide The resulting voice translation profile can be attached to these: ■ VoIP dial peers ■ Voice ports ■ Any inbound VoIP call ■ A specific range of source IP addresses in VoIP calls ■ A trunk group ■ A T1/E1 controller that is used for Nonfacility Associated Signaling (NFAS) trunks ■ Survivable Remote Site Telephony (SRST) Each of these can reference two voice translation profiles: one for incoming calls and one for outgoing calls. You can use the voice translation-rule command to create the defini- tion of a translation rule. Figure 5-13 illustrates the concept of voice translation profiles and rules. Each voice translation rule can have up to 15 individual subrules. The voice translation rule is then referenced by a voice translation profile for called, calling, and redirected called numbers. Note that the same voice translation rule can be referenced by multiple voice translation profiles. Up to 128 voice translation rules are supported in a Cisco IOS gateway. Profile 1 2 3 4 5 Called Rule 6 7 8 9 10 VoIP Dial Peer 11 12 13 14 15 Voice Port VoIP Incoming 1 2 3 4 5 Incoming Source IP Group Calling Rule 6 7 8 9 10 Outgoing 11 12 13 14 15 Trunk Group NFAS 1 2 3 4 5 SRST Redirected Rule 6 7 8 9 10 Called 11 12 13 14 15 Figure 5-13 Voice Translation Rules and Profiles Note Although you can have up to 15 subrules within a voice translation rule, the first matching rule will be applied, and no further subrules will be considered.Chapter 5: Implementing Dial Plans 439 Voice translation rules use regular expressions for match-and-replace operations. The syntax is very similar to the UNIX SED tool. Table 5-2 describes the most important reg- ular expressions available. Table 5-2 Regular Expressions for Voice Translation Rules Voice Translation Description Rule Character Match the expression at the start of the line. Match the expression at the end of the line. / Delimiter that marks the start and end of both the matching and replacement strings. \ Escape the special meaning of the next character. - Indicate a range when not in the first/last position. Used with the and characters. list Match a single character in a list. list Do not match a single character specified in the list. . Match any single character. Repeat the previous regular expression (regex) zero or more times. + Repeat the previous regular expression one or more times. ? Repeat the previous regular expression zero or one time (use Ctrl-V to enter in Cisco IOS, because Cisco IOS interprets a ? character as a request for context-sensitive help). () Group regular expressions. Understanding Regular Expressions in Translation Rules It is important that you understand how regular expressions are used in translation rules. When the router evaluates a translation rule, it is really only performing a “match this” and “change to this” operation on the regex. Consider the following example, as illustrated in Figure 5-14. To further illustrate the configuration of translation rules, consider the following: ■ This rule will be used to change the outgoing DNIS to a ten-digit number for routing across the PSTN. The rule will be applied outgoing on an interface, port, or dial peer. Router(config)voice translation-rule 1 Router(cfg-translation-rule)rule 1 /1.../ /4085551.../440 Implementing Cisco Unified Communications Voice over IP and QoS (CVoice) Foundation Learning Guide ■ This rule will be used to change the incoming ANI to a four-digit number after routing across the PSTN. The rule will be applied incoming on an interface, port, or dial peer. Router(config)voice translation-rule 2 Router(cfg-translation-rule)rule 1 /4085551... / /1.../ rule 1 /1…//4085551…/ This regex says 1… 4085551… match and change to Austin San Jose PSTN-Out PSTN V V PSTN-In User dials 1001 to reach a San Jose extension but has WAN to go through the PSTN. 1XXX Figure 5-14 Regular Expressions in Translation Rules Table 5-3 illustrates the match-and-replace rules for these rules. Table 5-3 Match-and-Replace Table Rule Match This Change To /1.../ /4085551.../ 1... 4085551... /408553.../ /1.../ /4085551.../ /1.../ What if you needed to prepend a 9 to all outgoing calls? It would not be feasible to use individual translation rules for each number because of the number of rules needed. For example: rule 1 /4085550100/ /94085550100/ rule 2 /4085550101/ /94085550101/ rule 3 /4085550102/ /94085550102/