SIP Header Manipulation provides the flexibility to add, remove, or modify any attribute in a SIP message on the Acme Packet SBC. The most common reason for doing this is to fix an incompatibility problem between two SIP endpoints. This could range from anything such as Softswitch/PSTN incompatibility or an issue between two different IP PBX platforms in a multi-site Enterprise where calls between them fail due to issues in the SIP messaging.

In the past there was no straight forward way to test SIP Header Manipulation Rules other than performing save/activate and manually placing test calls to see if the HMR worked.

The example below is a case where an HMR needed to be written to route calls based on the Charge Number in the SIP Invite rather than routing on the Request-URI, TO, or FROM numbers. Because BroadWorks R14 uses a proprietary charge number header it is required to have one rule that looks at the number in the charge number header and stores that value using a store-action, then through the use of a second rule pastes the number as cn=4804563000 into the Request-URI then use a local-policy to route the call based on the cn= value.

The original SIP Invite from BroadWorks looks like this.

INVITE sip:+18005551212@sip.markholloway.com:5060;user=phone SIP/2.0
From:”John Smith”<sip:4804814001@voip.markholloway.com;user=phone>;tag=1121176714-1301523646656-
To:<sip:+18005551212@sip.markholloway.com:5060;user=phone>
Call-ID:BW1520466563003111177145372@10.12.135.140
CSeq:74277985 INVITE
Contact:<sip:10.12.135.100:5060>
Privacy:none
Allow:ACK,BYE,CANCEL,INFO,INVITE,OPTIONS,PRACK,REFER,NOTIFY
Accept:multipart/mixed,application/media_control+xml,application/sdp
Charge:<tel:4804563000>;noa=clgp-ani-natl-num
Supported:
Max-Forwards:10
Content-Type:application/sdp
Content-Length:255

The goal is to Route based on the Charge Number not the Request URI, To, or From numbers.  An HMR on the Session Director must be created to extract 4804563000 from the Charge Number header and insert it in the Request URI as a cn=4804563000.

Here is the HMR for copying the number from the Charge Number header and inserting it as a cn= parameter in the Request URI. Note this is one sip-manipulation that contains two rules.

 

The HMR may be tested directly within the ACLI by pasting in ASCII text that contains the original message of which the SD will manipulate.

The next step is set debugging enabled (from within test-sip-manipulation), show the sip-manipulation you are about to test (always good for verification), and then execute the test.

The SD shows the debug output of the original SIP Invite that was pasted in ASCII.

The SD now presents the newly manipulated SIP Invite.

Now that the Charge Number has been inserted as part of the Request URI using the cn= parameter a Local Policy’s Policy Attribute may be configured with lrt:RouteLRT;key=cn

The value key=cn tells the policy attribute to route based on the value within the cn parameter which in this case is cn=4804563000

  1. Layne Monson says:

    It might be worth noting that test-sip-manipulation feature only appears available in ACLI 6.2 .
    Not seeing this on 6.1

  2. MartinT says:

    Hi guys

    I am not seeing this “test-sip-manipulation” feature either nor was it mentioned on the Acme Packet course I just returned from, is it available on all models? it would be great to test it in the lab – how are you accessing it? config test-sip-manipulation?

    Thanks

  3. Mark says:

    Martin – As Layne mentioned, this is only available starting with 6.2.

  4. MartinT says:

    Thanks Mark

    Great site btw – really enjoying reading through your AP SBC notes as its an area I am just getting into (having just been on the course) I am taking the Support Professional exam on Thursday this week.

  5. Pascual says:

    I will try this as it.

    Thnx Mark!

  6. Malik says:

    Hi,

    Please inform how to remove Silence Suppression from INVITE Message. Thanks!

    Kind Regards,

    Malik

  7. durai says:

    How to remove the annexb=yes from the 180 ringing & 183 session progress message.

    Please revert with the sip-manipulation rule.

  8. Alex says:

    hAVE SAME QUESTION AS durai says:
    How to remove the annexb=yes from the 180 ringing & 183 session progress message.

    Also while test HRM tool SPD not parsed at all, how it can be?

  9. Alex says:

    to Malik:

    sip-manipulation
    name remove_silenceSuppression
    description remove_silenceSuppression
    split-headers
    join-headers
    header-rule
    name silenceSuppression
    header-name Content-type
    action manipulate
    comparison-type case-insensitive
    msg-type request
    methods INVITE
    match-value
    new-value
    element-rule
    name silenceSuppRem
    parameter-name application/sdp
    type mime
    action find-replace-all
    match-val-type any
    comparison-type pattern-rule
    match-value “a=silenceSupp(.*)(\n|\r\n)”
    new-value

  10. James says:

    Hey Mark, I was wondering if you could help me out. I’m trying manipulate the SIP header from send SIPS to SIP. My Avaya equipment will only allow SIP.

    Any suggestions?

    James

  11. Elvis says:

    Hello Mark!
    Please, do you know how can I remove the user=phone from the From header field?
    example of an invite:
    From: ;tag=699936964-1504201096088-
    And we need this invite like this:
    From: ;tag=699936964-1504201096088-
    Is it posible?