cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
4448
Views
35
Helpful
15
Replies

Dial-peer selection, before or after translation-rule, especially for incoming

Difan Zhao
Level 5
Level 5

Hi,

This might be a dumb question since I just started my study.. My observation is that the dial-peer matching (for both inbound and outbound), happens before the translation, correct? For example, for an incoming call, it apparently could not match my pots dial-peer where 1005 is connected

! inbound dial-peer
dial-peer voice 1 voip
translation-profile incoming DID2EXT
incoming called-number 5877745461
!
voice translation-profile DID2EXT
translate called 2
!
voice translation-rule 2
rule 1 /^5877745461$/ /1005/

Thanks,

Difan

 

 

1 Accepted Solution

Accepted Solutions

That's another option, but your translation should work as well.

Since you have set this up under a VoIP dial-peer, I assume you are receiving this call over an IP connection/SIP. If that's the case your configuration looks valid. As long as it is matching the dial-peer it should translate the number to 4 digit extension and you ephone-dn should ring.

You can test your translation rule by below command,  it is translating correctly:

ESW1#test voice translation-rule 2 5877745461
Matched with rule 1
Original number: 5877745461     Translated number: 1005
Original number type: none      Translated number type: none
Original number plan: none      Translated number plan: none

 

If its not happening, take the following debugs and post the debug:

1) debug voip ccapi inout

2) debug voip dialpeer inout

3) debug voip translation

 

 

-Terry

 

Please rate all helpful posts.

View solution in original post

15 Replies 15

Manish Gogna
Cisco Employee
Cisco Employee

Hi Difan,

Voice Translation Rules are applied to Voice Translation Profiles. These profiles are then applied to dial peers or voice ports. Profiles can be applied to VoIP or POTS dial peers or voice ports, and can be applied to inbound or outbound calls.

If they are applied at voice port then they get applied before hitting a dial peer. In the config that you posted the translation profile is applied on a voip dial peer, try applying it on a pots dial peer for an incoming call.

 

Manish

- Do rate helpful posts -

Vivek Batra
VIP Alumni
VIP Alumni

Depends where you are applying translation rules.

For instance in your example, you are applying translation rules under voip dial peer. This implicitly means that IOS will first need to select dial peer followed by applying respective translation profile.

In case of PoTS which are physical port, you have a choice to apply translation rules on port itself and since dial peer in this case is selected after port selection, hence translation rules (on port) are also applied before inbound dial peer selection. Further in such cases, you can again apply translation rule associated with inbound call leg (/dialpeer). This is different from CUCM digit manipulation where digit manipulation occurs only at one  place viz RP or RL or Gateway.

 Thanks

Vivek

Difan Zhao
Level 5
Level 5

Thank you guys. I will try to apply it on a voice port to learn its behavior.

So in my setup, my goal is when people calls 5877745461, it will ring a phone which is also configured with extension number 1005. I thought that it could match an inbound DP, which translates the number to 1005, in order to match the outbound (POTS) DP. I guess that it is not an option.

So in order to achieve this, is it the only way to configure the 5877745461 as a secondary number under ephone-dn?

Thanks,

Difan

That's another option, but your translation should work as well.

Since you have set this up under a VoIP dial-peer, I assume you are receiving this call over an IP connection/SIP. If that's the case your configuration looks valid. As long as it is matching the dial-peer it should translate the number to 4 digit extension and you ephone-dn should ring.

You can test your translation rule by below command,  it is translating correctly:

ESW1#test voice translation-rule 2 5877745461
Matched with rule 1
Original number: 5877745461     Translated number: 1005
Original number type: none      Translated number type: none
Original number plan: none      Translated number plan: none

 

If its not happening, take the following debugs and post the debug:

1) debug voip ccapi inout

2) debug voip dialpeer inout

3) debug voip translation

 

 

-Terry

 

Please rate all helpful posts.

Thanks Terry for your reply. I use voip.ms for my SIP trunk to the PSTN. Here is the requested output

Cisco2821#test voice translation-rule 2 5877745461
Matched with rule 1
Original number: 5877745461     Translated number: 1005
Original number type: none      Translated number type: none
Original number plan: none      Translated number plan: none

