cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2203
Views
10
Helpful
9
Replies

Route call in CUBE by calling party number (call from CUCM)

voip7372
Level 4
Level 4

I have a CUBE router (4351) that receives calls from 3 different sources.  One source is the phone company (calls to our DID number).  Another source is inContact (calls to internal phones on CUCM or external numbers).  And finally, calls from the phone company to our toll free numbers (IP toll free service).  The calls going back out TO the PSTN from our DID numbers and calls going out TO inContact are fine and those are routed by the CALLED party number.  My issue now is finding a way to send calls to our IP Toll Free service.  I only want to send calls to the IP Toll Free entity (IP address) IF the call is originating from one of our toll free numbers in CUCM.  Our toll free numbers (like our DIDs) are +E.164 format, like +18005551212.  So for example, if we want to send a call out from CUCM to the CUBE router and then send that to the IP toll free provider based on the CALLING party number (+18005551212 for example), is there a simple and sensible way to do this in CUBE?  I was looking at the Inbound Dial Peers Matching Process in the Cisco documents but still am not sure how to match the incoming CALLING party number (that part seems simple enough, using the answer-address entry?) and THEN send the call OUT (outgoing call) to our IP toll free provider's address in another dial peer (one I haven't created yet).

Here's a summary/brief overview of how we route the calls to/from CUBE and CUCM for the PSTN and inContact currently (this doesn't include the IP toll free yet since I haven't configured that...other than the fact that the current config works for the incoming calls to our toll free numbers because those are +E164 format and we send all +E164 calls to CUCM).  

To keep it simple, calls from CUCM to CUBE are sent with 9 in front (outgoing calls from CUCM to CUBE).  Calls going TO CUCM from CUBE are +E164 format.  On CUBE, since we're normally sending all calls that start with 9 to either the PSTN or inContact (we send anything with 91400xxxxxxx to inContact and the rest of the calls go to PSTN, with one exception) and the outgoing calls from our toll free numbers will also have a called party with 9 in front, I need to find a way to only route those calls from our toll free numbers out to our IP toll free provider (otherwise, the call is rejected if it tries to use the PSTN even though it's the same provider...the calling party number isn't accepted, so we need to send those to the same source we get the calls from, the IP Toll Free source IP.

So, given all that detail, here's an edited version of my dial peers (edited only to remove company info).  Wondering if you can suggest what I could add to CUBE (CUBE only, not CUCM if possible) to route the calls from my toll free numbers to a specific IP, not interfering with the existing dial peers for the normal outgoing DID calls to the PSTN or the outgoing calls to inContact (+1400 numbers).

Here's a look at my dial peer info as it is today:

voice translation-rule 3Outgoing CALLED party translation rule to remove 9 from the front (sent from CUCM).   FYI - Keep in mind that VOIP dial-peers do not strip explicitly matched digits like POTS dial-peers do
 rule 1 /^9\([2-9]..[2-9]......\)/ /+1\1/10 digit NANP calls from CUCM - outgoing to PSTN - Strip 9 and insert +1
 rule 2 /^91\([2-9]..[2-9]......\)/ /+1\1/11 digit NANP calls from CUCM - outgoing to PSTN - Strip 91 and insert +1
 rule 3 /9011/ /+/International calls from CUCM - outgoing to PSTN - Strip 9011 and insert +
 rule 4 /^9\(911\)/ /\1/911 emergency calls from CUCM dialed as 9-911 - Strip 9.  telco only wants 911, nothing else.
  
  
voice translation-rule 5Rule for outgoing calls to inContact numbers
 rule 1 /^9\(614555564[4-7]\)/ /+1\1/Strip 9, insert +1 for calls to 96145555644 thru 5647
 rule 2 /^91\(614555564[4-7]\)/ /+1\1/Strip 91, insert +1 for calls to 916145555644 thru 5647
 rule 3 /^9\(400.......\)/ /+1\1/Strip 9, insert +1 for calls to the inContact +1400 numbers
 rule 4 /^91\(400.......\)/ /+1\1/Strip 91, insert +1 for calls to the inContact +1400 numbers
  
voice translation-profile TP-OutgoingApply this Translation Profile to the dial-peers for the outgoing calls from CUCM that terminate to the telco WAN interface so the leading 9 from CUCM will not be sent to telco
 translate called 3Apply translation rule 3 to the CALLED party number for OUTGOING calls going to telco
  
voice translation-profile TP-inContact-OutgoingApply this Translation Profile to the dial-peers for the outgoing calls from CUCM that terminate to the telco WAN interface so the leading 9 from CUCM will not be sent to telco
translate called 5Apply translation rule 5 to the CALLED party number for OUTGOING calls going to telco
  
