cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
903
Views
15
Helpful
4
Replies

Cisco SIP trunk amend host part from IP to Realm

RockSteadyEddie
Level 1
Level 1

I have been asked by my ITSP that all INVITE messages coming from my voice gateway be amended so that the main INVITE line, To and From headers are changed from number@1.2.3.4 (IP Address of target SBC) to number@realm.com (realm.com being an example domain name from the provider). 

 

I have tried this using voice class sip-profiles (and it works fine for REGISTER messages to them) as per the below.

 

request REGISTER sip-header To modify "<sip:(.*)>" "<sip:123456789@realm.com>"
request REGISTER sip-header From modify "<sip:(.*)>" "<sip:123456789@realm.com>"

 

However doing something similar for INVITE's traversing the dial-peer to them does nothing, any thoughts or configuration ideas would be appreciated.

1 Accepted Solution

Accepted Solutions

derek.andrew
Level 1
Level 1

Shouldn't it be

 

request INVITE sip-header From modify "@1.2.3.4" "realm.com"
request INVITE sip-header To modify "@1.2.3.4" "realm.com"

View solution in original post

4 Replies 4

derek.andrew
Level 1
Level 1

Shouldn't it be

 

request INVITE sip-header From modify "@1.2.3.4" "realm.com"
request INVITE sip-header To modify "@1.2.3.4" "realm.com"

Thanks for the response, yes I have tried something similar to that also  (and to be sure just tried it again) and it doesn't touch it, this is created as a sip-profile then added to the  dial peer with voice-class sip profiles 1

 

I'll keep hacking away at it however if there are any further suggestions they are most welcome!

Have a look at this excellent document for how to achieve what you ask about. https://www.cisco.com/c/en/us/support/docs/voice/ip-telephony-voice-over-ip-voip/211306-In-Depth-Explanation-of-Cisco-IOS-and-IO.html
It’s one of the go to sources for dial peer matching and modification of call element information.



Response Signature


Something along the way of this would likely do what you ask for, and a few other things that you might or might not want or need.

voice class sip-profiles 10
 request INVITE sip-header SIP-Req-URI modify "<provider IP>" "<provider domain>;user=phone" 
 request ANY sip-header From modify "From:(.*)(<sip:.*@).*>" "From: \2<customer domain>;user=phone>" 
 response ANY sip-header From modify "From:(.*)(<sip:.*@).*>" "From: \2<customer domain>;user=phone>" 
 request INVITE sip-header To modify "To:(.*)(<sip:.*@.*)>" "To: \2;user=phone>" 
 request ANY sip-header To modify "To:(.*)(<sip:.*@.*>)" "To: \2" 
 response ANY sip-header To modify "To:(.*)(<sip:.*@.*>)" "To: \2" 
 request INVITE sip-header Contact modify "Contact:(.*)(<sip:).*@.*>" "Contact: \2<customer domain>:5060;transport=tcp>" 
 request ANY sip-header Remote-Party-ID modify "Remote-Party-ID:(.*)(<sip:.*@).*>" "Remote-Party-ID: \2<customer domain>>" 
 response ANY sip-header Remote-Party-ID modify "Remote-Party-ID:(.*)(<sip:.*@).*>" "Remote-Party-ID: \2<customer domain>>" 
 request ANY sip-header P-Asserted-Identity modify "P-Asserted-Identity:(.*)(<sip:.*@).*>" "P-Asserted-Identity: \2<customer domain>>" 
 response ANY sip-header P-Asserted-Identity modify "P-Asserted-Identity:(.*)(<sip:.*@).*>" "P-Asserted-Identity: \2<customer domain>>" 
 request INVITE sip-header Diversion modify "Diversion:(.*)(<sip:).*@.*>" "Diversion: \2<customer directory number>@<customer domain>>" 
 request INVITE sip-header Diversion add "Diversion: <sip:<customer directory number>@<customer domain>>" 


You need to replace anything in my text that is within <> as it denotes a value that would be customer or service provider specific.



Response Signature


Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: