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. If you'd prefer to explore, try our test area to get started. And see here for current known issues.

New Member

Matching outgoing dial-peer based on SIP trunk call came in on

Alright the title may be confusing.

 

In my example I have two SIP trunks coming into the same CUBE.  The CUBE will be sending all calls to the same PBX but I want the source IP coming from the CUBE to be different based on which SIP trunk the call came in on.

 

What I have so far is this but all inbound calls always use dial-peer 200 first.  

 

If the call comes from 10.1.1.1 I want dial-peer 200 to be used.  If the call comes from 10.2.1.1 I want dial-peer 201 to be used.  Any suggestions how to set it up?  As you can see I tried a couple different uri matches on the outgoing dial-peers, incoming and destination but neither worked.  The incoming dial-peers work correctly.

 

voice service voip
 ip address trusted list
  ipv4 10.1.1.1
  ipv4 10.2.1.1
  ipv4 172.16.129.10
 allow-connections sip to sip
 fax protocol t38 version 0 ls-redundancy 0 hs-redundancy 0 fallback none
 sip
!
!
voice class uri 1001 sip
 host ipv4:10.1.1.1
!
voice class uri 1002 sip
 host ipv4:10.2.1.1
!
dial-peer voice 1 voip
 description **Call from 10.1.1.1**
 session protocol sipv2
 incoming called-number .%
 incoming uri via 1001
 voice-class sip bind control source-interface Loopback0
 voice-class sip bind media source-interface Loopback0
 dtmf-relay rtp-nte
 codec g711ulaw
 fax-relay ecm disable
 no vad
!
dial-peer voice 2 voip
 description **Call from 10.2.1.1**
 session protocol sipv2
 incoming called-number .%
 incoming uri via 1002
 voice-class sip bind control source-interface Loopback1
 voice-class sip bind media source-interface Loopback1
 dtmf-relay rtp-nte
 codec g711ulaw
 fax-relay ecm disable
 no vad
!
dial-peer voice 200 voip
 description **From 10.1.1.1 to PBX**
 destination-pattern 6...$
 session protocol sipv2
 session target ipv4:172.16.129.10
 incoming uri via 1001
 voice-class sip bind control source-interface Loopback0
 voice-class sip bind media source-interface Loopback0
 dtmf-relay rtp-nte
 codec g711ulaw
 no vad
!
dial-peer voice 201 voip
 description **From 10.2.1.1 to PBX**
 destination-pattern 6...$
 session protocol sipv2
 session target ipv4:172.16.129.10
 destination uri 1002
 voice-class sip bind control source-interface Loopback1
 voice-class sip bind media source-interface Loopback1
 dtmf-relay rtp-nte
 codec g711ulaw
 no vad

 

 

7 REPLIES
New Member

Well I think I just figured

Well I think I just figured it out.

interface Loopback0
 ip address 10.1.1.2 255.255.255.255
!
interface Loopback1
 ip address 10.2.1.2 255.255.255.255
!

voice service voip
 ip address trusted list
  ipv4 10.1.1.1
  ipv4 10.2.1.1
  ipv4 172.16.129.10
 allow-connections sip to sip
 fax protocol t38 version 0 ls-redundancy 0 hs-redundancy 0 fallback none
 sip
!
!
voice class uri 1001 sip
 host ipv4:10.1.1.1
!
voice class uri 1002 sip
 host ipv4:10.2.1.1
!
voice class uri 1003 sip
 host ipv4:10.1.1.2
!
voice class uri 1004 sip
 host ipv4:10.2.1.2
!
dial-peer voice 1 voip
 description **Call from 10.1.1.1**
 session protocol sipv2
 incoming called-number .%
 incoming uri via 1001
 voice-class sip bind control source-interface Loopback0
 voice-class sip bind media source-interface Loopback0
 dtmf-relay rtp-nte
 codec g711ulaw
 fax-relay ecm disable
 no vad
!
dial-peer voice 2 voip
 description **Call from 10.2.1.1**
 session protocol sipv2
 incoming called-number .%
 incoming uri via 1002
 voice-class sip bind control source-interface Loopback1
 voice-class sip bind media source-interface Loopback1
 dtmf-relay rtp-nte
 codec g711ulaw
 fax-relay ecm disable
 no vad
!
dial-peer voice 200 voip
 description **From 10.1.1.1 to PBX**
 destination-pattern 6...$
 session protocol sipv2
 session target ipv4:172.16.129.10
 incoming uri via 1003
 voice-class sip bind control source-interface Loopback0
 voice-class sip bind media source-interface Loopback0
 dtmf-relay rtp-nte
 codec g711ulaw
 no vad
!
dial-peer voice 201 voip
 description **From 10.2.1.1 to PBX**
 destination-pattern 6...$
 session protocol sipv2
 session target ipv4:172.16.129.10
 incoming uri via 1004
 voice-class sip bind control source-interface Loopback1
 voice-class sip bind media source-interface Loopback1
 dtmf-relay rtp-nte
 codec g711ulaw
 no vad

 

VIP Super Bronze

Shane,Thanks for posting back

Shane,

Thanks for posting back..(+5). What was the issue then? Why didnt it work at first and what did you do..I cant see any difference int he config other than the loopback ip address you included

Please rate all useful posts "The essence of christianity is not the enthronement but the obliteration of self --William Barclay"
New Member

I added two new uri's.  One

I added two new uri's.  One for each loopback address and tied those to the outgoing dialpeers 200 and 201.

 

Since my incoming dialpeers bind each sip trunk to a different loopback address, I was able to match based on that address for the outgoing dialpeers.

 

My whole point of this exercise was to send the call to the PBX with a specific from IP address based on the sip trunk the call came in on.  Mainly for reporting purposes.

New Member

Well it turns out this does

Well it turns out this does not work.  It is still selecting by random either dialpeer 200 or 201.  I will keep working on it.

New Member

Alright I decided to do a

Alright I decided to do a little diagram in hopes that someone knows how to do this.

2 SIP trunks.  2 Loopback addresses on CUBE.  One PBX.  If a call comes in on Trunk1 I want it sent to the PBX with the source address of 10.1.1.2.  If a call comes in on Trunk2 I want it sent to the PBX with a source address of 10.2.1.2.  The destination pattern on the dial-peers to the PBX should be the same.

 

Trunk1  10.1.1.1 -------------> 10.1.1.2  --------------------> 172.16.129.10

                                                 CUBE                                         PBX

Trunk2  10.2.1.1 -------------> 10.2.1.2 ---------------------> 172.16.129.10

New Member

Did you ever figure this out?

Did you ever figure this out?  I'm having the same issues, I cannot seem to figure out how to get the dial-peers to route calls based on the source IP of the SIP trunk.

New Member

Nope.  I'm getting ready to

Nope.  I'm getting ready to start working on it again because one of our clients really needs this functionality.

 

 

213
Views
5
Helpful
7
Replies