I also enabled "debug ccsip messages". I was calling from my cell 5874343162.

Cisco2821#
Jul 13 04:15:50.105: //-1/xxxxxxxxxxxx/SIP/Msg/ccsipDisplayMsg:
Received:
INVITE sip:5877745461@68.146.153.145 SIP/2.0
Via: SIP/2.0/UDP 50.23.160.50:5060;branch=z9hG4bK679754a6;rport
Max-Forwards: 70
From: "5874343162" <sip:5874343162@50.23.160.50>;tag=as0f50ed22
To: <sip:5877745461@68.146.153.145>
Contact: <sip:5874343162@50.23.160.50:5060>
Call-ID: 3280fa351dfb40a75052ef5c11ad108f@50.23.160.50:5060
CSeq: 102 INVITE
User-Agent: voip.ms
Date: Mon, 13 Jul 2015 04:15:50 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Remote-Party-ID: "5874343162" <sip:5874343162@50.23.160.50>;party=calling;privacy=off;screen=no
Content-Type: application/sdp
Content-Length: 270

v=0
o=root 1031475322 1031475322 IN IP4 50.23.160.50
s=voip.ms
c=IN IP4 50.23.160.50
t=0 0
m=audio 16048 RTP/AVP 0 18 101
a=rtpmap:0 PCMU/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=sendrecv

Jul 13 04:15:50.109: //-1/xxxxxxxxxxxx/DPM/dpMatchPeersCore:
   Calling Number=5877745461, Called Number=5877745461, Peer Info Type=DIALPEER_INFO_SPEECH
Jul 13 04:15:50.109: //-1/xxxxxxxxxxxx/DPM/dpMatchPeersCore:
   Match Rule=DP_MATCH_DEST; Called Number=5877745461
Jul 13 04:15:50.109: //-1/xxxxxxxxxxxx/DPM/dpMatchPeersCore:
   No Outgoing Dial-peer Is Matched; Result=NO_MATCH(-1)
Jul 13 04:15:50.109: //-1/xxxxxxxxxxxx/DPM/dpMatchSafModulePlugin:
   dialstring=5877745461, saf_enabled=1, saf_dndb_lookup=1, dp_result=-1
Jul 13 04:15:50.109: //-1/xxxxxxxxxxxx/DPM/dpMatchPeersMoreArg:
   Result=NO_MATCH(-1)
Jul 13 04:15:50.109: //-1/xxxxxxxxxxxx/SIP/Msg/ccsipDisplayMsg:
Sent:
SIP/2.0 400 Bad Request - 'Invalid Host'
Via: SIP/2.0/UDP 50.23.160.50:5060;branch=z9hG4bK679754a6;rport
From: "5874343162" <sip:5874343162@50.23.160.50>;tag=as0f50ed22
To: <sip:5877745461@68.146.153.145>;tag=258F9290-190
Date: Mon, 13 Jul 2015 04:15:50 GMT
Call-ID: 3280fa351dfb40a75052ef5c11ad108f@50.23.160.50:5060
CSeq: 102 INVITE
Allow-Events: telephone-event
Reason: Q.850;cause=100
Server: Cisco-SIPGateway/IOS-12.x
Content-Length: 0

Jul 13 04:15:50.153: //-1/xxxxxxxxxxxx/SIP/Msg/ccsipDisplayMsg:
Received:
ACK sip:5877745461@68.146.153.145 SIP/2.0
Via: SIP/2.0/UDP 50.23.160.50:5060;branch=z9hG4bK679754a6;rport
Max-Forwards: 70
From: "5874343162" <sip:5874343162@50.23.160.50>;tag=as0f50ed22
To: <sip:5877745461@68.146.153.145>;tag=258F9290-190
Contact: <sip:5874343162@50.23.160.50:5060>
Call-ID: 3280fa351dfb40a75052ef5c11ad108f@50.23.160.50:5060
CSeq: 102 ACK
User-Agent: voip.ms
Content-Length: 0

I don't believe that the "debug voip translation" or "debug voip ccapi inout" generated any thing. 

One weird thing in the debug is that both the calling and called become 5877745461 for some reason.

The call should match inbound dial-peer 1

dial-peer voice 1 voip
 translation-profile incoming DID2EXT
 session protocol sipv2
 incoming called-number 5877745461
 dtmf-relay cisco-rtp rtp-nte
 codec g711ulaw
 no vad

 

Please help.. Thanks!

 

can you make another test call and take the following debugs:

1) debug voip dialpeer inout

2) debug voip translation

3) debug voip ccapi inout

Once done make another test call and take this debug separately:

debug ccsip messages

Can you also attach your show run to this?

It should work if you assign the DID as secondary number - did you test that?

-Terry

Please rate all helpful posts

Ok weird thing happened... So I applied the 5877745461 under the ephone-dn as the secondary number and later removed it. Now it started to work!

ephone-dn  15
 number 1005 secondary 5877745461 no-reg both

Anyway I still enabled the required debugs, and the log is attached. It also has the "show run" at the end. Let me know if you can find anything but I am happy to know the order of sequence and proved it in the lab! Thanks!

 

Not sure, why it was not working before but highlighting the parts of trace where it shows how the number is translated and dial-peers are selected:

 

=========================

 

Received:
INVITE sip:5877745461@192.168.1.250:5060 SIP/2.0
Via: SIP/2.0/UDP 50.23.160.50:5060;branch=z9hG4bK6b9a5ea5;rport
Max-Forwards: 70
From: "5874343162" <sip:5874343162@50.23.160.50>;tag=as6cf6eb58
To: <sip:5877745461@192.168.1.250:5060>
Contact: <sip:5874343162@50.23.160.50:5060>
Call-ID: 1d91d8764e0bcbf25f69f3ba1c471b57@50.23.160.50:5060
CSeq: 102 INVITE
User-Agent: voip.ms
Date: Tue, 14 Jul 2015 01:56:51 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Remote-Party-ID: "5874343162" <sip:5874343162@50.23.160.50>;party=calling;privacy=off;screen=no
Content-Type: application/sdp
Content-Length: 268

v=0
o=root 929102779 929102779 IN IP4 50.23.160.50
s=voip.ms
c=IN IP4 50.23.160.50
t=0 0
m=audio 14478 RTP/AVP 0 18 101
a=rtpmap:0 PCMU/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=sendrecv

.Jul 14 01:56:51.069: //-1/6DA1B2CA8003/CCAPI/cc_api_display_ie_subfields:
   cc_api_call_setup_ind_common:
   cisco-username=5874343162
   ----- ccCallInfo IE subfields -----
   cisco-ani=5874343162
   cisco-anitype=0
   cisco-aniplan=0
   cisco-anipi=0
   cisco-anisi=0
   dest=5877745461
   cisco-desttype=0
   cisco-destplan=0
   cisco-rdie=FFFFFFFF
   cisco-rdn=
   cisco-rdntype=0
   cisco-rdnplan=0
   cisco-rdnpi=-1
   cisco-rdnsi=-1
   cisco-redirectreason=-1   fwd_final_type =0
   final_redirectNumber =
   hunt_group_timeout =0

.Jul 14 01:56:51.069: //-1/6DA1B2CA8003/CCAPI/cc_api_call_setup_ind_common:
   Interface=0x49AAFA5C, Call Info(
   Calling Number=5874343162,(Calling Name=)(TON=Unknown, NPI=Unknown, Screening=Not Screened, Presentation=Allowed),
   Called Number=5877745461(TON=Unknown, NPI=Unknown),
   Calling Translated=FALSE, Subscriber Type Str=Unknown, FinalDestinationFlag=TRUE,
   Incoming Dial-peer=1, Progress Indication=NULL(0), Calling IE Present=TRUE,
   Source Trkgrp Route Label=, Target Trkgrp Route Label=, CLID Transparent=FALSE), Call Id=3
.Jul 14 01:56:51.073: //-1/6DA1B2CA8003/CCAPI/ccCheckClipClir:
   In: Calling Number=5874343162(TON=Unknown, NPI=Unknown, Screening=Not Screened, Presentation=Allowed)