dial-peer voice 100 voipIncoming call from telco on the WAN interface.  Step 1
description INCOMING CALL FROM TELCO WANUse 1xx dial-peers for incoming calls from the telco WAN interface
session protocol sipv2 
session transport udp 
incoming called-number +TWe expect telco to send the true +E.164 number format for USA numbers we own and use on CUCM (BUT we also have to accept calls from inContact now, so I changed the dial peer to match any +E164 number)      
voice-class codec 1G711 as first choice, then G729
voice-class sip profiles 2 inbound<<< Apply SIP profile 2 to incoming dial peer 100 from telco and mark it as INBOUND SIP profile
voice-class sip bind control source-interface GigabitEthernet0/0/1WAN interface connected to telco
voice-class sip bind media source-interface GigabitEthernet0/0/1WAN interface connected to telco
dtmf-relay rtp-nte 
fax rate 14400 
fax protocol t38 fallback none 
no vad 
  
dial-peer voice 200 voipIncoming call from telco, sending now to CUCM via LAN interface.   Step 2
description IN FROM TELCO - SEND TO CUCM SERVERS VIA LANUse 2xx dial-peers for the incoming calls from telco that point next to CUCM via the LAN interface
destination-pattern +T 
session protocol sipv2 
session server-group 1CUCM servers grouped together in a server-group.  
session transport udp 
voice-class codec 1G711 as first choice, then G729
voice-class sip asserted-id paiSIP requests or response messages, when the PAI (P-Asserted-Identity) privacy header is set, privacy information is sent using the PAI header.
voice-class sip privacy-policy passthruIncoming INVITE can have multiple privacy header values, id, user, session, and so on. Configure the privacy-policy passthru command globally or voice-class sip privacy-policy passthru command to transparently pass across these multiple privacy header values.
voice-class sip early-offer forcedTo force a Cisco Unified Border Element (Cisco UBE) to send a SIP invite with Early-Offer (EO) on the Out-Leg (OL), use the early-offer command in SIP or dial peer configuration mode. 
voice-class sip bind control source-interface GigabitEthernet0/0/0LAN interface connected to company network
voice-class sip bind media source-interface GigabitEthernet0/0/0LAN interface connected to company network
dtmf-relay rtp-nte 
fax rate 14400 
fax protocol t38 fallback none 
 ip qos dscp cs3 signalingSets the DSCP for the quality of service on the signalling.  The default for the MEDIA is already EF by default.
no vad 
  
dial-peer voice 300 voipOutgoing call  that is incoming from CUCM on the LAN interface intended for telco (outgoing call to telco).  Step 1
description OUTGOING - IN FROM CUCM ON LAN PORT - FOR TELCOUse 3xx dial-peers for outgoing calls coming FROM CUCM going to telco
session protocol sipv2 
session transport udp 
incoming called-number 9TWe send 9 plus the outside number from CUCM to the router.  The router will use the translation-profile 'TP-Outgoing' on the next outgoing dial-peer to telco to remove the 9 before sending to PSTN.
voice-class codec 1 
voice-class sip bind control source-interface GigabitEthernet0/0/0LAN interface connected to company network
voice-class sip bind media source-interface GigabitEthernet0/0/0LAN interface connected to company network
dtmf-relay rtp-nte 
fax rate 14400 
fax protocol t38 fallback none 
no vad 
  
dial-peer voice 400 voipOutgoing call from CUCM - Sending now to telco via WAN interface.   Step 2
description OUTGOING FROM CUCM - TO TELCO ON WAN PORTUse 4xx dial-peers for outgoing calls coming FROM CUCM that will terminate to the telco WAN interface
preference 1First choice for calls to telco.
translation-profile outgoing TP-OutgoingApply this Translation Profile to the dial-peers for the outgoing calls from CUCM that terminate to the telco WAN interface so the leading 9 from CUCM will not be sent to telco
destination-pattern 9TWe send 9 plus the outside number from CUCM to the router.  The router will use the translation-profile 'TP-Outgoing' to remove the 9 before sending to PSTN.
session protocol sipv2 
session target ipv4:172.31.1.2:5060telco IP address and port
session transport udp 
voice-class codec 1 
voice-class sip profiles 1 
voice-class sip rel1xx supported "100rel"enable all Session Initiation Protocol (SIP) provisional responses (other than 100 Trying) to be sent reliably to the remote SIP endpoint, use the voice-class sip rel1xx command in dial peer configuration mode
voice-class sip asserted-id paiSIP requests or response messages, when the PAI (P-Asserted-Identity) privacy header is set, privacy information is sent using the PAI header.
voice-class sip privacy-policy passthru 
voice-class sip early-offer forcedTo force a Cisco Unified Border Element (Cisco UBE) to send a SIP invite with Early-Offer (EO) on the Out-Leg (OL), use the early-offer command in SIP or dial peer configuration mode. 
voice-class sip bind control source-interface GigabitEthernet0/0/1WAN interface connected to telco
voice-class sip bind media source-interface GigabitEthernet0/0/1WAN interface connected to telco
dtmf-relay rtp-nte 
 fax-relay sg3-to-g3 
 fax rate 14400 
