12-17-2020 10:28 AM
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.
Solved! Go to Solution.
12-17-2020 12:36 PM
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"
12-17-2020 12:36 PM
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"
12-18-2020 12:47 AM
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!
12-20-2020 12:03 AM
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.
12-18-2020 06:52 AM - edited 12-19-2020 11:59 PM
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.
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