In this section:

Overview

The SBC Core supports dialog stateful variables to allow storing values during SMM processing of messages, and then later using the same values for SMM processing of the other messages in the same dialog. The SBC supports dialog stateful variables for INVITE, REGISTER, and Out-of-Dialog SUBSCRIBE messages. The SBC also supports dialog stateful variables for Out-of-Dialog MESSAGE messages but only on the egress leg. That is, the dialog stateful variables for MESSAGE messages are created and accessed on the outgoing leg only. The values of stateful variables are preserved for the active dialogs. These values are accessible during the SMM rule processing on the subsequent messages.

IMPORTANT

Do not use SMM to manipulate To, From, Contact and Request URIs in incoming REGISTER messages.

Note
  • The dialog stateful variables do not support NOTIFY messages which are received prior to receiving the 200 OK response to the egress SUBSCRIBE.
  • For REGISTER messages, dialog stateful variables are accessible by refresh REGISTER requests but not by INVITE/SUBSCRIBE sent for a registered user. The refresh-REGISTERs are expected to have same call-id as that of initial REGISTER.
Note

The maximum supported size of data stored in a dialog stateful variable is 6 kB (6,144 bytes). The SBC ignores the data if the data size exceeds the size limit; no data is written in the variable.

Note

When dialog transparency is enabled and "Advanced SMM" functionality is required:

  • If both inputAdapterProfile and outputAdapterProfile are provisioned, enable the advancedSMM flag on both SIP Adapter Profiles (inputAdapterProfile and outputAdapterProfile).
  • If only one SIP Adaptor Profile is provisioned (either inputAdapterProfile or outputAdapterProfile), enable the advancedSMM flag only for the provisioned SIP Adaptor Profile. 

Example: How to Treat Hostpart Based on the Received Format

Overview

Use this SMM rule example to manipulate how to treat hostpart based on the received format.

  • SMM rule to make the hostpart of Request-URI From/To headers in IP Address format when the hostpart of the dialog initiating INVITE Request-URI is in IP Address format.

  • Alternatively, an SMM rule to make the hostpart of Request-URI From/To in FQDN format when the hostpart of the dialog initiating INVITE Request-URI is in FQDN format.

SMM Rule

  1. Create and apply an inputAdapterProfile for initial INVITE requests to an IP Trunk Group using the following rules: 
    1. If hostpart of Request-URI is an IP Address, store variable "var-x=1" (where x is any valid numeric number assigned to a variable) using "dialog" as the variableScopeValue. 
    2. If hostpart is not in IP Address format: var-1 is not created.

      SMM rule part 1
      # #################################################################################################################
      # Use the SMM rule achieve the following
      # Check whether initial incoming INVITE's (absent of tag parameter in the To header) hostname in Request Uri uses IP or FQDN format
      # store variable var-x (any available SMM variable) with variableScopeValue "Dialog" if hostname uses IP format
      ##################################################################################################################
      configure
      # Rule 1: Decide initial invite or not base on absent of ToTag
      set profiles signaling sipAdaptorProfile "ReplaceIpWithFqdnIn" rule "1" applyMatchHeader "one"
      
      set profiles signaling sipAdaptorProfile "ReplaceIpWithFqdnIn" rule "1" criterion "1" type "message"
      set profiles signaling sipAdaptorProfile "ReplaceIpWithFqdnIn" rule "1" criterion "1" message messageTypes "request" methodTypes "invite"
      
      set profiles signaling sipAdaptorProfile "ReplaceIpWithFqdnIn" rule "1" criterion "2" type "header"
      set profiles signaling sipAdaptorProfile "ReplaceIpWithFqdnIn" rule "1" criterion "2" header name "To" condition "exist" hdrInstance "all"
      
      set profiles signaling sipAdaptorProfile "ReplaceIpWithFqdnIn" rule "1" criterion "3" type "parameter"
      set profiles signaling sipAdaptorProfile "ReplaceIpWithFqdnIn" rule "1" criterion "3" parameter condition "absent" paramType "generic" name "tag"
      set profiles signaling sipAdaptorProfile "ReplaceIpWithFqdnIn" rule "1" action "1" type "variable" operation "store"
      set profiles signaling sipAdaptorProfile "ReplaceIpWithFqdnIn" rule "1" action "1" from type "value" value "initialInvite"
      set profiles signaling sipAdaptorProfile "ReplaceIpWithFqdnIn" rule "1" action "1" to type "variable" variableValue "var1" variableScopeValue "local"
      
      commit

       

      SMM rule part 2
       # Rule #2
      # Decide whether hostName of Request-line appears in IP format by matching regular expression
      # Store var2 with variableScopeValue "Dialog" if hostName appears in IP format and var1 exist (indicating initial Invite)
      
      set profiles signaling sipAdaptorProfile "ReplaceIpWithFqdnIn" rule "2" applyMatchHeader "one"
      set profiles signaling sipAdaptorProfile "ReplaceIpWithFqdnIn" rule "2" criterion "1" type "message"
      set profiles signaling sipAdaptorProfile "ReplaceIpWithFqdnIn" rule "2" criterion "1" message messageTypes "request" methodTypes "invite"
      
      set profiles signaling sipAdaptorProfile "ReplaceIpWithFqdnIn" rule "2" criterion "2" type "header"
      set profiles signaling sipAdaptorProfile "ReplaceIpWithFqdnIn" rule "2" criterion "2" header name "Request-Line" condition "exist" hdrInstance "one"
      set profiles signaling sipAdaptorProfile "ReplaceIpWithFqdnIn" rule "2" criterion "3" type "token"
      set profiles signaling sipAdaptorProfile "ReplaceIpWithFqdnIn" rule "2" criterion "3" token condition "regex-match" tokenType "urihostname"
      set profiles signaling sipAdaptorProfile "ReplaceIpWithFqdnIn" rule "2" criterion "3" token regexp string "(([0-9]{1,3}\.){3}[0-9]{1,3})"
      
      set profiles signaling sipAdaptorProfile "ReplaceIpWithFqdnIn" rule "2" criterion "4" type "variable"
      set profiles signaling sipAdaptorProfile "ReplaceIpWithFqdnIn" rule "2" criterion "4" variable condition "exist" variableID "var1"
      
      set profiles signaling sipAdaptorProfile "ReplaceIpWithFqdnIn" rule "2" action "1" type "variable" operation "store"
      set profiles signaling sipAdaptorProfile "ReplaceIpWithFqdnIn" rule "2" action "1" from type "value" value "hostNameInIpFormat"
      set profiles signaling sipAdaptorProfile "ReplaceIpWithFqdnIn" rule "2" action "1" to type "variable" variableValue "var2" variableScopeValue "dialog"
      commit


  2. Create and apply an outAdapterProfile to the IP Trunk Group with the following SMM rules to all outgoing request:
    1. If dialog state variable "var-x" exists, do not modify hostpart for Reqeust-URI/To/From (received value will be passed through).
    2. If dialog state variable "var-x" does not exist, modify hostpart for Request-URI/To/From with the desired FQDN.

      outAdapterProfile part 1
      #################################################################################################################
      # Use the SMM rule to achieve the following:
      # Replace hostname with FQDN in request-line, To Header, and FromHdr if dialog state variable var-x, e.g. var2 does NOT exist
      # Note: input sipAdaptorProfile would have store an value to dialog variable var-x, e.g. var2 if the hostname of initial incoming INVITE is in IP format
      ##################################################################################################################
      configure 
      # Rule 1
      # Replace hostname with FQDN in request-line if dialog state varialbe var2 does NOT exist
      
      set profiles signaling sipAdaptorProfile replaceIpWithFqdnOut rule 1 criterion 1 type message
      set profiles signaling sipAdaptorProfile replaceIpWithFqdnOut rule 1 criterion 1 message messageTypes requestAll
      
      set profiles signaling sipAdaptorProfile replaceIpWithFqdnOut rule 1 criterion 2 type header
      set profiles signaling sipAdaptorProfile replaceIpWithFqdnOut rule 1 criterion 2 header name request-line
      set profiles signaling sipAdaptorProfile replaceIpWithFqdnOut rule 1 criterion 2 header condition exist
      
      set profiles signaling sipAdaptorProfile replaceIpWithFqdnOut rule 1 criterion 3 type "variable"
      set profiles signaling sipAdaptorProfile replaceIpWithFqdnOut rule 1 criterion 3 variable condition "absent" variableID "var2"
      
      set profiles signaling sipAdaptorProfile replaceIpWithFqdnOut rule 1 action 1 type token
      set profiles signaling sipAdaptorProfile replaceIpWithFqdnOut rule 1 action 1 operation regsub
      set profiles signaling sipAdaptorProfile replaceIpWithFqdnOut rule 1 action 1 from type value
      set profiles signaling sipAdaptorProfile replaceIpWithFqdnOut rule 1 action 1 from value cae.ds.com
      set profiles signaling sipAdaptorProfile replaceIpWithFqdnOut rule 1 action 1 to type token
      set profiles signaling sipAdaptorProfile replaceIpWithFqdnOut rule 1 action 1 to tokenValue urihostname
      set profiles signaling sipAdaptorProfile replaceIpWithFqdnOut rule 1 action 1 regexp string .*
      set profiles signaling sipAdaptorProfile replaceIpWithFqdnOut rule 1 action 1 regexp matchInstance all
      commit
      outAdapterProfile part 2
       # Rule 2
      # Replace hostname with FQDN in To Header if dialog state varialbe VAR2 does NOT exist
      
      set profiles signaling sipAdaptorProfile replaceIpWithFqdnOut rule 2 criterion 1 type message
      set profiles signaling sipAdaptorProfile replaceIpWithFqdnOut rule 2 criterion 1 message messageTypes requestAll
      
      set profiles signaling sipAdaptorProfile replaceIpWithFqdnOut rule 2 criterion 2 type header
      set profiles signaling sipAdaptorProfile replaceIpWithFqdnOut rule 2 criterion 2 header name To
      set profiles signaling sipAdaptorProfile replaceIpWithFqdnOut rule 2 criterion 2 header condition exist
      
      set profiles signaling sipAdaptorProfile replaceIpWithFqdnOut rule 2 criterion 3 type "variable"
      set profiles signaling sipAdaptorProfile replaceIpWithFqdnOut rule 2 criterion 3 variable condition "absent" variableID "var2"
      
      set profiles signaling sipAdaptorProfile replaceIpWithFqdnOut rule 2 action 1 type token
      set profiles signaling sipAdaptorProfile replaceIpWithFqdnOut rule 2 action 1 operation regsub
      set profiles signaling sipAdaptorProfile replaceIpWithFqdnOut rule 2 action 1 from type value
      set profiles signaling sipAdaptorProfile replaceIpWithFqdnOut rule 2 action 1 from value cae.ds.com
      set profiles signaling sipAdaptorProfile replaceIpWithFqdnOut rule 2 action 1 to type token
      set profiles signaling sipAdaptorProfile replaceIpWithFqdnOut rule 2 action 1 to tokenValue urihostname
      set profiles signaling sipAdaptorProfile replaceIpWithFqdnOut rule 2 action 1 regexp string .*
      set profiles signaling sipAdaptorProfile replaceIpWithFqdnOut rule 2 action 1 regexp matchInstance all
      commit
      outAdapterProfile part 3
       # Rule 2
      # Replace hostname with FQDN in From header if dialog state varialbe VAR2 does NOT exist
      
      set profiles signaling sipAdaptorProfile replaceIpWithFqdnOut rule 3 criterion 1 type message
      set profiles signaling sipAdaptorProfile replaceIpWithFqdnOut rule 3 criterion 1 message messageTypes requestAll
      
      set profiles signaling sipAdaptorProfile replaceIpWithFqdnOut rule 3 criterion 2 type header
      set profiles signaling sipAdaptorProfile replaceIpWithFqdnOut rule 3 criterion 2 header name From
      set profiles signaling sipAdaptorProfile replaceIpWithFqdnOut rule 3 criterion 2 header condition exist
      
      set profiles signaling sipAdaptorProfile replaceIpWithFqdnOut rule 3 criterion 3 type "variable"
      set profiles signaling sipAdaptorProfile replaceIpWithFqdnOut rule 3 criterion 3 variable condition "absent" variableID "var2"
      
      set profiles signaling sipAdaptorProfile replaceIpWithFqdnOut rule 3 action 1 type token
      set profiles signaling sipAdaptorProfile replaceIpWithFqdnOut rule 3 action 1 operation regsub
      set profiles signaling sipAdaptorProfile replaceIpWithFqdnOut rule 3 action 1 from type value
      set profiles signaling sipAdaptorProfile replaceIpWithFqdnOut rule 3 action 1 from value cae.ds.com
      set profiles signaling sipAdaptorProfile replaceIpWithFqdnOut rule 3 action 1 to type token
      set profiles signaling sipAdaptorProfile replaceIpWithFqdnOut rule 3 action 1 to tokenValue urihostname
      set profiles signaling sipAdaptorProfile replaceIpWithFqdnOut rule 3 action 1 regexp string .*
      set profiles signaling sipAdaptorProfile replaceIpWithFqdnOut rule 3 action 1 regexp matchInstance all
      commit
  3. Enable "advancedSMM" for both the input and output SMM profile.

    set profiles signaling sipAdaptorProfile smmProfileName advancedSMM enabled
    commit


Refer to SIP Adaptor Profile - CLI for command line details.