Tuesday 18 September 2012

COR Configuration on Cisco Call Manager Express

The class of restrictions (COR) functionality provides the ability to deny certain call attempts based on the incoming and outgoing class of restrictions provisioned on the dial peers. This functionality provides flexibility in network design, allows users to block calls (for example, international numbers), and applies different restrictions to call attempts from different originators.

COR is used to specify which incoming dial peer can use which outgoing dial peer to make a call. Each dial peer can be provisioned with an incoming and an outgoing COR list. The incoming COR list indicates the capability of the dial peer to initiate certain classes of calls. The outgoing COR list
indicates the capability required for an incoming dial peer to deliver a call via this outgoing dial peer. If the capabilities of the incoming dial peer are not the same or a superset of the capabilities required by the outgoing dial peer, the call cannot be completed using this outgoing dial peer.

Configuration
!
voice class codec 1
 codec preference 1 g711ulaw
!
Trunk group for logical grouping of ports, configuration and joint management of multiple Ports
 trunk group FXO
  voice-class cause-code 1
 hunt-scheme longest-idle
!
Below  frequency & cadence values used in UAE. You guys can get from your local provider because it’s vary from provider to provider.

voice class custom-cptone UAE-Default
dualtone disconnect
  frequency 400
  cadence 400 350 225 525
!
voice-port 0/1/0
 trunk-group FXO
supervisory disconnect dualtone mid-call
 supervisory custom-cptone UAE-Default
 input gain 14
 timeouts interdigit 2
 timeouts call-disconnect 3
 timeouts wait-release 3
caller-id enable
 connection plar 203 

! (PLAR) is a feature used to automatically connect an endpoint to a predetermined destination number as soon as the line goes off-hook Like receptionist number)

voice-port 0/1/1
 trunk-group FXO
 supervisory disconnect dualtone mid-call
 supervisory custom-cptone UAE-Default
 input gain 14
 timeouts interdigit 2
 timeouts call-disconnect 3
 timeouts wait-release 3
 connection plar 203
 caller-id enable
!
voice-port 0/1/2
 trunk-group FXO
supervisory disconnect dualtone mid-call
 supervisory custom-cptone UAE-Default
 input gain 14
 timeouts interdigit 2
 timeouts call-disconnect 3
 timeouts wait-release 3
 connection plar 203
 caller-id enable
!
voice-port 0/1/3
 trunk-group FXO
supervisory disconnect dualtone mid-call
 supervisory custom-cptone UAE-Default
 input gain 14
 timeouts interdigit 2
 timeouts call-disconnect 3
 timeouts wait-release 3
 connection plar 203
 caller-id enable
!

We have to create condition like internal, mobile, and international under dial-peer cor custom. Same Like Partition in CUCM. Then we will use these conditions in outgoing & incoming corlist dial-peers.

!
dial-peer cor custom
 name internal
 name local
 name national
 name mobile
 name international
!
Below are the outgoing calls Corlist dial-peer configurations and will assign to outgoing dial-peers later.

dial-peer cor list internal
 member internal
!
dial-peer cor list local
 member local
!
dial-peer cor list national
 member national
!
dial-peer cor list mobile
 member mobile
!
dial-peer cor list international
 member international
!
Below are the incoming Corlist dial-peers same like CSS in the CUCM. These cor list dial-peers will  
assign to  ephon-dn  in CUCME configuration.

dial-peer cor list Restricted
 member internal
dial-peer cor list LocalCalls
 member internal
 member local
!
dial-peer cor list LongDistance
 member internal
 member local
 member national
member mobile
!
dial-peer cor list International
 member internal
 member local
 member national
 member mobile
 member international
!
dial-peer voice 1 pots
 trunkgroup FXO
 corlist outgoing local
 destination-pattern 9[19]..
 forward-digits 3
!
dial-peer voice 2 pots
 trunkgroup FXO
 corlist outgoing local
 destination-pattern 9[2-8][0-9][1-9]....
 forward-digits 7
!
dial-peer voice 3 pots
 trunkgroup FXO
 corlist outgoing mobile
 destination-pattern 905[056].......
 prefix 05
!
dial-peer voice 4 pots
 trunkgroup FXO
 corlist outgoing national
 destination-pattern 90[234679].......
 prefix 0
!
dial-peer voice 5 pots
 trunkgroup FXO
 corlist outgoing international
 destination-pattern 900T
 prefix 00
!
dial-peer voice 6 pots
 trunkgroup FXO
 corlist outgoing local
 destination-pattern 9600T
 prefix 600
!
dial-peer voice 7 pots
 trunkgroup FXO
 corlist outgoing local
 destination-pattern 9800T
 prefix 800
!
 We want to give full access to manager’s phone that’s why we have assigned the corlist international to Manager’s Phone.
!
Ephone-dn 1 dual-line
 Description “Manager Phone”
Number 100
Corlist incoming international
!
We want to give long distance access to common employees. So these guys can call within country
that’s why we have assigned the corlist national to these guys.
!
phone-dn 2 dual-line
 Description “common employees”
Number 150
Corlist incoming national
!
We want to give local calls access to pantry phones. So these phones can make local calls .that’s why we have assigned the corlist local to these guys.

Ephone-dn 3 dual-line
 Description “Pantry Phone”
Number 155
Corlist incoming local
!
We want to give internal calls access to Lobby phones. So these lobby phones can only make internal calls.that’s why we have assigned the corlist Restricted to these phones
!
Ephone-dn 4 dual-line
 Description “Lobby Phone
Number 200
Corlist incoming Restricted
!

Troubleshooting

You can use the Debug voip caapi inout   command for verification. This will allow you to see which
dial-peer is matching

Thursday 13 September 2012

Digit Manipulation on Voice Gateway

You might encounter situation where you need to control the actual digits contained in the telephone numbers that enter or leave the gateway. You might need to add the area code to a call that is routed out of the public switched telephone network (PSTN), or remove a site code from an intracompany call, for instance. Digit manipulation encompasses adding, subtracting, and changing telephone numbers. You can manipulate calling numbers, called numbers, and redirecting numbers. You can use techniques that are applied to incoming or outgoing calls, or globally to all calls. You can manipulate telephone numbers before a dial peer is matched, or afterward.

 You can perform digit manipulation only on H.323, SIP gateway, Cisco CallManager Express and routers that are using Survivable Remote Site Telephony (SRST).Several different digit manipulation techniques exist, each of which controls telephone numbers in a different way and can be applied at specific points in the call flow. I am going to cover techniques one by one.

Digit stripping
VoIP dial peers transmit all digits in the called number by default. However, POTS dial peers remove, or strip, any outbound digits that explicitly match their destination pattern. For example if users dial 9 to reach an outside number and you don’t want the number 9 sent to the PSTN as part of the called  number. When you configure the destination pattern of a POTS dial peer as 9T, the 9 is matched, so it is stripped and remaining will transmit. In case of 911 or 999 number you want to send all digits to PSTN   then you have to disable the default behavior of the dial-peer. Like no digit-strip
!
Dial-peer voice 1 pots
No digit-strip
Destination-pattern 911
Port 0/0/0:15
!
Forward Digit
Forward digit provides you more control on called numbers which are going to PSTN.  Below are the
Available options in forward-digit

Forward-digits all option allow you to send all called digits to PSTN

Dial-peer voice 1 pots
Destination-pattern 911
Port 0/0/0:15
Forward-digits all (this will forward all digits to PSTN)
!
Forward-digits  Number option gives control on number of digits to be forwarded to PSTN
Dial-peer voice 2 pots
Destination-pattern 9[2-9]……
Port 0/0/0:15
Forward-digits 7 (this will forward 7 digits to PSTN starting from 2-9)
!
Forward-digits extra option tells the gateway to forward any digits that are longer than the length of the destination pattern.
(let’s say you dialed 95554000, forward-digits extra tell the gateway to forward the extra digit 4000 to PSTN)
!
Dial-peer voice 2 pots
Destination-pattern 9555
Port 0/0/0:15
Forward-digits extra
!

Prefix Digit
Prefix digit gives the flexibility to add prefix in the called number. When a user dials the international number 900971501234567, the digits are manipulated before being sent to the PSTN. The original digits 9 and 00 are stripped, and a 00 is prefixed to the remaining number. This way PSTN will receive the number 00971501234567.
Dial-peer voice 3 pots
Destination-pattern 900T
Port 0/0/0:15
Prefix 00
!
Number Expansion
Number expansion is another way to add digits to called number or translate the called number into another number. Hence number expansion is applied globally to the gateway. But keep in mind that Number expansion digit manipulation occurs before any outbound dial peer is matched. 

