cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3877
Views
40
Helpful
24
Replies

incoming call not routed to cucm - but back to provider

TinyLittleAdmin
Level 1
Level 1

Dear Community,

 

I have a setup of a Cisco 2800 router acting as CUBE and two callmanagers (6.2 subscriber/publisher). Besides all the other SIP stuff I've created five dial peers:

- incoming from provider

- incoming from cucm

- outgoing to cucm (2x with individual IPs)

- outgoing to provider

 

Outgoing calls work fine. But whenever an external caller tries to call us, it takes a few seconds, and than the call never hits the internal phone. The provider confirms the problem (on our end!) and describes it as follows: incoming calls are instantly routed back by our CUBE to the provider in a miss-formated way. As a result the providers environment thinks its a local/regional call and again add the pre-digits. So the basic problem: all these incoming calls are not correctly "terminated" on our end.

 

Our internal phones do have four digits. The pre-dial is lets say "+49445566". So the full number is +494455661234. Our cucm adds two "00" to any outgoing call by default.

 

I gues it's something with translations-rules? Or the call doesn't go the right way (dial-peer). At the moment I only have one translation-rule active. For any outgoing call it adds the regional digits prior to the internal extension.

 

I dont see the problem. In my very limited logic I'd say - if outgoing calls work (so caller id is correctly transmitted to provider), why doesn't it work for incoming...)

 

Thanks in advance.

 

1 Accepted Solution

Accepted Solutions

Try with this.

voice service voip
 address-hiding
 mode border-element licence capacity 1
!
voice class uri CUCM sip
 host ipv4:xxx.xxx.xxx.xxx ;IP for CPE Publisher
 host ipv4:yyy.yyy.yyy.yyy ;IP for CPE Subscriber
!
voice class uri PSTN sip
 host ipv4:siptrunkXXX
!
voice class e164-pattern-map 1
 description E164 Pattern Map for called number to CUCM
  e164 +49445566...
!
voice class e164-pattern-map 2000
 description E164 Pattern Map for called number to PSTN
  e164 0T
!
voice class server-group 1
 ipv4 yyy.yyy.yyy.yyy preference 1 ;IP for CPE Subscriber
ipv4 xxx.xxx.xxx.xxx preference 2 ;IP for CPE Publisher description CUCM server group ! voice class sip-options-keepalive 1 description Used for Server Group SIP OPTIONS PING ! voice translation-rule 1 no rule 5 rule 1 /^...$/ /445566\0/ ! voice translation-rule 2 rule 1 /^\+49445566\(...\)$/ /\1/ ! voice translation-rule 3 rule 1 /^0\(.*\)/ /\1/ ! voice translation-rule 5
rule 1 /^49\(.*\)/ /00\1/
rule 2 /^\+49\(.*\)/ /00\1/
rule 3 /^\+\(.*\)/ /000\1/ ! no voice translation-profile 1 ! no voice translation-profile ccm_incoming ! no voice translation-profile cube_to_ccm ! no voice translation-profile cube_to_provider ! no voice translation-profile provider_incoming ! voice translation-profile cube_to_ccm-out translate called 2 ! voice translation-profile cube_to_provider-out translate calling 1 translate called 3 ! voice translation-profile provider_incoming-in translate calling 5 ! dial-peer voice 1 voip description incoming from provider to cube translation-profile incoming provider_incoming-in voice-class codec 1 session protocol sipv2 no incoming called-number +49445566... incoming uri via PSTN dtmf-relay rtp-nte no vad ! dial-peer voice 9 voip description outgoing to provider from cube no translation-profile outgoing ccm_incoming translation-profile outgoing cube_to_provider-out no destination-pattern . destination e164-pattern-map 2000 voice-class codec 1 session protocol sipv2 session target dns:siptrunkXXX voice-class sip options-keepalive voice-class sip audio forced dtmf-relay rtp-nte no vad ! dial-peer voice 11 voip description outgoing from cube to CM translation-profile outgoing cube_to_ccm-out no destination-pattern 0445566.... destination e164-pattern-map 1 voice-class codec 1 session protocol sipv2 no session target ipv4:xxx.xxx.xxx.xxx session server-group 1 voice-class sip options-keepalive profile 1 dtmf-relay rtp-nte sip-kpml no vad ! no dial-peer voice 10 voip ! dial-peer voice 2 voip description incoming from cucm to cube voice-class codec 1 session protocol sipv2 incoming uri via CUCM dtmf-relay rtp-nte sip-kpml no vad !

