This section discusses how to configure a B2BUA device to the WAN side of the system. Header manipulation rules are used to modify the headers required for interoperability to-and-from IP PBX and to-and-from the SIP trunking provider.

  1. Choose VoIP > SIP > B2BUA from the Configuration Menu on the left-hand side.

  2. Scroll down to Actions and add the actions mentioned in the following steps, and associated HMR rules.
  3. The first Actions is “FromServer”. This rule has an associated “Match” rule for calls going to the client.
    1. Configure the parameters in the actions pane.
    2. Configure each Header Value one at a time and click Add before creating the next rule.
    3. Click Update and then click Submit to save the action.

      Note

      In the example given in Configure the SBC for Microsoft Teams Direct Routing, the dialing code +1 is used in reference to the USA. Change it to the dialing code of the country of your choice. 

      Configuring the ToTeams Action

      ParameterExample Configuration Value
      Name

      FromServer

      Arbitrary name (alphanumeric characters only)
      Send ToTrunking DeviceNone
      PrioritizeDisabled
      Refer to Re-INVITEEnabled
      Serial HuntingNot used for MS Team
      E.164 Conversion ruleNone
      Conversion modeAdd (default)
      Header Manipulation RequestNone
      HeaderRequest-URI
      Value
                          Request-URI'sip:+1' + $to.uri.user + '@' + $env.target_domain + ':' + $env.target_port + ';user=phone'
                           From'<sip:+1' + $from.uri.user + '@' + $env.target_src_domain + ':' + $env.target_port + ' ;user=phone>'
                           To$to.dispname + '<sip:+1' + $to.uri.user + '@' + $env.target_domain + ':' + $env.target_port + ';user=phone>'
                            Contact'<sip:+1' + $from.uri.user + '@' + $env.target_src_domain + ':' + $env.out_intf_port + ';transport=TLS>' + $contact.parameter
      Message Translation
            Incoming message
                           Message type180 Ringing
                           SDP presencePresent
             Outgoing message
                           Message type180 Ringing
                           SDP presencePresent
                           Send messageYes

  4. The second action is FromClient2ServerAnonymous. This rule has an associated “Match” rule for calls with “Anonymous” in the SIP URI. For example, when a client caller is blocking their number, the SIP From URI will have the following format:
    From: "Anonymous"sip:anonymous@anonymous.invalid:5060.
    This rule allows anonymous calls inbound from IP PBX to the SIP trunking provider.

    To add a new action click anywhere in the New Entry bar.



    1. Configure the parameters in the actions pane.
    2. Configure each Header Value one at a time and click Add before creating the next rule.
    3. Click Update and then click Submit to save the action.

      Configuring the FromClient2ServerAnonymous Action

      ParameterExample Configuration Value
      Name

      FromClient2ServerAnonymous

      Arbitrary name (alphanumeric characters only)
      Send ToTrunking DeviceNone
      PrioritizeDisabled
      Refer to Re-INVITEEnabled
      Serial HuntingNot used for MS Teams
      E.164 Conversion ruleNone
      Conversion modeAdd (default)
      Header ManipulationsRequest (default)
      HeaderExample Value
      Request-URI'sip:' + substr($request.uri.user, 2, 0) + '@' + $env.available_domain + ':' + $env.available_port
      From$from.dispname + ' <sip:' + $from.uri.user + '@' + $env.out_intf_host + ':' + $env.out_intf_port + '>'
      To$to.dispname + ' <sip:' + substr($to.uri.user, 2, 0) + '@' + $env.available_domain + ':' + $env.available_port + '>'
      Contact$from.dispname + ' <sip:' + $from.uri.user + '@' + $env.out_intf_host + ':' + $env.out_intf_port + '>' + $contact.parameter
      P-Asserted-Identity$pai?'<sip:' + substr($pai, 7, 10) + '@' + $env.out_intf_host + ':' + $env.out_intf_port + '>'
      OtherPrivacy'id'
      ParameterExample configuration value
      Message Translation
            Incoming message
                           Message type180 Ringing
                           SDP presencePresent
             Outgoing message
                           Message type180 Ringing
                           SDP presencePresent
                           Send messageYes

      Note that all the values given above are samples. Change it according to your requirement.

  5. The third action is “ToServer”. This rule has an associated “Match” rule for calls outbound from the client to the SIP Trunking provider for destination call routing. This example uses a “P-Asserted-Identity” header string which is common to many SIP trunking providers. Please verify with your trunking provider if they require these SIP headers or have other header requirements for interoperability with their SIP service.
    To add a new action click anywhere in the New Entry bar.



    1. Configure the parameters in the actions pane.

    2. Configure each Header Value one at a time and click Add before creating the next rule.

    3. Click Update and then click Submit to save the action.


      Configuring the ToServer Action

      ParameterExample Configuration Value
      Name

      ToServer

      Arbitrary name (alphanumeric characters only)
      Send ToTrunking DeviceNone
      PrioritizeDisabled
      Refer to Re-INVITEEnabled
      Serial HuntingNot used for MS Teams
      E.164 Conversion ruleNone
      Conversion modeAdd (default)
      HeaderExample Value
      Request-URI'sip:' + substr($request.uri.user, 2, 0) + '@' + $env.available_domain + ':' + $env.available_port
      From$from.dispname + ' <sip:' + substr($from.uri.user, 2, 0) + '@' + $env.out_intf_host + ':' + $env.out_intf_port + '>'
      To$to.dispname + ' <sip:' + substr($to.uri.user, 2, 0) + '@' + $env.available_domain + ':' + $env.available_port + '>'
      Contact$from.dispname + ' <sip:' + substr($from.uri.user, 2, 0) + '@' + $env.out_intf_host + ':' + $env.out_intf_port + '>' + $contact.parameter
      P-Asserted-Identity$pai?'<sip:' + substr($pai, 7, 10) + '@' + $env.out_intf_host + ':' + $env.out_intf_port + '>'
      History-info$history-info?' <sip:' + replace($history-info.uri.user, '+1', '' ) + '@' + $env.out_intf_host + ':' + $env.out_intf_port + '>;reason=unknown;counter=1'
      History-info$history-info#1?' <sip:' + replace($history-info#1.uri.user, '+1', '' ) + '@' + $env.out_intf_host + ':' + $env.out_intf_port + '>;reason=unknown;counter=1'
      ParameterExample configuration value
      Message Translation
            Incoming message
                           Message type180 Ringing
                           SDP presencePresent
             Outgoing message
                           Message type180 Ringing
                           SDP presencePresent
                           Send messageYes

      Note that all the values given above are samples. Change it according to your requirement.

  6. Scroll down to the Match pane to configure the patterns you wish to match to the actions just created. The match function provides dial plan routing to Actions and relates to the direction the call is coming from. This could be from IP PBX or from the SIP trunking provider. The examples given in this section will use a dial plan of 408.555.1000-1099 to provide basic knowledge of how to apply your dial plan to the previously created Actions.
    The example uses an “Inbound” and "Outbound" rule to and from the server as “+1.”. By default, the client will add this to the beginning of every outbound call going to the SBC for SIP trunk routing. This rule is mapped to the Action.”ToServer” will remove the +1 from the SIP message and then perform the other header modifications before forwarding the SIP message to the trunking provider. If you’ve configured the client to not add the +1, then modify the “ToServer” Action and other header manipulation rules that reference +1 and remove the reference.
    The +1. (dot ) portion of the string matches one or more digits. This (dot) allows dialed destinations greater than 10 or 11 digits to be called. 

    Note

    Match rules are in order of priority from top to bottom. A specific rule must be above a generic rule.


    1. The first “Match” rule is for the IP PBX dial plan assigned by the SIP trunking provider. 

      1. Configure the parameters in the match pane.

      2. Click Update and then click Submit to save the Match.


        Configuring the Called Matches FromServer Match

        ParameterExample Configuration Value
        DirectionInbound
        ModeRemoteModeOnly
        DefaultDisabled
        PatternCalled
        Called PartyMatches408555.
        Calling PartyNot SetNA
        Privacy HdrMatchesNA
        Calling Display NameMatchesNA
        SourceAny
        ActionFromServer

    2. The second Match rule is to allow the blocked caller ID’s from the client, which presents as “anonymous” in the SIP header. For example,
      From: "Anonymous"sip:anonymous@anonymous.invalid:5060.
      To add a new action click anywhere in the New Entry bar.


      1. Configure the parameters in the match pane.

      2. Click Update and then click Submit to save the Match.

        Configuring the FromClient2ServerAnonymous Match

        ParameterExample Configuration Value
        DirectionRedirect
        ModeRemoteModeOnly
        DefaultNot used for MS Teams
        PatternBoth
        Called PartyMatches+1.
        Calling PartyDoes not match+1.
        SourceAny
        ActionFromClient2ServerAnonymous

    3. The third Match rule is to match +1. SIP messages from the client to the Actions that routes the call to the configured SIP trunking provider, after the header manipulation is performed. This rule is required for normal caller-ID routing.
      To add a new action click anywhere in the New Entry bar.


      1. Configure the parameters in the match pane.

      2. Click Update and then click Submit to save the Match.


        Configuring the ToServer Match

        ParameterExample Configuration Value
        DirectionOutbound
        ModeRemoteModeOnly
        DefaultDisabled
        PatternCalled
        Called PartyMatches+1.
        Calling PartyNot SetNA
        SourceAny
        ActionToServer

You have now completed the Ribbon Communications EdgeMarc configuration and are ready to start testing calls.

As a final step, save the configurations at this point or when you are finished testing.