.Jul 14 01:56:51.073: //-1/6DA1B2CA8003/CCAPI/ccCheckClipClir:
   Out: Calling Number=5874343162(TON=Unknown, NPI=Unknown, Screening=Not Screened, Presentation=Allowed)
.Jul 14 01:56:51.073: //-1/xxxxxxxxxxxx/CCAPI/cc_get_feature_vsa:
   
.Jul 14 01:56:51.073: :cc_get_feature_vsa malloc success
.Jul 14 01:56:51.073: //-1/xxxxxxxxxxxx/CCAPI/cc_get_feature_vsa:
   
.Jul 14 01:56:51.073:  cc_get_feature_vsa count is 1
.Jul 14 01:56:51.073: //-1/xxxxxxxxxxxx/CCAPI/cc_get_feature_vsa:
   
.Jul 14 01:56:51.073: :FEATURE_VSA attributes are: feature_name:0,feature_time:1272882680,feature_id:1
.Jul 14 01:56:51.073: //3/6DA1B2CA8003/CCAPI/cc_api_call_setup_ind_common:
   Set Up Event Sent;
   Call Info(Calling Number=5874343162(TON=Unknown, NPI=Unknown, Screening=Not Screened, Presentation=Allowed),
   Called Number=5877745461(TON=Unknown, NPI=Unknown))
.Jul 14 01:56:51.073: //-1/6DA1B2CA8003/RXRULE/regxrule_stack_pop_RegXruleNumInfo: stack=0x4BB415E0; count=1
.Jul 14 01:56:51.073: //-1/6DA1B2CA8003/RXRULE/regxrule_stack_pop_callinfo_internal: numinfo=0x48E88C94
.Jul 14 01:56:51.077: //3/6DA1B2CA8003/CCAPI/cc_process_call_setup_ind:
   Event=0x49D433D8
.Jul 14 01:56:51.077: //-1/xxxxxxxxxxxx/CCAPI/cc_setupind_match_search:
   Try with the demoted called number 5877745461
.Jul 14 01:56:51.081: //3/6DA1B2CA8003/CCAPI/ccCallSetContext:
   Context=0x4BDFE060
.Jul 14 01:56:51.081: //3/6DA1B2CA8003/CCAPI/cc_process_call_setup_ind:
   >>>>CCAPI handed cid 3 with tag 1 to app "_ManagedAppProcess_Default"
.Jul 14 01:56:51.085: //3/6DA1B2CA8003/SIP/Msg/ccsipDisplayMsg:
Sent:
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 50.23.160.50:5060;branch=z9hG4bK6b9a5ea5;rport
From: "5874343162" <sip:5874343162@50.23.160.50>;tag=as6cf6eb58
To: <sip:5877745461@192.168.1.250:5060>
Date: Tue, 14 Jul 2015 01:56:51 GMT
Call-ID: 1d91d8764e0bcbf25f69f3ba1c471b57@50.23.160.50:5060
CSeq: 102 INVITE
Allow-Events: telephone-event
Server: Cisco-SIPGateway/IOS-12.x
Content-Length: 0


