08-17-2023 01:28 PM
Hello, I'm configuring a Cisco CUBE in which I'm receiving invites with a custom 'Trunk' header that can have different values like:
Trunk: CH_Barracas_1
The intention is that based on that header, and despite the dialed digits, I can route the call to a specific outgoing dial-peer.
Is that possible?
Thank you.
08-17-2023 05:08 PM
I’m not aware of a way to do this with a custom header; however, you can do it with the x-route-tag attribute and Carrier ID (cid) value. Here’s an example slide from an old 2017 Cisco Live presentation. I’d link to the original but it appears they took down everything older than 2019.
As for the called number, you could either create a wildcard pattern (eg .T) or look at a Provisioning Policy to limit consideration to only the Carrier ID. At least, in theory; I’ve never needed to do what you’re attempting.
08-18-2023 05:18 AM
Thanks, Jonathan, I'm going to give a look at that.
08-17-2023 11:40 PM
These are the options available for inbound dial peer match, it’s from my probably most referenced document Explain Cisco IOS and IOS XE Call Routing
08-18-2023 05:22 AM
Hi Roger, yes, I've been looking at this documents but I'm not sur if that apply to my case.
Thanks!
08-18-2023 06:38 AM
It outlines the present possibilities for matching an inbound dial peer. What you asked about is not listed, forthwith it is not a viable alternative.
08-18-2023 06:46 AM
Ok, I understand. What I tought is that maybe it was possible to manipulate the incoming invite through a sip-profile in order to put that header value in one more "usable" place and maybe route the call via x-cisco-dest-route-string or something like that.
Thanks.
08-18-2023 06:54 AM
If you share the incoming invite we could see if there are any possible way to workaround to get the behaviour you’re looking for.
08-18-2023 07:04 AM
Ok, this is the invite I get:
Aug 17 15:45:18.479: //-1/xxxxxxxxxxxx/SIP/Msg/ccsipDisplayMsg:
Received:
INVITE sip:+56228930011@10.241.0.35:5060;transport=tcp;user=phone SIP/2.0
To: "Santiago, Chile" <sip:+56228930011@10.241.0.35;user=phone>
From: <sip:+56225950000@10.241.0.36;user=phone>;tag=H-97rh8
Call-ID: 8196f348-3341-45b2-a2cb-7290e2df23ed
Via: SIP/2.0/TCP 10.241.0.36:5060;branch=z9hG4bK2706841708SU5JTi9pM3NpcC4t_4096547023_
CSeq: 1 INVITE
Max-Forwards: 70
Allow: INVITE, ACK, CANCEL, BYE, OPTIONS, INFO
Supported: norefersub, timer
Accept: application/sdp
Contact: <sip:+56225950000@10.241.0.36:5060;transport=tcp>
x-inin-cnv: 8ccfecf8-251e-4b5d-81f7-6e42b46c9f95
Trunk: CH_Barracas_1
Content-Type: application/sdp
User-Agent: ININ-EDGE/1.0.0.12720
Content-Length: 183
Depending on the value in header 'Trunk', I should route the call to different outgoing sial-peers.
Thanks.
08-18-2023 08:20 AM
If this other system is able to add a custom header, it should also be able to modify headers and add the "trunk" as a tag in the VIA header for example.
And then you apply the config from my other message.
08-18-2023 10:05 AM
Yes, I suppose I could request that too.
Regarding your previous post, yes, the invite I shared is the original one the cube receives.
They could be quite the same with just the 'Trunk' header differen. I don't know how could I select different incoming dial-peer based on that.
Anyway, I think I could try the sip-profile / pattern method. Or request they add it in the via, as you say.
Thank you.
08-21-2023 11:19 PM - edited 08-21-2023 11:23 PM
Just use the logic a have already written down to separate the incoming calls with different "trunk" tags.
But here again step by step (for beginners):
Call 1 with the tag ";trunk=CH_Barracas_1" in the VIA header
Looks then like this "Via: SIP/2.0/TCP 1.1.1.1:5060;trunk=CH_Barracas_1"
voice class uri 100 sip
pattern trunk=CH.Barracas.1 (You need to use dots here as a wildcard, because CUBE doesn't support to match the underscore)
!
voice class dpg 100
description ### From Trunk CH_Barracas_1 - DP 100 to DP 200 ###
dial-peer 200
!
dial-peer voice 100 voip
incoming uri via 100
destination dpg 100
!
dial-peer voice 200 voip
destination-pattern BAD.BAD
!
voice class dpg 100
dial-peer 200
!
And just the same for call 2 with the tag ";trunk=CH_Example_2" in the VIA header
Looks then like this "Via: SIP/2.0/TCP 1.1.1.1:5060;trunk=CH_Example_2"
voice class uri 300 sip
pattern trunk=CH.Example.2
!
voice class dpg 300
description ### From Trunk CH_Example_2 - DP 300 to DP 400 ###
dial-peer 400
!
dial-peer voice 300 voip
incoming uri via 300
destination dpg 300
!
dial-peer voice 400 voip
destination-pattern BAD.BAD
!
voice class dpg 300
dial-peer 400
!
08-22-2023 05:48 AM
Ok, thank you, but I would still need the sip-profile to copy the Trunk header into the via header, right?
Thanks,
08-22-2023 05:56 AM
Only if you need this information to be sent out to the other side. But then you would need to work with a combi of SIP copy-lists and SIP profiles.
If you just want to use it to route on CUBE, then no.
08-22-2023 06:03 AM
Ok, I mean because in the example you give: "Via: SIP/2.0/TCP 1.1.1.1:5060;trunk=CH_Barracas_1" the trunk is already a tag in the via header, but I actually receive that as a separete header: Trunk: CH_Barracas_1
Would the pattern instruction read that anyway?
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