System implementation of SIP Message Header Manipulation

benjamin.omeke
benjamin.omeke  Diamond  (1)
7 years 10 months ago  View: 1575  Reply: 0
1F


The SIP header Manipulation is a function on the Huawei SBC (SE2600)



When the SE2600 receives a SIP message, the HMR copies the original decoded SIP message (which is not processed by the SE2600) as a duplicate of the current SIP message. This duplicate is used to check messages in the rule to ensure that the processing of the SIP message by the SE2600 does not affect the message check result.

After processing the SIP message, the SE2600 checks the mapping group to which the message belongs, and then checks whether the mapping group contains an associated header manipulation view. If so, the SE2600 processes packets according to the associated header manipulation view, obtains a rule from the header manipulation view, and checks whether the current SIP message (the duplicate of the SIP message at this time) complies with all settings (including message, direction, and match) in the rule. If yes, the SE2600 processes the object (obtained from the SIP message processed by the SE2600) according to the actions and new values. If the configuration check fails, the SBC skips to the next rule until the traverse of the rules are complete. In this case, the HMR manipulation is complete, and the SIP message is sent. The SIP HMR feature can be used to delete system-recognized headers such as User-Agent and parameters in the headers, such as display-name in From and To headers, and to discard the entire SIP message. Figure 1 shows the header manipulation flowchart.

 


http://localhost:7890/pages/31186402/01/31186402/01/resources/figure/HMR_1_en.png



  1. After routine processing of a SIP message, the SE2600 checks whether the mapping group or IP trunk to which the SIP message belongs is associated with header manipulation views. If the mapping group or IP trunk is associated with header manipulation views, the SE2600 obtains the view indexes, enters the views, and traverses HMRs in the views to perform header manipulation.
  2. The SE2600 checks whether the current rule is enabled.
    • If the current rule is enabled, the SE2600 performs the operation described in 3.
    • If the current rule is disabled, the SE2600 performs the operation described in 7.
  3. The SE2600 checks the direction, message type, and matching conditions of the SIP message against the configurations in the header manipulation rule.
    • If multiple match conditions are available, the match succeeds only when all conditions must match if the match mode is and, and the match succeeds when any one of the conditions is matched if the match mode is or. If you do not configure match conditions, it indicates that the current SIP message matches successfully.
    • In non-regular expression match modes, the match object is a duplicate of the SIP message that is not processed by the SE2600.
    • In the regular expression match mode, the match object is a SIP message that is processed by the SE2600.
  4. The SE2600 checks whether the matching succeeds.
    • If the matching succeeds, the SE2600 performs the operation described in 5.
    • If the matching fails, the SE2600 performs the operation described in 7.
  5. The SE2600 checks whether a manipulation object is configured to determine whether to discard the SIP message.
    • If no manipulation object is configured and the action command is configured as delete, the SE2600 discards the SIP message. Then the header manipulation procedure is complete.
    • If a manipulation object is configured, the SE2600 performs the operation described in 6.
  6. The SE2600 performs SIP header manipulation according to the configured manipulation action.
    • delete: Deletes the object.
    • replace: Replaces the object with a new value.
    • insert: Inserts the new value into the object to be processed in messages.
    • transmit: Ensures that the object remains unchanged during the processing of packets.
    • convert: Changes the type of specified URI from SIP-URI to TEL-URI and vice versa.
    • save: saves the regular expression match result into a temporary variable.
  7. The SE2600 checks whether all rules in the header manipulation view have been traversed.
    • If all rules in the header manipulation view have been traversed, the SE2600 performs the operation described in 8.
    • If all rules in the header manipulation view have not been traversed, the SE2600 performs the operation described in 2, and then checks the next rule.
  8. Checks whether all the header manipulation views associated with the mapping group or IP trunk to which the SIP message belongs have been traversed.
    • Yes: The SE2600 forwards the SIP message. Then the header manipulation procedure is complete.
    • No: The SE2600 performs the operation described in 1, and then checks the next header manipulation view.