no vad 
  
dial-peer voice 401 voipOutgoing call from CUCM - Sending now to telco via WAN interface.   Step 2
description OUTGOING FROM CUCM - TO TELCO ON WAN PORTUse 4xx dial-peers for outgoing calls coming FROM CUCM that will terminate to the telco WAN interface
preference 2Second choice if the target IP for dial-peer 400 is not responding.
translation-profile outgoing TP-OutgoingApply this Translation Profile to the dial-peers for the outgoing calls from CUCM that terminate to the telco WAN interface so the leading 9 from CUCM will not be sent to telco
destination-pattern 9TWe send 9 plus the outside number from CUCM to the router.  The router will use the translation-profile 'TP-Outgoing' to remove the 9 before sending to PSTN.
session protocol sipv2 
session target ipv4:172.33.1.2:5060telco IP address and port
session transport udp 
voice-class codec 1G711 as first choice, then G729
voice-class sip profiles 1 
voice-class sip rel1xx supported "100rel"enable all Session Initiation Protocol (SIP) provisional responses (other than 100 Trying) to be sent reliably to the remote SIP endpoint, use the voice-class sip rel1xx command in dial peer configuration mode
voice-class sip asserted-id paiSIP requests or response messages, when the PAI (P-Asserted-Identity) privacy header is set, privacy information is sent using the PAI header.
voice-class sip privacy-policy passthru 
voice-class sip early-offer forcedTo force a Cisco Unified Border Element (Cisco UBE) to send a SIP invite with Early-Offer (EO) on the Out-Leg (OL), use the early-offer command in SIP or dial peer configuration mode. 
voice-class sip bind control source-interface GigabitEthernet0/0/1WAN interface connected to telco
voice-class sip bind media source-interface GigabitEthernet0/0/1WAN interface connected to telco
dtmf-relay rtp-nte 
 fax-relay sg3-to-g3 
 fax rate 14400 
no vad 
  
dial-peer voice 402 voipOutgoing call from CUCM - Sending now to inContact / inContact via WAN interface.   Step 2
 description OUTGOING FROM CUCM - TO INCONTACT ON WAN PORT 
 translation-profile outgoing TP-inContact-OutgoingApply this Translation Profile to the dial-peers for the outgoing calls from CUCM that terminate to the inContact via WAN interface so the leading 9 from CUCM will not be sent
 destination-pattern 91614555564[4-7]Test number range for inContact inContact
 session protocol sipv2 
 session transport udp 
 session server-group 5SIP trunk for inContact addresses
 voice-class codec 1 
 voice-class sip rel1xx supported "100rel" 
 voice-class sip asserted-id pai 
 voice-class sip privacy-policy passthru 
 voice-class sip early-offer forced 
 voice-class sip profiles 1 
 voice-class sip bind control source-interface GigabitEthernet0/0/1 
 voice-class sip bind media source-interface GigabitEthernet0/0/1 
 dtmf-relay rtp-nte 
 dtmf-interworking standard 
 fax-relay sg3-to-g3 
 fax rate 14400 
 no vad 
  
dial-peer voice 403 voipOutgoing call from CUCM - Sending now to inContact / inContact via WAN interface.   Step 2
 description OUTGOING FROM CUCM - TO INCONTACT ON WAN PORT 
 translation-profile outgoing TP-inContact-OutgoingApply this Translation Profile to the dial-peers for the outgoing calls from CUCM that terminate to the inContact via WAN interface so the leading 9 from CUCM will not be sent
 destination-pattern 91400TAll 1-400 numbers, send to inContact/inContact
 session protocol sipv2 
 session transport udp 
 session server-group 5SIP trunk for inContact addresses
 voice-class codec 1 
 voice-class sip rel1xx supported "100rel" 
 voice-class sip asserted-id pai 
 voice-class sip privacy-policy passthru 
 voice-class sip early-offer forced 
 voice-class sip profiles 1 
 voice-class sip bind control source-interface GigabitEthernet0/0/1 
 voice-class sip bind media source-interface GigabitEthernet0/0/1 
 dtmf-relay rtp-nte 
 dtmf-interworking standard 
 fax-relay sg3-to-g3 
 fax rate 14400 
 no vad 
  
dial-peer voice 700 voipADDED THIS DIAL-PEER TO FIX DTMF FOR OUTGOING CALLS TO telco
description ADDED TO FIX DTMF FOR OUTGOING CALLS TO TELCO 
incoming called-number . 
dtmf-relay rtp-nte 
voice-class codec 1 
no vad 

 

9 Replies 9

