cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2634
Views
7
Helpful
31
Replies

Routing based on custom header

dgonzalez1
Level 1
Level 1

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.

31 Replies 31

Jonathan Schulenberg
Hall of Fame
Hall of Fame

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.

IMG_9340.png

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.

Thanks, Jonathan, I'm going to give a look at that.

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 

IMG_4510.jpeg



Response Signature


Hi Roger, yes, I've been looking at this documents but I'm not sur if that apply to my case.

Thanks!

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.



Response Signature


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.

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.



Response Signature


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.

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.

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.

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
!

 

Ok, thank you, but I would still need the sip-profile to copy the Trunk header into the via header, right?

Thanks,

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.

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?