.Jul 14 01:56:51.085: //-1/6DA1B2CA8003/RXRULE/regxrule_stack_push_RegXruleNumInfo_internal: stack=0x4BB415E0; count=1
.Jul 14 01:56:51.085: //-1/6DA1B2CA8003/RXRULE/regxrule_profile_translate_internal: number=5874343162 type=unknown plan=unknown numbertype=calling
.Jul 14 01:56:51.085: //-1/6DA1B2CA8003/RXRULE/regxrule_get_RegXrule: Invalid translation ruleset tag=0
.Jul 14 01:56:51.085: //-1/6DA1B2CA8003/RXRULE/regxrule_profile_match_internal: Error: ruleset for calling number not found
.Jul 14 01:56:51.085: //-1/6DA1B2CA8003/RXRULE/regxrule_profile_translate_internal: No match: number=5874343162 type=unknown plan=unknown
.Jul 14 01:56:51.085: //-1/6DA1B2CA8003/RXRULE/regxrule_profile_translate_internal: number= type=unknown plan=unknown numbertype=redirect-called
.Jul 14 01:56:51.085: //-1/6DA1B2CA8003/RXRULE/regxrule_get_RegXrule: Invalid translation ruleset tag=0
.Jul 14 01:56:51.085: //-1/6DA1B2CA8003/RXRULE/regxrule_profile_match_internal: Error: ruleset for redirect-called number not found
.Jul 14 01:56:51.085: //-1/6DA1B2CA8003/RXRULE/regxrule_profile_translate_internal: No match: number= type=unknown plan=unknown
.Jul 14 01:56:51.085: //-1/6DA1B2CA8003/RXRULE/regxrule_profile_translate_internal: number=5877745461 type=unknown plan=unknown numbertype=called
.Jul 14 01:56:51.085: //-1/6DA1B2CA8003/RXRULE/regxrule_profile_match_internal: Matched with rule 1 in ruleset 2
.Jul 14 01:56:51.085: //-1/6DA1B2CA8003/RXRULE/regxrule_profile_match_internal: Matched with rule 1 in ruleset 2
.Jul 14 01:56:51.085: //-1/6DA1B2CA8003/RXRULE/sed_subst: Successful substitution; pattern=5877745461 matchPattern=^5877745461$ replacePattern=1005 replaced pattern=1005
.Jul 14 01:56:51.085: //-1/6DA1B2CA8003/RXRULE/regxrule_subst_num_type: Match Type = none, Replace Type = none Input Type = unknown
.Jul 14 01:56:51.085: //-1/6DA1B2CA8003/RXRULE/regxrule_subst_num_plan: Match Plan = none, Replace Plan = none Input Plan = unknown
.Jul 14 01:56:51.085: //-1/6DA1B2CA8003/RXRULE/regxrule_profile_translate_internal: xlt_number=1005 xlt_type=unknown xlt_plan=unknown
.Jul 14 01:56:51.085: //3/6DA1B2CA8003/CCAPI/ccCallProceeding:
   Progress Indication=NULL(0)
.Jul 14 01:56:51.093: //3/6DA1B2CA8003/CCAPI/ccCallSetupRequest:
   Destination=, Calling IE Present=TRUE, Mode=0,
   Outgoing Dial-peer=20005, Params=0x4BDFF570, Progress Indication=ORIGINATING SIDE IS NON ISDN(3)
.Jul 14 01:56:51.093: //-1/6DA1B2CA8003/RXRULE/regxrule_vp_translate: No profile found in voice port or trunk group for outgoing direction
.Jul 14 01:56:51.093: //-1/6DA1B2CA8003/RXRULE/regxrule_vp_translate: calling_number=5874343162 calling_octet=0x0
called_number=1005 called_octet=0x0
redirect_number= redirect_type=0 redirect_plan=0
.Jul 14 01:56:51.093: //3/6DA1B2CA8003/CCAPI/ccCheckClipClir:
   In: Calling Number=5874343162(TON=Unknown, NPI=Unknown, Screening=Not Screened, Presentation=Allowed)
.Jul 14 01:56:51.097: //3/6DA1B2CA8003/CCAPI/ccCheckClipClir:
   Out: Calling Number=5874343162(TON=Unknown, NPI=Unknown, Screening=Not Screened, Presentation=Allowed)
.Jul 14 01:56:51.097: //3/6DA1B2CA8003/CCAPI/ccCallSetupRequest:
   Destination Pattern=1005$, Called Number=1005, Digit Strip=TRUE
.Jul 14 01:56:51.097: //3/6DA1B2CA8003/CCAPI/ccCallSetupRequest:
   Calling Number=5874343162(TON=Unknown, NPI=Unknown, Screening=Not Screened, Presentation=Allowed),
   Called Number=1005(TON=Unknown, NPI=Unknown),
   Redirect Number=, Display Info=5874343162
   Account Number=5874343162, Final Destination Flag=TRUE,
   Guid=6DA1B2CA-2902-11E5-8003-F334EFAD735A, Outgoing Dial-peer=20005
.Jul 14 01:56:51.097: //3/6DA1B2CA8003/CCAPI/cc_api_display_ie_subfields:
   ccCallSetupRequest:
   cisco-username=5874343162
   ----- ccCallInfo IE subfields -----
   cisco-ani=5874343162
   cisco-anitype=0
   cisco-aniplan=0
   cisco-anipi=0
   cisco-anisi=0
   dest=1005
   cisco-desttype=0
   cisco-destplan=0
   cisco-rdie=FFFFFFFF
   cisco-rdn=
   cisco-rdntype=0
   cisco-rdnplan=0
   cisco-rdnpi=-1
   cisco-rdnsi=-1
   cisco-redirectreason=-1   fwd_final_type =0
   final_redirectNumber =
   hunt_group_timeout =0

.Jul 14 01:56:51.097: //3/6DA1B2CA8003/CCAPI/ccIFCallSetupRequestPrivate:
   Interface=0x4BA81454, Interface Type=6, Destination=, Mode=0x0,
   Call Params(Calling Number=5874343162,(Calling Name=5874343162)(TON=Unknown, NPI=Unknown, Screening=Not Screened, Presentation=Allowed),
   Called Number=1005(TON=Unknown, NPI=Unknown), Calling Translated=FALSE,
   Subscriber Type Str=Unknown, FinalDestinationFlag=TRUE, Outgoing Dial-peer=20005, Call Count On=FALSE,
   Source Trkgrp Route Label=, Target Trkgrp Route Label=, tg_label_flag=0, Application Call Id=)
.Jul 14 01:56:51.097: //-1/xxxxxxxxxxxx/CCAPI/cc_get_feature_vsa:
   
.Jul 14 01:56:51.097: :cc_get_feature_vsa malloc success
.Jul 14 01:56:51.097: //-1/xxxxxxxxxxxx/CCAPI/cc_get_feature_vsa:
   
.Jul 14 01:56:51.097:  cc_get_feature_vsa count is 2
.Jul 14 01:56:51.097: //-1/xxxxxxxxxxxx/CCAPI/cc_get_feature_vsa:
   
.Jul 14 01:56:51.097: :FEATURE_VSA attributes are: feature_name:0,feature_time:1272882456,feature_id:2
.Jul 14 01:56:51.101: //4/6DA1B2CA8003/CCAPI/ccIFCallSetupRequestPrivate:
   SPI Call Setup Request Is Success; Interface Type=6, FlowMode=1
.Jul 14 01:56:51.101: //4/6DA1B2CA8003/CCAPI/ccCallSetContext:
   Context=0x4BDFF520
.Jul 14 01:56:51.101: //3/6DA1B2CA8003/CCAPI/ccSaveDialpeerTag:
   Outgoing Dial-peer=20005
.Jul 14 01:56:51.109: //4/6DA1B2CA8003/CCAPI/cc_api_update_call_info:
   Interface=0x4BA81454, Call Id=0x4

=========================

 

-Terry

Please rate all helpful posts

Great post Terry.. deserve 10+!

Thanks for kind words Wilson.

-Terry

Hi,

It is hard to come to a conclusion with this much info, may I request you to let the debug voice ccapi inout for some time (around 1 min) and capture the output and upload in a text file please?

 

Also, if you can and dont mind, posting the router config as well?

 

Regards

Wilson Samuel
Level 7
Level 7

Thanks for all the information sharing, gentlemen!

Just wanted to add one more point:

If you are using num-exp then, it is applied very first, regardless of dial-peer selection, i.e. if you add the following command

num-exp 2123 5559407

Then regardless of which dial-peer is selected, it will always translate the called number from 2123c to 555-9407

 

HTH

Thanks Wilson. I have tried it too and it works. So when are you using num-exp and when are you using dial-peer translation profile?

Hi Difan,

Num-exp is a global rule and only works with destination number. Whereas translation rules can be applied to calling numbers as well and also at voice port or dial peer level.

 

Manish

- Do rate helpful posts -