02-03-2023 08:54 PM
Hello,
I'm trying to understand out how to route calls using dial peers and translation rules and I'm just going in circles and getting a headache.
I need to match incoming calls from my SIP provider, They send 11 digits to me.
I need to route outgoing calls from my phones and pots ports to my sip provider.
I can't have my users dial a prefix to get out, if they want to call 5203825968 they should be able to dial it as 3825968, 5203825968 or 15203825968 and it gets rewritten to 15203825968 to send to the carrier.
voice translation-rule 1
rule 1 /^1/ //
!
voice translation-rule 2
rule 1 /5204792894/ /101/
rule 2 /5204792896/ /100/
rule 3 /5202827081/ /201/
!
voice translation-rule 10
rule 1 /100/ /5204792896/
rule 2 /101/ /5204792894/
rule 3 /201/ /5202827081/
!
voice translation-rule 20
rule 1 /\([2-9]......$\)/ /520\1/
!
!
voice translation-profile CONVERT_TO_XTN
translate called 2
!
voice translation-profile EXTENSION_TO_CID
translate calling 10
translate called 20
!
voice translation-profile STRIP-1
translate called 1
voice class sip-profiles 1
request ANY sip-header Diversion remove
request INVITE sip-header Diversion remove
dial-peer voice 1 voip
description Incoming 11 digit calls from carrier
translation-profile outgoing STRIP-1
preference 1
destination-pattern 1..........
translate-outgoing called 101
session protocol sipv2
session target ipv4:192.168.100.1
incoming called-number 1..........
voice-class sip profiles 1
!
dial-peer voice 2 voip
description Redirected 10 digit incoming calls
translation-profile incoming CONVERT_TO_XTN
preference 2
destination-pattern ..........
session target sip-server
incoming called-number ..........
!
dial-peer voice 7 voip
description 7 Digit Dial
translation-profile outgoing EXTENSION_TO_CID
destination-pattern [2-9]......
session protocol sipv2
session target sip-server
codec g711ulaw
02-03-2023 08:56 PM
I may have made things needlessly complex by having dial-peer 1 redirect calls to dial peer 2 but I need to strip a Diversion header out of the incoming call and I couldn't find a better way of doing it.
I'm open to better solutions for dial-peers 1 and 2.
02-03-2023 11:37 PM
It is not very clear what your call path is? For one where do you have your phones, are they locally registered to the gateway or do they reside on an outside system, like in CM or a 3:rd party PBX?
On your general question about how call routing in IOS works I would recommend you to read this outstanding document. In Depth Explanation of Cisco IOS and IOS-XE Call Routing It should clear out most of your questions. For the inbound dial peer I would recommend you to rewrite that to use information in the VIA header instead of calling number. Apart from that I would also recommend you to clearly have each dial peer to be used in one direction, not both for inbound and outbound as you currently do for dial peer 1. Both destination pattern and session target is outbound configuration elements that you don’t need to have on an inbound dial peer.
02-04-2023 06:59 AM
Ah! Sorry, I have some pots lines and some ephones.
The routing is (SIPTRUNK PROVIDER) <SIP> [IAD 2438] <SCCP> (EPHONE)
dial-peer voice 200 pots
destination-pattern 200
port 2/0
no sip-register
!
dial-peer voice 201 pots
destination-pattern 201
port 2/1
no sip-register
!
dial-peer voice 202 pots
destination-pattern 202
port 2/2
no sip-register
!
dial-peer voice 203 pots
destination-pattern 203
port 2/3
no sip-register
!
dial-peer voice 204 pots
destination-pattern 204
port 2/4
no sip-register
!
dial-peer voice 205 pots
destination-pattern 205
port 2/5
no sip-register
!
ephone-dn 100
number 100
label x100
!
!
ephone-dn 101
number 101
label x101
!
!
ephone 1
mac-address C025.5C43.0CDD
type 7965
button 1:100
!
!
!
ephone 2
mac-address 2893.FE13.4C0A
type 7965
button 1:101
!
I'll remove the destination pattern from dial-peer 1, tho don't I need the session target there to hairpin the call back into the IAD?
02-04-2023 07:25 AM - edited 02-04-2023 11:11 AM
If you remove the destination pattern you’ll would pretty much not have a use for the session target. What I would suggest is to rework your dial peers so that you have one for each use case, ie one inbound from the service provider and another for the outbound direction to the service provider. Plus a combination of both for any other use case you might have.
What do you mean by hair-pinning the call back to the IAD? Forgive my ignorance, but I have zero experience with IAD devices, in fact I did not even know what it was until I just now searched for it on Google. Maybe you could outline and explain what use case you have for the IAD to make it clearer for us that are outsiders to your system landscape?
02-06-2023 07:37 AM
So, I tried removing the destination pattern from dial-peer voice 1 voip but once I did that it stopped matching calls from my carrier even tho I still have a incoming-pattern defined?
02-04-2023 07:40 AM - edited 02-04-2023 11:21 AM
Apart from my previous response, where do you have your ephones and DNs configured? Also where is the shared configuration coming from? That seems to be missing from your outlines topology or maybe I’m missing something?
02-04-2023 11:33 AM
I created the attached template based on the below assumptions. If I understood the scenario correctly, then the attached template should be all you need.
You have an IAD 2438 router that is configured as CME with 2 ephones. You also have 6 analog fxs ports and a SIP trunk from the carrier terminated on this IAD 2438 router.
You have 3 DIDs:
5204792894 for ephone at ext 101
5204792896 for ephone at ext 100
5202827081 for the analog device at ext 201
The carrier sends you 11 digits when they deliver calls for the above 3 DIDs to your gateway.
You have a requirement to remove the SIP diversion header from incoming SIP invites sent by the carrier
The carrier expects 11 digits from your gateway for outbound calls toward the carrier.
The users may dial local numbers as 7 or 10 digits, and long distance numbers as 10 or 11 digits but you want everything xlated to 11 digits to meet the carrier requirements.
Please let me know if any of the above statements is incorrect so we can help you better.
02-04-2023 11:13 PM
Great answer @TechLvr (+5)
One small comment, for inbound SIP profile to be operational you’ll need to enable it in the global SIP configuration with this command.
voice service voip sip sip-profiles inbound
02-05-2023 01:22 PM
@Roger Kallberg To be honest, I have tested inbound sip profiles successfully without enabling it in the global sip config but I do agree with you, that as per Cisco documents, you should enable it globally.
02-05-2023 09:52 PM
That’s quite interesting, I’ve seen it not work if the command in global configuration not being used.
02-06-2023 07:25 AM
Looks like that isn't a option in the version of software I have.
VOIP(config)#voice service voip
VOIP(conf-voi-serv)# sip
VOIP(conf-serv-sip)# sip-profiles inbound
^
% Invalid input detected at '^' marker.
VOIP(conf-serv-sip)#sip-pr
VOIP(conf-serv-sip)#sip-profiles ?
<1-10000> The sip profiles tag number to be linked as global
VOIP#show version
Cisco IOS Software, 2400 Software (C2430-IK9O3S-M), Version 15.1(4)M10, RELEASE SOFTWARE (fc2)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2015 by Cisco Systems, Inc.
Compiled Tue 24-Mar-15 08:53 by prod_rel_team
ROM: System Bootstrap, Version 12.3(4r)XD, RELEASE SOFTWARE (fc1)
VOIP uptime is 3 minutes
System returned to ROM by power-on
System restarted at 08:20:54 MST Mon Feb 6 2023
System image file is "slot0:c2430-ik9o3s-mz.151-4.M10.bin"
02-06-2023 07:36 AM
Looks like a few commands are not supported in my version of IOS.
OIP(config-voice-uri-class)#voice class e164-pattern-map 2
^
% Invalid input detected at '^' marker.
VOIP(config-voice-uri-class)#e164 [2-9]......
^
% Invalid input detected at '^' marker.
VOIP(config-voice-uri-class)#e164 [2-9]..[2-9]......
^
% Invalid input detected at '^' marker.
VOIP(config-voice-uri-class)#e164 1[2-9]..[2-9]......
^
% Invalid input detected at '^' marker.
VOIP(config-voice-uri-class)#e164 911
^
% Invalid input detected at '^' marker.
After making the other changes I no longer receive incoming calls to my phones.
02-06-2023 08:21 AM
Could you please post the running config of your router? I would like to see which commands did not take so I can provide alternatives.
02-06-2023 09:03 AM
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide