Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

Translation rule problem

Hey guys

I have a new CME setup.  V9.1 and all is progressing well - so far.

I have setup a sip trunk to a sip provider. I cannot seem to get my translation rule to function - can you see why?

voice translation-rule 1
rule 1 /^9\(.*\)/ /\1/
rule 2 /^2../ /3044*023/

I am wanting to strip the 9 from the outgoing number.  thats ok because the call is forwarded to the sip provider without the 9.

The second rule should replace the internal extension number (221) and replace with the pilot number 3044*023. 

I have looked at the wireshark trace and the extension number 221 is getting sent.

If i replace extension 221 with the 3044*023 - the ephone-dn the call is processed sucesfully by the sip provider and it rings the number succesfully.

Because of this i feel it must be a translation issue rather than any other issue.    The below log shows rule 1 stripping the 9 but rule 2 does not seem to trigger.                 

VoIP Translation Rule debugging is enabled

LR-2911#

Oct 14 09:32:22.301: //-1/xxxxxxxxxxxx/RXRULE/regxrule_get_profile_from_trunkgro

up_internal:

   Voice port 0x3E0F7050 dsl=-1 timeslot=0 does not belong to any trunk group

Oct 14 09:32:22.301: //-1/5CC4DE3AA581/RXRULE/regxrule_stack_pop_RegXruleNumInfo

: stack=0x23E56B8C; count=1

Oct 14 09:32:22.301: //-1/5CC4DE3AA581/RXRULE/regxrule_stack_pop_callinfo_intern

al: numinfo=0x23E6F820

Oct 14 09:32:22.301: //-1/5CC4DE3AA581/RXRULE/regxrule_stack_push_RegXruleNumInf

o_internal: stack=0x23E56B8C; count=1

Oct 14 09:32:24.921: //-1/5CC4DE3AA581/RXRULE/regxrule_translate_exist_internal:

no rule for callback-number number

Oct 14 09:32:24.921: //-1/5CC4DE3AA581/RXRULE/regxrule_profile_translate_interna

l: number=221 type=unknown plan=unknown numbertype=calling

Oct 14 09:32:24.921: //-1/5CC4DE3AA581/RXRULE/regxrule_get_RegXrule: Invalid tra

nslation ruleset tag=0

Oct 14 09:32:24.921: //-1/5CC4DE3AA581/RXRULE/regxrule_profile_match_internal: E

rror: ruleset for calling number not found

Oct 14 09:32:24.921: //-1/5CC4DE3AA581/RXRULE/regxrule_profile_translate_interna

l: No match: number=221 type=unknown plan=unknown

Oct 14 09:32:24.921: //-1/5CC4DE3AA581/RXRULE/regxrule_profile_translate_interna

l: number=902083398000 type=unknown plan=unknown numbertype=called

Oct 14 09:32:24.921: //-1/5CC4DE3AA581/RXRULE/regxrule_profile_match_internal: M

atched with rule 1 in ruleset 1

Oct 14 09:32:24.921: //-1/5CC4DE3AA581/RXRULE/regxrule_profile_match_internal: M

atched with rule 1 in ruleset 1

Oct 14 09:32:24.921: //-1/5CC4DE3AA581/RXRULE/sed_subst: Successful substitution

; pattern=902083398000 matchPattern=^9(.*) replacePattern=\1 replaced pattern=02

083398000

Oct 14 09:32:24.921: //-1/5CC4DE3AA581/RXRULE/regxrule_subst_num_type: Match Typ

e = none, Replace Type = none Input Type = unknown

Oct 14 09:32:24.921: //-1/5CC4DE3AA581/RXRULE/regxrule_subst_num_plan: Match Pla

n = none, Replace Plan = none Input Plan = unknown

Oct 14 09:32:24.921: //-1/5CC4DE3AA581/RXRULE/regxrule_profile_translate_interna

l: xlt_number=02083398000 xlt_type=unknown xlt_plan=unknown

Oct 14 09:32:24.921: //-1/5CC4DE3AA581/RXRULE/regxrule_profile_translate_interna

l: number= type=unknown plan=unknown numbertype=redirect-target

Oct 14 09:32:24.921: //-1/5CC4DE3AA581/RXRULE/regxrule_get_RegXrule: Invalid tra

nslation ruleset tag=0

Oct 14 09:32:24.921: //-1/5CC4DE3AA581/RXRULE/regxrule_profile_match_internal: E

rror: ruleset for redirect-target number not found

Oct 14 09:32:24.921: //-1/5CC4DE3AA581/RXRULE/regxrule_profile_translate_interna

l: No match: number= type=unknown plan=unknown

Oct 14 09:32:24.921: //-1/5CC4DE3AA581/RXRULE/regxrule_profile_translate_interna

l: number= type=unknown plan=unknown numbertype=redirect-called

Oct 14 09:32:24.921: //-1/5CC4DE3AA581/RXRULE/regxrule_get_RegXrule: Invalid tra

nslation ruleset tag=0

Oct 14 09:32:24.921: //-1/5CC4DE3AA581/RXRULE/regxrule_profile_match_internal: E

rror: ruleset for redirect-called number not found

Oct 14 09:32:24.921: //-1/5CC4DE3AA581/RXRULE/regxrule_profile_translate_interna

l: No match: number= type=unknown plan=unknown

Oct 14 09:32:24.925: //-1/5CC4DE3AA581/RXRULE/regxrule_stack_pop_RegXruleNumInfo

: stack=0x23E56B8C; count=1

Oct 14 09:32:24.925: //-1/5CC4DE3AA581/RXRULE/regxrule_stack_pop_callinfo_intern

al: numinfo=0x23E6F820

Oct 14 09:32:24.925: //-1/5CC4DE3AA581/RXRULE/regxrule_stack_push_RegXruleNumInf

o_internal: stack=0x23E56B8C; count=1

Oct 14 09:32:24.949: //-1/5CC4DE3AA581/RXRULE/regxrule_stack_pop_callinfo_intern

al: numinfo=0x0

Oct 14 09:32:25.869: //-1/5CC4DE3AA581/RXRULE/regxrule_stack_pop_RegXruleNumInfo

: stack=0x23E56B8C; count=1

Oct 14 09:32:25.869: //-1/5CC4DE3AA581/RXRULE/regxrule_stack_pop_callinfo_intern

al: numinfo=0x23E6F820

i have tried a number of variations with rule 2:

rule 2 /221/ /3044*023/

rule 2 /2../ /3044*023/

rule 2 /^2../ /3044*023/

but nothing seems to work.   Can anybody see any flaw in the rule 2? or offer any help?

Thanks

John

1 ACCEPTED SOLUTION

Accepted Solutions
New Member

Translation rule problem

Hi John,

You want to strip 9 from a called number and convert calling number to 3044*023, is it correct?

So if you are calling from internal extension 250 to public number 902083359000 you need to send to sip-provider A-number 3044*023 and B-number 02083359000, am I right? To do so you have to implement two translation-rules, as I've mentioned before. One for calling number and another for called.

voice translation-rule 1

rule 1 /^9\(.*\)/ /\1/

!

voice translation-rule 2

rule 2 /^2..$/ /3044*023/

!

voice translation-profile DiscardDigit9

translate called 1

translate calling 2

!

dial-peer voice 1 voip

translation-profile outgoing DiscardDigit9

Please check it.

Kind regards,
Andrew C.

Kind regards, Andrew C.
9 REPLIES

Translation rule problem

Hi John.

Are you trying to translate incoming or outgoing calls?

Which is the called number and the expected translated number.

Please attach your running config.

Thanks

Carlo

Please rate all helpful posts

"The more you help the more you learn"

Please rate all helpful posts "The more you help the more you learn"
New Member

Translation rule problem

Hi Carlo

this is translate outgoing.  Ill be looking at the incoming sip next.

the called number is 90208335xxxx    i expect to see the 9 stripped.

The sip provider also needs to see the pilot number (user name) of 3044*023 rather than the internal extension number 221 that is currently sent.

sanitised config:


LR-2911#sh run
Building configuration...


Current configuration : 10556 bytes
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname LR-2911
!
boot-start-marker
boot-end-marker
!
!
logging buffered 51200 warnings
!
aaa new-model
!

logging buffered 51200 warnings
!
aaa new-model
!
!
aaa authentication login default local
!
!
!
!
!
aaa session-id common
clock timezone GMT 1 0
!
ip cef
!
!
!
!
!
!
ip domain lookup source-interface GigabitEthernet0/1
ip name-server 172.20.0.20
no ipv6 cef
multilink bundle-name authenticated
!
!
!
!
quit
voice-card 0
!
!
!
voice service voip
ip address trusted list
  ipv4 178.248.33.114 255.255.255.255
allow-connections sip to sip
no supplementary-service sip refer
no supplementary-service sip handle-replaces
fax protocol t38 version 0 ls-redundancy 0 hs-redundancy 0 fallback none
sip
!
voice class codec 1
codec preference 1 g711alaw
codec preference 2 g711ulaw
!
!
!
!
voice translation-rule 1
rule 1 /^9\(.*\)/ /\1/
rule 2 /^2../ /3044*023/
!
!
voice translation-profile DiscardDigit9
translate called 1
!
!
!
license udi pid CISCO2911/K9 sn FCZ1718607E
license accept end user agreement
hw-module ism 0
!
hw-module pvdm 0/0
!
!
!
file privilege 0

!
redundancy
!
!
no ip ftp passive
!
!
!
!
interface Embedded-Service-Engine0/0
no ip address
!
interface GigabitEthernet0/0
description Outside IF
ip address 172.20.15.10 255.255.0.0
ip nat outside
ip virtual-reassembly in
duplex auto
speed auto

interface GigabitEthernet0/1
description Inside IF
ip address 192.168.11.254 255.255.255.0
ip nat inside
ip virtual-reassembly in
duplex auto
speed auto
!

interface Vlan1
no ip address
!
!
tftp-server flash0:term62.default.loads
tftp-server flash0:term42.default.loads
tftp-server flash0:cnu42.9-2-1TH1-13.sbn
tftp-server flash0:apps42.9-2-1TH1-13.sbn
tftp-server flash0:dsp42.9-2-1TH1-13.sbn
tftp-server flash0:cvm42sccp.9-2-1TH1-13.sbn
tftp-server flash0:jar42sccp.9-2-1TH1-13.sbn
tftp-server flash0:SCCP42.9-2-1S.loads
!
!
!
control-plane
!
call threshold global cpu-avg low 68 high 75
call threshold global total-mem low 75 high 85
!
!
!
!
!
!
mgcp profile default
!
!
dial-peer voice 1 voip
translation-profile outgoing DiscardDigit9
destination-pattern 90..........
session protocol sipv2
session target dns:sip.cloudcalling.co.uk
voice-class codec 1
dtmf-relay rtp-nte
no vad
!
!
sip-ua
credentials username 3044*023 password 7 xxxxxx realm sip.cloudcalling.co.uk
authentication username 3044*023 password 7 xxxxxx realm sip authentication username 3044*023 password 7 xxxxx realm sip.cloudcalling.co.uk
nat symmetric role passive
nat symmetric check-media-src
no remote-party-id
retry invite 3
retry register 3
timers connect 100
registrar dns:sip.cloudcalling.co.uk expires 3600 refresh-ratio 20 auth-realm s
!
!
!
gatekeeper
shutdown
!
!
telephony-service
protocol mode ipv4
no auto-reg-ephone
max-ephones 25
max-dn 40
ip source-address 192.168.11.254 port 2000
max-redirect 5
cnf-file location flash:
load 7942 SCCP42.9-2-1S.loads
date-format dd-mm-yy
voicemail 401
max-conferences 8 gain -6
web admin system name xxx secret 5 xxx
dn-webedit
time-webedit
transfer-system full-consult
secondary-dialtone 9
create cnf-files version-stamp 7960 Oct 08 2013 16:25:28
!
!
!
ephone-dn  21  dual-line
label Joyce
description OPD Manager
name Joyce
!
!
ephone  21
mac-address 1CE6.C773.3CB7
username "Joyce"
type 7942
button  1:21
!
!
!

New Member

Translation rule problem

Hi John,

You have to create two translation rules since you want to implement digit-translation for both called and calling numbers. If I understood you correctly, you need to do this:

voice translation-rule 1

rule 1 /^9\(.*\)/ /\1/

!

voice translation-rule 2

rule 2 /^2../ /3044*023/

!

voice translation-profile DiscardDigit9

translate called 1

translate calling 2

and then apply the translation-profile on the outbound dial-peer.

Kind regards,
Andrew C.

Kind regards, Andrew C.
New Member

Re: Translation rule problem

Hi John,

In order to replace A-number 2.. with the number 3044*023 you should do something like this:

voice translation-rule 10

rule 1 /^2..$/ /3044*023/

!

voice translation-profile CALLS_TO_SIP

translate calling 10

!

dial-peer voice 300 voip ! outbound dial-peer to sip-provider

