11-12-2013 07:19 AM - edited 03-16-2019 08:21 PM
Hello, All!
I am having some difficulties coming up with the appropriate regex for the following scenario. Does anyone have an idea how to better write a translation rule for outbound calls?
Scenario: Extension 75001 dials 123-456-7890.
Call Path: 75001 --> CUCM --(SIP Trunk)-> CUBE ---> SIP Trunk (PSTN)
Requirement: The PSTN requires the full 10-digit telephone number within the SIP header or it will deny the call.
Solution: Modify the SIP header to translate the extension to a full 10-digit number.
Issue: Telephone number is 555-123-5001. The leading 7 must be stripped and only the last 4 digits must then be prefixed with the NPA-NXX.
Example...
75001 dials 123-456-7890. Call sent to CUCM. CUCM sends calls to CUBE. CUBE translates SIP header from "75001@my.callmanager.home' to "5551235001@my.callmanager.home".
I believe this can be accomplished with SIP diversion header manipulation, but I'm not fully understanding the sytax behind it.
request INVITE sip-header Diversion modify "<sip:(.*)@(.*)>" "<sip:555123???@my.callmanager.home>"
Thanks in advance for your time and help!
Solved! Go to Solution.
11-12-2013 07:31 AM
You dont need a diversion header as this is only used during call forwarding. what you need is either Remote-Party-ID or P-Asserted-Identity, depending on which your cucm is configured to use...
request INVITE sip-header Remote-Party-ID modify "<555123>" "
my.callmanager.home
>"
Replace the NPA-XXX with the correct number you require
Please rate all useful posts
"opportunity is a haughty goddess who waste no time with those who are unprepared"
11-12-2013 07:31 AM
You dont need a diversion header as this is only used during call forwarding. what you need is either Remote-Party-ID or P-Asserted-Identity, depending on which your cucm is configured to use...
request INVITE sip-header Remote-Party-ID modify "<555123>" "
my.callmanager.home
>"
Replace the NPA-XXX with the correct number you require
Please rate all useful posts
"opportunity is a haughty goddess who waste no time with those who are unprepared"
11-12-2013 08:18 AM
Hi Raymond,
I believe what you are looking for is to change the calling number from 75001 to 5551235001 in the "From", the Remote-Party-ID or the P-Asserted dentity. If thats the case then try the following :
request INVITE sip-header From modify "<7>" "<555123>"555123>7>
Let us know if that works.
Regards,
Jagpreet
11-12-2013 08:23 AM
Both of you were extremely helpful. Thanks so much! Back to the documentation for me.
11-12-2013 12:58 PM
Since you have a CUCM, I'm curious as to why you are not using External Phone Number Masks. Anything you can share with us?
Anthony Holloway
Please use the star ratings to help drive great content to the top of searches.
11-12-2013 01:23 PM
Hi, Anthony!
Sure. I oversimplified the example scenario,but portrayed the same purpose. What I'm doing in reality is running certain existing extensions to a new SIP trunk during a test period. For security reasons, the new carrier only allows outbound calls on DIDs they host. During testing, I have left the external call mask the same and added the test SIP trunk at the top of the route list. If for some reason it were to fail, the call will continue to route out it's production call path using the correct external call mask.
I hope that helps your curiosity. I always appreciate learning new and better ways to do things, so if you have any suggestions or comments fire away. Thanks!
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