This configuration assumes that you send the leading zero for outbound calls, ie you need to remove the discard digit instruction on your route patter(s) in CM so that it is kept when sent to the gateway. That zero will be removed by voice translation profile cube_to_provider-out in the outbound direction on dial peer 9.



Response Signature


View solution in original post

24 Replies 24

b.winter
VIP
VIP

Hi,

please post the config (without any sensitive data) and the output of a call with the following debugs enabled:

debug voice ccapi ind 1

debug voice ccapi ind 2

debug voice ccapi ind 74

debug ccsip messages

 

Without this info, it is impossible to say, where exactly the problem is.

TinyLittleAdmin
Level 1
Level 1

Hopefully I've removed/replaced sensitive info...

 


!
!
voice-card 0
no dspfarm
!
!
!
voice service voip
allow-connections sip to sip
sip
!
!
voice class uri 2 sip
voice class codec 1
codec preference 1 g711alaw
codec preference 3 g722-64
codec preference 4 g722-56
codec preference 5 g722-48
!
voice class codec 2
codec preference 1 g729r8
codec preference 2 g729br8
codec preference 3 g711alaw
codec preference 4 g711ulaw
!
!
!
!
!
!
!
!
!
!
!
voice translation-rule 1
rule 5 /^...$/ /445566&/
!
voice translation-rule 2
!
voice translation-rule 5
rule 1 /^49/ /00/
rule 2 /^\+49/ /00/
rule 3 /^\+\(.*\)/ /000\1/
!
!
voice translation-profile 1
!
voice translation-profile ccm_incoming
translate calling 1
!
voice translation-profile cube_to_ccm
translate calling 5
!
voice translation-profile cube_to_provider
translate calling 5
!
voice translation-profile provider_incoming
translate calling 5
!
!
!
!
!
!

archive
log config
hidekeys
!
!
controller E1 0/0/0
!
!
!
!
!
interface GigabitEthernet0/0
description UplinkInternet
ip address xxx.xxx.xxx.xxx 255.255.255.0
duplex auto
speed auto
!
interface GigabitEthernet0/1
no ip address
shutdown
duplex auto
speed auto
!
!
!
!
dial-peer voice 1 voip
description incoming provider to cube
voice-class codec 1
session protocol sipv2
incoming called-number +49445566...
dtmf-relay rtp-nte sip-notify
no vad
!
dial-peer voice 9 voip
description outgoing to provider from cube
translation-profile outgoing ccm_incoming
destination-pattern .
voice-class codec 1
session protocol sipv2
session target dns:siptrunkXXX
dtmf-relay rtp-nte
no vad
!
dial-peer voice 11 voip
description outgoing cube to provider
destination-pattern 0445566....
voice-class codec 1
session protocol sipv2
session target ipv4:xxx.xxx.xxx.xxx
dtmf-relay rtp-nte
no vad
!
dial-peer voice 10 voip
description outgoing cube to sub
destination-pattern 0445566....
voice-class codec 1
session protocol sipv2
session target ipv4:yyy.yyy.yyy.yyy
dtmf-relay rtp-nte
no vad
!
dial-peer voice 2 voip
description incoming cucm to cube
voice-class codec 1
session protocol sipv2
dtmf-relay rtp-nte
no vad
!
!
gateway
timer receive-rtp 1200
!
sip-ua
retry invite 2
retry register 10
registrar dns:siptrunkXXXX expires 3600
sip-server dns:siptrunkXXX:5060
connection-reuse
!
!
line con 0
line aux 0
line vty 0 4
login local
line vty 5 15
login local
!
scheduler allocate 20000 1000
ntp clock-period 17180183
ntp server xxx.xxx.xxx.xxx
!
end

 

Using this as the match statement for sending calls to your service provider is a very bad use.

destination-pattern .

This basically matches anything, so if there is an issue with your CM or as in your case your configuration is all bodged, it would send the call right back to the service provider.

Please describe in as much details as you can share with us on your setup. Including exactly number format you use in CM, how you dial out to the PSTN, how you send called and calling numbers to your SP, how your SP sends called and calling numbers to you and so on.



Response Signature


b.winter
VIP
VIP

I assume, the called number for inbound calls (from provider to CUBE) will be in the +E.164 format.

If yes, then the following will happen:

It will match dial-peer 1 because of the "incoming-called number +49445566..." statement (assuming +49445566... is your DID-range)

In dial-peer 1, there is no number manipulation taking place --> called number stays in +E.164 format.

 

But:

You are trying to match the dial-peers (10 & 11) to the CUCM's based on called-numbers starting with "0..." --> Therefore, they will never match.

And since your dial-peer 9 (for outbound calls to provider) has a "match-all" pattern, this is the one getting select in the end --> Therefore, the calls will be routed back to the provider.

 

Following example to change the config:

Assuming CUCMs are sending the numbers in +E.164 format, and also CUBE is sending them to the provider (maybe you have to cross check with them, how they want the number format to be)

 

dial-peer voice 1 voip
description ### From Provider to CUBE ###
voice-class codec 1
session protocol sipv2
incoming called-number +49445566...
dtmf-relay rtp-nte sip-notify
no vad
!
dial-peer voice 9 voip
description ### From CUBE to Provider ###
translation-profile outgoing ccm_incoming
destination-pattern +
voice-class codec 1
session protocol sipv2
session target dns:siptrunkXXX
dtmf-relay rtp-nte
no vad
!
dial-peer voice 11 voip
description ### From CUBE to CUCM Publisher ###
destination-pattern +445566...
voice-class codec 1
session protocol sipv2
session target ipv4:xxx.xxx.xxx.xxx
dtmf-relay rtp-nte
no vad
!
dial-peer voice 10 voip
description ### From CUBE to CUCM Subscriber ###
destination-pattern +445566...
voice-class codec 1
session protocol sipv2
session target ipv4:yyy.yyy.yyy.yyy
dtmf-relay rtp-nte
no vad
!
voice-class uri CUCMIP sip
 host ipv4:xxx.xxx.xxx.xxx
 host ipv4:yyy.yyy.yyy.yyy
!
dial-peer voice 2 voip
description ### From CUCM to CUBE ###
voice-class codec 1
session protocol sipv2
incoming uri via CUCMIP --> Dial-peer matching is done based on the IP's from the CUCM's
dtmf-relay rtp-nte
no vad

Depending on the formats, that are needed for calling and called numbers towards provider and CUCM's, you can then apply translation-profiles to the dial-peers and manipulate the numbers accordingly.

 

Also you can work with server-groups, if you want to send the same number-range to multiple IP destinations:

voice class server-group 1000
 ipv4 [CUCM PUB] preference 3
 ipv4 [CUCM SUB] preference 2
 description ### CUCM Server Group ###
!
dial-peer x voip
session server-group 1000

 

Hi, 

If you are going ahead with the above then please ensure that you have a pattern in the call manager for+ (e164 format)

 

Another option is to create translation tule to convert the +49 to 044... to match your dial-peer to call manage.r 

 

voice translation-rule 1
rule 1 /\+49445566\(....\)/ /044556\1/


voice translation-profile IN
translate called 1

 

dial-peer voice 1 voip
translation-profile incoming IN

 

Regards,

In general it is good practice to make sure that you do not ever get a match that can send the call back to the same way as it came from as that would create a routing loop. So having the match as just + towards the service provider is not very good as that would also match the numbers sent into CM if there for any reason would be an issue with call routing in the CM. What would happen then is that the second best match would be used and this results in the call being sent back to the service provider.



Response Signature


For some reason I can't enter ipv4 address (for the "uri" option). I get an error message saying "host pattern should be of format ^([][0-9A-Za-z\|@\/()*+^$&?#--.])*$"

 

TinyLittleAdmin
Level 1
Level 1

WoW! It's amazing to get this detailed and quick response! Please give me a few minutes to understand your recommendations and examples. I'm really not that experienced with translations/call routing. I'll respond later again! Many thanks.

TinyLittleAdmin
Level 1
Level 1

I've tried to use that "destination-pattern +" line - which changed... something. Now - when I try to dial in from outside I can hear a standard provider phone system answer saying "this number is unknown". And with my very limited knowledge I think it's because of a missing "+" somewhere? Here are two screenshot - are they of any help? Im concerned about the "no outgoing dial peer match" lines.... And there is not a single route pattern within CUCM that uses a "+". The only wildcards I see are:  [  ]  X   #   ! . As an example: the one that was active before the change from classic PBX to SIP for germany calls was: "0.0[2-9]XXXX!"

 

UPDATE:

I had to switch back to the "destination-pattern ." line. Because with the "+" it was no longer possible to do calls from inside to outside.

 

Attached is another syslog screencap that shows the "bounce back" that the provider tried to explain me. As the first try to route the call fails - it comes back but with a changed number. In the second try - another regional pre (4944) is added.

 

 

TinyLittleAdmin
Level 1
Level 1

Maybe there is another chance for me to describe the situation. Because it’s for sure just me not understanding the basics of dial rules. The problem here just came up during the process of switching our provider connection from classic to sip. To make sure our environment supports it, the provider gave me a bunch of test numbers a few weeks ago. I had to setup the cube, some basics on the cucm. And just for the test – two cisco phones with numbers out of that test range (we’ve had 10).

Our normal internal phones just do have four digits. Thats how they are setup on cucm. So neither do they have the regional code 04455, nor the internal (for the companys location) pre-dial 66 in cucm. So the complete number for a desk phone with extension 7777 would be 04455667777. But in cucm the phone only has the 7777.

For the test environment it was a bit different. Here the two test phones I’ve configured in cucm had the internal pre-dial added to them. The predial here was 999. If the test desk phones extension was 8 – the phone in cucm was configured as 9998 to get the full number of 044559998. There was just one translation rule (as I understand it) to make this (the test) work:

 

voice translation-rule 1

 rule 1 /^\(999.$\)/ /04455\1/

 rule 2 /^\+49/ /0049/

 rule 3 /^49/ /0/

 rule 4 /.../ /0445566&/

 

Hmm….? Maybe I do have to create a translation rule now that does "whenever there is an incoming call for 0445566xxxx - strip the 0445566 and just forward the xxxx to the cucm"? For now - I see the problem on the cucm. It just doesnt pickup/doesnt receive the incoming call.

 

At the moment translation-rule 1 has this state - the first rule for the test env.  to cover the "999" has been deleted:


voice translation-rule 1
rule 2 /^\+49/ /0049/
rule 3 /^49/ /0/
rule 5 /^...$/ /0445566&/

A few things to mention. You need to have dial peer(s) that has a match statement that match the format of the called number received in each direction. So whatever format of the called number you get from your service provider you’ll need to match that on the dial peers(s) towards CM. The same applies for the opposite direction, ie whatever format you send from your CM to the gateway for calls destined for your service provider you’ll need to match the called number on the dial peer(s) that sends calls to your service provider.

Then in CM you’ll need to have an inbound CSS set on the gateway/trunk that has visibility of the partition(s) where you have your directory numbers.

If you want or need to modify called and/or calling numbers in the gateway, so that it matches the format used in CM for example, you’ll do that with voice translation profiles that has voice translation rules set in them. In general it is good practice to use one rule per direction and not in multiple as it looks like you might be doing as that makes it harder to understand what it is used for.

Translation profiles in the gateway is applied in either the inbound or outbound direction. If you do modify the called number in the inbound direction you’ll need to account for this on the match statement on the dial peer(s) used to send the calls to the receiving end. Ie if you modify the called number inbound from your service provider you’ll need to match the format after the modifications on the match statement on the dial peer(s) towards CM.

If you need to modify the called number in CM you’ll do that with translation pattern(s) and if you need to modify the calling number you’ll do that with for example transformation pattern(s).

For each call that the gateway handles there are always two call legs, one inbound and one outbound, for each leg there is a dial peer used. It can be the same dial peer for both directions, but in general it is better to use separate as that makes it easier to follow and understand the flow of the calls through the gateway.

I would recommend you to read these two documents on how call routing in IOS/IOS-XE works and how voice translation works.



Response Signature


TinyLittleAdmin
Level 1
Level 1

Several hours later... no progress

I'm now doing simple testing - just to find out what a specific line of code does. I found out, that if I remove this translation-rule for outgoing route to provider:

 

voice translation-rule 1

rule 1 /^\(...\)$/ /+49445566\1/

 

the call hits the target, but only shows the internal ext. with a pre "+".  So if my internal extension is 777 - the receivers device shows "+777".  Doesn't that mean the cucm only handles the internal extensions - no regional or location prefix?

So what I'm looking for is to find a way that every incoming external call gets the first part of the called id removed (+49445566) and only sends the extension to the cucm? That can't be that complicated ... (smiley)

 

But allow me to say this: I'm very happy and thankfull for every help. And have a very nice easter weekend! (smiley)

That’s basic stuff. If you read the documents that I shared you would have a good starting point to begin with.

As an example you could do something along with this. If your service provider sends called number as  +49445566… to you, then set the same as the destination pattern for your outbound dial peer towards your CM. Next create a voice translation rule that matches +49445566… and copy the wild card digits over to the replacement side. Put this into a voice translation profile and set it to translate called number. Last step set that voice translation profile on the dial peer(s) towards CM in the outbound direction. This should make the call to match an outbound dial peer and also modify the called number to match your directory number format in CM.



Response Signature