Let’s say you want to translate 4 digit number (4444) to mobile number 90501234567 then you have to use the num-exp command
!
Num-exp  4444  90501234567
!
For verification use the show dialplan number command
!
Show dialplan number  4444
Macro Exp: 90501234567
!

Voice Translation Rules and Profiles
We can get more granular digit manipulation using translation profile which contains translation rules. The techniques which were discussing before can alter only called number or dialed number identification server (DNIS) digits. Translation profile is much powerful. You can do digit manipulation of called number, calling number or redirected number.

Using voice translation profiles for digit manipulation required three steps.

  1. Create Translation rule. Maximum 15 translation per rule
  2. Create Translation Profile, within translation profile you can user one calling number rule, one called number rule and one redirect number rule
  3. Apply the voice translation profile to all VoIP calls globally, a dial peer, a voice port, a trunk group, a source IP group, or an interface.
Voice Translation Rule
!
Voice translation-rule 1
rule precedence  /matchrule/  /replacerule/
rule 1 /4444/ /5555/

Voice_GW#test voice translation-rule 1 4444
Matched with rule 1
Original number: 4444                     Translated number: 5555
Original number type: none      Translated number type: none
Original number plan: none      Translated number plan: none


Regular Expression Special Characters
Character
Meaning
.
Matches any single character
[]
Matches one number within the brackets; for example, the expression [234] would match either 2, 3, or 4
[^]
Matches a number except one within the bracket
-
Indicates a range of numbers when used within brackets
^
When used before a string, denotes the beginning of a string
$
Denotes the end of a string
*
Matches 0 or more occurrences of the previous expression
+
Matches 1 or more occurrences of the previous expression
?
Matches 0 or 1 occurrence of the previous expression (use Ctrl-v ? to enter in the IOS)
()
Groups digits into sets
\
Changes the meaning of the following character
&
Brings all the matched digits into the replacement string
rule 2 /^555/ /444/
 If you wanted to match 555 only when it appeared at the beginning of a string, you could use the caret character.
To match a string containing only 555, add the dollar sign at the end and the caret at the beginning:
rule 2 /^555$/ /444/

!

Let’s say we have a requirement to add a prefix in calling number from PSTN so users can dialer numbers  from received/miss calls list.
!
voice translation-rule 1
 rule 1 /^\(.*\)/ /9\1/
Breaking the match portion of Rule 1 
·         The caret (^) designates the beginning of a string.
·         In \(.*\), the backslashes change the parentheses from literal characters to set-delimiters. The characters within the set are .*, which matches any character that is repeated zero or more times.
The following list breaks down the replacement portion of the rule
·         9 add the initial literal characters.
·         In the \1 part of the expression, the backslash changes the meaning of the digit 1. It is no longer a literal number instead, it points to the first set in the matching part of the rule. The first set is (.*). Thus, any digits matching that set are inserted after 9.
We are applied the translation-rule 1 in the translation-profile using calling option and after the applied the translation-profile to physical port for all incoming calls from PSTN
!
voice translation-profile addinPrefix 
translate calling 1
!
voice-port 0/0/0:15
translation-profile incoming addinPrefix
!
Let’s assume that PSTN service provider sends 7digit called number of DID on PRI interface but we are using 4digit extension number on IP Phones. Digit manipulation required on voice gateway to achieve the successful call flow.
!
DID 3374xxx and IP Phone extension 4xxx
!
Voice Translation-rule 1
 Rule 1 /^3374/ /4/
!
Voice Translation-profile DIDTranslate called 1
!
voice-port 0/0/0:15
 translation-profile incoming DID!

Troubleshooting Digit Manipulation
When you are troubleshooting digit manipulation, first verify the configuration. Test the digit manipulations as much as possible before deploying them in a live network. If they do not work as expected, check to make sure that they are correctly configured and that other rules do not interfere.
·         test voice translation-rule rule-number phone-number Shows the results of a translation rule, enabling you to test it to ensure that it does what you planned
·         debug voice translation Shows the translations happening
·         show dialplan number number Verifies number expansion and which dial peers a phone number matches
·         debug voip ccapi inout Shows inbound and outbound dial peers being matched
·         show num-exp[number] Displays the number expansion rules configured
·         show dial-peer voice [tag] Displays any CLID, translation profiles, call blocking, disconnect cause, digit stripping, forwarding, or prefixing that is configured on the dial peer
·         show voice translation-rule [number | sort [ascending|descending]] Lists the translation rules that are configured on the router and all translation patterns configured for each one
·         show voice translation-profile [name | sort [ascending|descending]] Lists the translation profiles configured on the router and all translation rules associated with each one
·         debug isdn q931 Shows the called and calling numbers sent out a PRI link for troubleshooting CLID commands
·         csim start phone-number Simulates a phone call from the router; can be used with debugs

Saturday 8 September 2012

FXO Port Configuration on Voice Gateway



As we know that POTS trunks are usually derived from the PSTN  (which is a two-wire service) supports a single call only, that connects to an analog port (FXO) on the Cisco voice gateway.   
I will narrate the details below where I will cover how to configure, verify & troubleshoot the FXO ports used to connect to the PSTN.

Configuration

To configure FXO port, you need to gather below information about the circuit that is being  installed from the PSTN service provider.

Whether dual tone multifrequency (DTMF) or pulse dialing is necessary.
Whether the trunk requires loop-start or ground-start signaling.
Supervision type: call answer/disconnect supervision indication method (Frequency & Cadence)

Note: Keep in mind Frequency & Cadence value are very important for call disconnection, if frequency & Cadence value mismatch then you will observe FXO port hangs/call stay connected on FXO ports.


voice service voip
 allow-connections h323 to h323
 supplementary-service h450.12
!
voice class codec 1
 codec preference 1 g711ulaw
!
Trunk group for logical grouping of ports, configuration and joint management of multiple Ports

trunk group FXO
voice-class cause-code 1
 hunt-scheme longest-idle
!
Below  frequency & cadence values used in UAE. You guys can check from your local provider because it’s vary from provider to provider.

voice class custom-cptone UAE-Default
 dualtone disconnect
  frequency 400
  cadence 400 350 225 525
!
voice-port 0/1/0
 trunk-group FXO
supervisory disconnect dualtone mid-call
 supervisory custom-cptone UAE-Default
 input gain 14
 timeouts interdigit 2
 timeouts call-disconnect 3
 timeouts wait-release 3
caller-id enable
connection plar 203 
(PLAR is a feature used to automatically connect an endpoint to a predetermined destination number as soon as the line goes off-hook Like receptionist number)
!
voice-port 0/1/1
 trunk-group FXO
 supervisory disconnect dualtone mid-call
 supervisory custom-cptone UAE-Default
 input gain 14
 timeouts interdigit 2
 timeouts call-disconnect 3
 timeouts wait-release 3
 connection plar 203
 caller-id enable
!

voice-port 0/1/2
 trunk-group FXO
 supervisory disconnect dualtone mid-call
 supervisory custom-cptone UAE-Default
 input gain 14
 timeouts interdigit 2
 timeouts call-disconnect 3
 timeouts wait-release 3
 connection plar 203
 caller-id enable
!
voice-port 0/1/3
 trunk-group FXO
 supervisory disconnect dualtone mid-call
 supervisory custom-cptone UAE-Default
 input gain 14
 timeouts interdigit 2
 timeouts call-disconnect 3
 timeouts wait-release 3
 connection plar 203
 caller-id enable
!
dial-peer voice 1 pots
 trunkgroup FXO ( We are using trunkgroup instead of Port )
 destination-pattern 9[19]..
 forward-digits 3
!
dial-peer voice 2 pots
 trunkgroup FXO
 destination-pattern 9[2-8][0-9][1-9]....
 forward-digits 7
!
dial-peer voice 3 pots
trunkgroup FXO
destination-pattern 905[056].......
 prefix 05
!
dial-peer voice 4 pots
 trunkgroup FXO
 destination-pattern 90[234679].......
 prefix 0
!
dial-peer voice 5 pots
 trunkgroup FXO
 destination-pattern 900T
 prefix 00
!
dial-peer voice 6 pots
 trunkgroup FXO
 destination-pattern 9600T
 prefix 600
!
dial-peer voice 7 pots
 trunkgroup FXO
 destination-pattern 9800T
 prefix 800
!

Verifying and Troubleshooting

You can use the show voice all status and show voice port summary for verification

Voice_GW# show voice port summary

PORT      CH   SIG-TYPE   ADMIN OPER STATUS   STATUS   EC
========= == ============ ===== ==== ======== ======== ==
0/1/0         --  fxo-ls      up    down idle     on-hook  y
0/1/1         --  fxo-ls      up    down idle     on-hook  y
0/1/2         --  fxo-ls      up    down idle     on-hook  y
0/1/3         --  fxo-ls      up    down idle     on-hook  y