on
06-29-2016
06:15 AM
- edited on
07-26-2024
09:58 AM
by
Kyzer Davis (kydavis)
Cisco Unified Border Element (CUBE) features a rich and powerful command set called "SIP Profiles" which allow an administrator the ability to modify, add, remove or copy elements of a SIP header or SDP Body from requests or responses. These rules can be configured for many scenarios; for example, to add a specific header required by a peer device, remove a problematic header to workaround an issue or modify a value not configurable by other command line interface (CLI) methods.
The sheer number of permutations and complexity of SIP Profile configuration means that administrators required a way to test and validate the regex and logic will not cause more harm than help.
That is where the SIP Profile Tester (SPT) tool features within Collaboration Solution Analyzer (CSA) comes into play. This SIP Profile Tester tool allows an administrator to simulate SIP Profile rule logic on real SIP messages. The outputs can then be examined by to determine if the rules logic is satisfactory or if continued iteration of the rule logic is required. All without ever touching production traffic.
The net benefit is that administrators can apply or modify rules with confidence that a change will not cause a P1 outage. Further, an administrator does not need to simulate in a lab and/or open a TAC case to have an expert review. This saves time for customers, partners and Cisco.
The tool can be found from the CSA homepage by selecting the "Validate SIP Profile Configs" option in the card.
The tool itself has 3 main text inputs:
A very common scenario is to work on a Diversion header within a SIP INVITE.
The rule below will modify a diversion header so that the user portion of the SIP URI is converted from 4 digits to 10 digits with the "\1" being the first group of parenthesis.
For regex logic, please refer to https://regex101.com/
The example regex in the modify statement can bee viewed here: https://regex101.com/r/0g8XPq/1
1. SIP Profile Rules:
rule 1 request ANY sip-header Diversion modify "sip:(.*)@" "sip:111222\1@"
2.SIP message to apply rules
INVITE sip:8675309@172.18.110.58:5060 SIP/2.0
Via: SIP/2.0/UDP 172.18.110.65:5060;branch=z9hG4bK-1972256-1-0
From: sipp <sip:1234@172.18.110.65:5060>;tag=1
To: sut <sip:kydavis@172.18.110.58:5060>
Call-ID: 1-1972256@172.18.110.65
CSeq: 1 INVITE
Contact: sip:sipp@172.18.110.65:5060
Max-Forwards: 70
Diversion: <sip:5100@10.10.10.10>
Example Output:
After selecting "apply" a the SPT tool will show multiple entries:
1. Original SIP Message: For the sake of "stare and compare" the original message is included on the left pane.
2. Modified SIP Message: The final result of the SPT simulation will be shown in the right pane.
3. Copy Registers: If using copy rules, a list of register: value entries is provided to help determine if the expected data is being copied to a variable.
4. Logs: The action, before, after and rule are listed in a table. This is to help an admin debug. This may also have information messages or exceptions encountered while parsing the input rules or messages.
5. Errors: If there are any errors found while parsing the SIP message or the SIP Profile Rules. Those will be shown as a final table at the end.
Highlighting of the Original/Modified SIP Message results:
- Modified SIP Headers or SDP Body will be highlighted blue in both message areas.
- Added SIP Headers or SDP Body will be highlighted green in the Modified SIP message result only.
- Removed SIP Headers or SDP body will be highlighted red in the original SIP message result only.
An example of the modify/add/remove highlighting can be seen below:
Note: If the SDP Body is modified, the content-length header will be modified to account for the new SDP Body length. While this does not highlight in the original/modified window an INFO log is provided describing this behavior.
Loading prebuilt rules and messages
SPT makes prebuilt rules available via a dropdown selector above the SIP Profile Rules input.
These cover basic features such as adding/removing/modifying headers, copying from the input message, copying from the peer message and even more advanced features such as CSEQ based method modifications or mline-index based modifications. Further, some of the more common profile types have been includes as scenarios.
Further, various sample SIP message request/response have been included as selectable options in the dropdown above the SIP Message To Test Rules On input. These feature interesting headers and SDP Body (audio/video/app/mime/t38) built around the prebuilt SIP profile Rules.
These rules and messages can be a good starting point to learn SIP profiles or used to start building your next custom rule.
There are a plethora of places to review SIP Profile logic and documentation. Some samples are provided below.
The original SPT tool has been deprecated as of 2023: https://www.cisco.com/c/en/us/support/web/retired-tools.html
Feedback can be submitted via the "Report Problem" button in the top right header of CSA.
Please include the following when submitting an issue involving IOS or Regex Logic:
debug ccsip mess
debug ccsip info
debug ccsip feature sip-profile
That is indeed sad news and quite frankly unacceptable. This is not how you treat customers if you have any intention to keep them as customers.
Just found this thread after trying to use the tool and agree 100% with Roger's statement.
Cisco are removing tools like this and the Virtual Machine Placement Tool which make it harder and harder to design and deploy collab solutions. A few weeks ago I spend hours just trying to find out hardware specs for a BE7000H M6 server.
Now I have no way of testing SIP profiles apart from changing them in a live environment. Incredibly poor that these tools are being taken away from the partners that are still trying to champion Cisco collab.
Worst decision ever made by the reputable company !
It is a huge disappointment to hear that the SIP Profile Tester Tool cannot be used by customers anymore.
It was extremely useful to test custom sip headers without the need to make test calls all the time.
I would appreciate it, if the SIP Profile Tester Tool would be integrated into the IOS-XE image at least, in the same manner as the "test voice translation-rule" feature is available in the IOS-XE image.
As a result, Cisco doesn't need to maintain a separate webpage anymore, and customers still can make use of it on the command line out of the box.
Win-Win
Best regards,
Georg
is there another tool others are using or just live testing in an environment? I searched and searched and can't seem to find anything, figured I'd ask.
@GeorgMa, probably best to raise the suggestion with a Cisco account rep.
I don't believe these Community forums are actually monitored by Cisco and the OP is probably no longer around.
Hello All,
The old SIP Profile Tester tool has been retired. See: https://www.cisco.com/c/en/us/support/web/retired-tools.html
The good news is that we have published a new, updated, version of the tool as part of Cisco Collaboration Solutions Analyzer (CSA).
The new tool can be found at the following link: https://cway.cisco.com/csa-new/#/sipprofiletest
Sample Screenshot:
Thanks for sharing @Kyzer Davis (kydavis) This is amazing news.
@ kyzer Davis thank you very much for your reply.
However, I don't receive any output from the SIP Profile Tester tool.
I entered my sip profiles rules on the left and in the right window "sip message to apply rules" I pasted my SIP message.
the below window "sip message to copy from" I kept empty, same as your example.
After I hit "apply" I see the webpage's progress icon, but after some seconds it disappears and there is neither an error message nor an output displayed at the bottom.
Even if I copy your example above to modify the SIP Diversion header, I also don't see any results.
Does it request any special format of the SIP messages or does it have any issues some special characters!?
Do you have any hints?
Update:
I am sorry, my bad.
clreared browser cache and accepted necessary webpage cookies.
now it works.
I'm trying to create a Diversion header based on the number in the From field but the tool keeps erroring with "bad escape \x at position"
I modified the profile from "Example: Create a Diversion header depending on the area code" of the CUBE guide:
When I drop in the exact same rule from the guide example, the tool still gives the error. Is something missing?
Attached images are the outputs from my modified rule and the guide's original rule.
@Edward Lau, good catch. Let me fix that.
Note, I also noticed a parsing error with inputs like "Header:valueWithNoSpace"
Working to fix that too.
@Edward Lau,
We pushed a new version of the SIP Profile Tester (SPT) earlier today to CSA.
This release includes a ton of changes, error catching some relaxed input validation.
I also validated that specific line from the CUBE config guide against my 17.14 CAT8000v.
You will wan to use a profile like below since the one in the doc is only a LF value when in reality to be parsed properly by upstream devices you will want to put a CRLF.
I have a better example of using "\x0D\x0A" over in my doc but I have cross-posted a sample below.
### Test Rule:
rule 45 request INVITE sip-header From modify "(.*sip:1234@.*)" "\1\x0d\x0aNewLineHeader: <sip:5678@example.com>"
rule 46 request INVITE sip-header To modify "(.*sip:8675309@.*)" "\1\x0D\x0ADiversion: <sip:7777@example.com>"
### Test Input:
INVITE sip:8675309@10.10.10.10:5060 SIP/2.0
From: <sip:1234@10.10.10.20:5060>;tag=1
To: <sip:8675309@10.10.10.10>
Also to note, you will want to use that in the OUTBOUND direction. If you try to apply this type of modification as an INBOUND profile modification CUBE is going to error about the formatting of the whole header. I don't have a warning for this yet but I will get to adding some helper warnings in a future release.
---
For anybody else: If you were seeing any oddities/errors.
Please retest. The release on June 18, 2024 covers many changes, fixes, and under the hood goodies.
I'm not getting any output in the "Modified SIP message" field after running the apply rules.
The "Original message" field displays the SIP message inputted but nothing for anything else, see screenshot.
I've tried different browsers, accepted all cookies, clearing the cache and using InPrivate/Incognito but all with same issue.
@Edward Lau, I am aware of the the "blank modified sip message" output error. I fixed it recently while implementing new features and re-working the GUI for the July Update.
Coincidentally the new SPT update should be live soon externally in CSA.
You will know it is live when you see the GUI look like the screenshots below. Please test your profile again when the new update is live. I will edit this message when I know the team has pushed the update but for now I have compiled the release notes below.
Edit 7/15/2024: Update is live!
---
Input Changes:
Results Changes:
New: prebuilt rule scenarios and test messages:
I hand crafted 26 rule scenarios comprising of 164 various rule combinations that cover about anything one can do with a SIP profile. These prebuilt selections are available via a dropdown selector above the SIP Profile Rules input.
These cover basic features such as adding/removing/modifying headers, copying from the input message, copying from the peer message and even more advanced features such as CSEQ based method modifications or mline-index based modifications. Further, some of the more common SIP profile usages have been includes as scenarios.
Finally, various sample SIP message request/response have been included as selectable options in the dropdown above the SIP Message To Test Rules On input. These messages feature interesting headers and SDP Body (audio/video/app/mime/t38) built around the prebuilt SIP profile Rules.
These prebuilt rules and messages can be a good starting point to learn SIP profiles or used to start building your next custom rule.
Dropdowns in the update:
New: Error Reporting
You should also be able to report errors through the "Report Problem" button now.
Final Notes:
In preparing this release I ended up testing and debugging 180+ SIP Profile scenarios against a real IOS XE 17.14 CUBE in the lab. I then compared those results to the output of SPT to ensure things are as 1:1 with real CUBE as possible. As such this release fixes a number of corner case issues I found with SPT logic between now and the June 18th release.
FYI: I have revised the original post in this article to reflect the current CSA based SIP Profile Tester (SPT) Tool and include a short user guide. Most of the content mirrors what was posted in my 07-08-2024 comment with some revisions here and there.
Enjoy.
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: