Wednesday, October 21, 2015

New site

Decided to spin up my own blog on a domain....

Here is a link to older Cisco Champions blog post of mine on importing contacts from Web Ex Connect into IM&Presence...



Cleaning up the dial-peer mess

This blog post will go over a few methods in newer Cisco IOS versions to reduce lots of dial peers and potentially just have a few.

There is more global configuration objects, but those can be used by multiple dial peers and depending on your dial plan could reduce dial peer use.

Method 1 -- Use of e164 pattern maps (added in early 15.2 versions)

Configure the E164 pattern map globally, this can be manual e164 entries or can point to a URL (http, tftp, flash, any valid URL IOS can reach). You can not mix manual e164 entries and url in same pattern map. Be careful using the URL method - want to make sure the router can load the file from the URL if it is reloaded, etc. Wouldn't want a unexpected crash/reboot and no patterns could be loaded.

 Multiple dial-peers can reference the same map definition to save on dial-peers.
voice class e164-pattern-map 1000

   description Numbers going to Call Managers

   e164 +1303.......

   e164 +1312.......

   e164 +18.........

Sample using a URL:

voice class e164-pattern-map 1011

   description Numbers going to Call Managers

   url flash:patterns.txt  (or http, tftp, etc)

Upload a file to the router flash called "patterns.txt" in same format as manual entries, can have up to 5000 entries in a file.

patterns.txt
==========
+1303.......
+1312.......
+18.........

For patterns from a URL source, you need to use the "voice class e164-pattern-map load"  command with the e164 pattern map tag number to load it or update the patterns. 

router# voice class e164-pattern-map load 1011

You can verify the pattern-map with the "show voice class e164-pattern-map" command.

router#show voice class e164-pattern-map

There are 2 e164-pattern-map configured


e164-pattern-map 1000
-----------------------------------------
  It has 3 entries
  It is not populated from a file.
  Map is valid.

E164 pattern
-------------------
+1303.......
+1312.......
+18.........

Apply the e164 pattern map to a dial peers...
dial-peer voice 1000 voip

   description Inbound calls from ITSP to Call Manager

   preference 1

   session protocol sipv2

   session target ipv4:10.10.10.10

   destination e164-pattern-map 1000

   voice-class codec 1

   dtmf-relay rtp-nte


dial-peer voice 1001 voip

   description Inbound calls from ITSP to Call Manager

   preference 2

   session protocol sipv2

   session target ipv4:10.10.10.11

   destination e164-pattern-map 1000

   voice-class codec 1 

   dtmf-relay rtp-nte

   huntstop

Method 2 - server-groups  (added in 15.4(1)T)

You can only have 5 servers listed in a server group at the moment and can hunt by preference (default) or round-robin.

voice class server-group 1000
   description Call Managers
   ipv4 10.10.10.10 preference 1
   ipv4 10.1.1.2 preference 2
   ipv4 10.1.1.3 preference 3
   [hunt-scheme round-robin] -- Add this if you want to do round robin hunt

Apply it to the dial-peer,

dial-peer voice 1000 voip

   description Inbound calls from ITSP to Call Manager

   preference 1

   session protocol sipv2

   session server-group 1000

   destination e164-pattern-map 1000

   voice-class codec 1

   dtmf-relay rtp-nte


If you try to add more than 5 servers to the server-group, you get this error, "%ERROR: Max 5 server ip addresses have been inserted to the group"

Showing status of server-group and info,

show voice class server-group dialpeer 1000

Voice class server-group: 1000   AdminStatus: Up
 Hunt-Scheme: preference
 Total Remote Targets: 3

 Pref   Type   IP Address                               IP Port
 ----   ----   ----------                               -------
 1      ipv4   10.10.10.10
 2      ipv4   10.10.10.11
 3      ipv4   10.10.10.12

Displays the configurations made for the server group.

Device# show voice class server-group 1000

Voice class server-group: 1000
 AdminStatus: Up                 OperStatus: Up
 Hunt-Scheme: preference         Last returned server: 10.10.10.10
 Description: Call Managers
 Total server entries: 3

 Pref   Type   IP Address                               IP Port
 ----   ----   ----------                               -------
 1      ipv4   10.10.10.10
 2      ipv4   10.10.10.11
 3      ipv4   10.10.10.12


Method 3 - Using incoming URI instead of incoming called-number

Control the inbound leg of your voip calls so they terminate on one dial peer, instead of having multiple or the calls terminating to the default 0 dial peer.
voice class uri FromITSP sip
   host ipv4:1.2.3.4
   host ipv4:4.5.6.7

dial-peer voice 2000 voip
   description Inbound calls
   session protocol sipv2
   session transport udp
   incoming uri via FromITSP
   voice-class codec 1
   dtmf-relay rtp-nte
   no vad
References:
Whoah, that's heavy.