translation-profile outgoing CALLS_TO_SIP

Kind regards,
Andrew C.

Kind regards, Andrew C.
New Member

Translation rule problem

Hi Andrew

Thanks for that.  I have updated my config with that and get the following results:

LR-2911# test voice translation-rule 1 902083359000
Matched with rule 2
Original number: 902083359000   Translated number: 903044*0233359000
Original number type: none      Translated number type: none
Original number plan: none      Translated number plan: none

LR-2911#
Oct 14 10:35:24.672: //-1/xxxxxxxxxxxx/RXRULE/regxrule_match: No match; number=9
02083359000 rule precedence=1
Oct 14 10:35:24.672: //-1/xxxxxxxxxxxx/RXRULE/regxrule_match: No match; number=9
02083359000 rule precedence=1
Oct 14 10:35:24.672: //-1/xxxxxxxxxxxx/RXRULE/regxrule_match: No match; number=9
02083359000 rule precedence=1
Oct 14 10:35:24.672: //-1/xxxxxxxxxxxx/RXRULE/sed_subst: Successful substitution
; pattern=902083359000 matchPattern=2.. replacePattern=3044*023 replaced pattern
=903044*0233359000
Oct 14 10:35:24.672: //-1/xxxxxxxxxxxx/RXRULE/regxrule_subst_num_type: Match Typ
e = none, Replace Type = none Input Type = none
Oct 14 10:35:24.672: //-1/xxxxxxxxxxxx/RXRULE/regxrule_subst_num_plan: Match Pla
n = none, Replace Plan = none Input Plan = none
LR-2911#

the 9 isnt stripped and the new number is definately incorrect.

Can you see what is wrong with my original rules:

voice translation-rule 1
rule 1 /^9\(.*\)/ /\1/
rule 2 /^2../ /3044*023/

LR-2911# test voice translation-rule 1 902083359000
Oct 14 10:44:52.541: %SYS-5-CONFIG_I: Configured from console by xxx on vty0
(172.20.4.75)
Matched with rule 1
Original number: 902083359000   Translated number: 02083359000
Original number type: none      Translated number type: none
Original number plan: none      Translated number plan: none

LR-2911#
Oct 14 10:44:54.893: //-1/xxxxxxxxxxxx/RXRULE/regxrule_match: No match; number=9
02083359000 rule precedence=2
Oct 14 10:44:54.893: //-1/xxxxxxxxxxxx/RXRULE/sed_subst: Successful substitution
; pattern=902083359000 matchPattern=^9(.*) replacePattern=\1 replaced pattern=02
083359000
Oct 14 10:44:54.893: //-1/xxxxxxxxxxxx/RXRULE/regxrule_subst_num_type: Match Typ
e = none, Replace Type = none Input Type = none
Oct 14 10:44:54.893: //-1/xxxxxxxxxxxx/RXRULE/regxrule_subst_num_plan: Match Pla
n = none, Replace Plan = none Input Plan = none
LR-2911#

I seem to strip the 9 - but cannot translate the internal number.

thanks

John

Translation rule problem

Hi John.

in this case you can also use calling-info sip-to-pstn number set 3044*023

HTH

Regards

Carlo

Please rate all helpful posts

"The more you help the more you learn"

Please rate all helpful posts "The more you help the more you learn"
New Member

Translation rule problem

Hi John,

You want to strip 9 from a called number and convert calling number to 3044*023, is it correct?

So if you are calling from internal extension 250 to public number 902083359000 you need to send to sip-provider A-number 3044*023 and B-number 02083359000, am I right? To do so you have to implement two translation-rules, as I've mentioned before. One for calling number and another for called.

voice translation-rule 1

rule 1 /^9\(.*\)/ /\1/

!

voice translation-rule 2

rule 2 /^2..$/ /3044*023/

!

voice translation-profile DiscardDigit9

translate called 1

translate calling 2

!

dial-peer voice 1 voip

translation-profile outgoing DiscardDigit9

Please check it.

Kind regards,
Andrew C.

Kind regards, Andrew C.
New Member

Translation rule problem

Hi Andrew

You did, and i didnt read your post correctly.

Thanks soooo much.  Ive spent some considerable time on this.

John

New Member

Translation rule problem

You're welcome, I'm glad it helped )

Kind regards,
Andrew C.

Kind regards, Andrew C.
257
Views
0
Helpful
9
Replies
CreatePlease login to create content