Robert Shaw
Level 3
Level 3

We have a similar setup in our Central SIP Trunk.  We had to get the CUBE to direct a call to a given Logical Trunk based on which country's internal phone was calling out.

The way we did this was as follows.

On the Route Pattern assigned to the internal phones prefix a number to the Called Number.  In our case for example, in the Netherlands, we would prefix 31 to all called numbers going to the CUBE.  The CUBE would then see 31000441112223334 coming from Call Manager.

At the CUBE Create a Dial-Peer matching this pattern and assign it to a Translation Rule to remove the 310, leaving 00441112223334 before sending it to the carrier.

Hope this make sense, please let me know if not.

I had the idea to use extra digits in front of the CALLED number, but first I need to separate the calls by the CALLING number.  I only want the manipulation to happen for the calls with a calling party number that is a toll free number.  Once I trigger that, then I can have the next step be based on the CALLED number (with those extra digits to be able to make sure we catch those and send them to the other destination).  We already have some complicated routing in CUCM based on 'route next hop by calling number' (translation patterns) and I'm trying to avoid adding anything else to CUCM for this, if possible.  I'd rather keep it in the router, if I can.  An incoming dial peer to catch the call based on the calling party number (one of our toll free numbers) and then another dial peer (outgoing) to send only calls from those toll free numbers to the correct destination.

The more I think about this and look at it, I 'think' this might be my solution.  I need to sit and think about it for a few and then give it a try.  I think this might be how I can catch the call based on the CALLING number, use a translation rule to insert special digits in front of the CALLED number which I'll use to route the call and then send it to the right destination with a new dial peer that looks for those special digits I inserted in the translation rule.  If I'm understanding that solution correctly.  I'll let you know if it works and what it looks like.

Solved: Route incoming Call based on Calling Number - Cisco Community

I would recommend to use an inbound E.164 number map on the dial peer to match calling number instead of the older answer address as it’s more flexible.



Response Signature


How are you in CM handling the setup of the toll free numbers? By translation patterns or route patterns? If you do you have the possibility there to manipulate the called number by adding a route prefix in-front of the called number.



Response Signature


I'm using route patterns in CUCM to get the calls to CUBE.  Please see one of my newer replies above.  I 'think' I might have found a solution for this to keep the changes I need all inside CUBE, no change in CUCM.  I'll try it and report back if it works (or doesn't work).

voip7372
Level 4
Level 4

An update on this...

First, I learned from our provider that we do NOT have outbound capability on the IP toll free service that's sending these calls to us, so my idea of sending the outgoing calls from CUCM/CUBE back to that entity for outgoing is dead in the water.  Wouldn't work anyway since we don't have the capability on their side.

Second, I kept working on this idea anyway because I thought this could come in handy for some other situation even if I don't use it for the original idea.  It turns out though that my idea doesn't work because the new dial peer doesn't get matched (an answer-address dial peer) because the 'incoming called-number' dial peer always takes precedence over dial peers with 'destination-pattern' entries.  I'm using incoming called-number in one dial peer for the inbound from CUCM to CUBE and then destination-pattern in another dial peer for outbound to the PSTN.  The problem is, the calls arriving at CUBE from CUCM will have 9 in front (in my config) for both the calls from our IP Toll Free numbers configured in CUCM as well as the normal DID numbers in CUCM, so these calls will always get caught by the incoming called-number dial peer I have which is 9T.  It will never make it to my answer-address dial peer.  

Anyway, for now I can't use this anyway even if I were to fix CUCM to insert extra digits like 888 in front of calls form the IP toll free DNs in CUCM so CUBE could route based on those extra special digits with another dial peer because the PSTN won't accept outbound calls from us on that entity that sends the IP TF calls TO us.  

When I still thought I would work on this anyway to get a working example of new dial peers and translation rules in CUBE, I thought about using only destination-patterns because Cisco says you can use destination-pattern to match the CALLED party as well as the CALLING party digits, but I don't see any notes in Cisco's docs on how you'd actually do that.  Create a dial peer that is for INBOUND calls with a destination-pattern entry that is matching the ANI/Calling party number and another destination-pattern for the OUTBOUND calls (OK, I already know how to do the outbound dial peers using destination-pattern).  I've never seen an example of that before but it intrigues me now and it I could do that, it could come in handy sometimes.  

First thing, as you discovered you cannot mix different inbound match types as they are processed in a fixed order. To achieve what you seek for you’d have to standardise how you match inbound dial peers.

For your other part of your question and in general for detailed information on dial peer workings please have a look at this marvellous document.

https://www.cisco.com/c/en/us/support/docs/voice/ip-telephony-voice-over-ip-voip/211306-In-Depth-Explanation-of-Cisco-IOS-and-IO.html



Response Signature


Thanks.  I'll bookmark that page.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: