Configure a SIP Interface

Complete these tasks to configure the sip-interface element for two realms.

Table - Prerequisites

Prerequisite More Information
Authenticate Authenticate
Configure two physical interfaces for media traffic. Configure Physical Interfaces
Configure two network interfaces for media traffic. Configure Network Interfaces
Configure realms. Configure Realms

This example assumes you have exported the access token to the variable $TOKEN.

  1. Retrieve the sip-interface template with the sip-port sub-element.

    The template of a configuration element is a data structure containing all required sub-elements and supported attributes with their default values, along with any specified optional sub-elements.

    curl -X GET -o response.xml \
        --header "Accept: application/xml" \
        --header "Authorization: Bearer $TOKEN" \
        "https://10.0.0.2/rest/v1.1/configuration/elementTypes/template?elementType=sip-interface&subElement=sip-port"
    The response is saved to the file response.xml.
  2. Copy the content between the opening and closing <configElement> tags to two files called sip-interface-peer1.xml and sip-interface-core1.xml.

    If you are on a Linux system with xmllint installed, you may optionally format the XML before writing it to the file system.

    sed -n '/<configElement>/,/<\/configElement>/p' response.xml | xmllint --format - > sip-interface-peer1.xml
    sed -n '/<configElement>/,/<\/configElement>/p' response.xml | xmllint --format - > sip-interface-core1.xml
  3. Retreive the configuration element metadata to discover the range of values for each attribute.
    curl -X GET -o metadata.xml \
        --header "Accept: application/xml" \
        --header "Authorization: Bearer $TOKEN" \
        "https://10.0.0.2/rest/v1.1/configuration/elementTypes/metadata?elementType=sip-interface"
  4. Open both XML files and set the attributes to their desired values.

    Table - Parameters

    Parameter Description
    realm-id Enter the identifier of the realm you want to attach to this SIP interface.
    address In the sip-port sub-element, enter the IP address of the host associated with the sip-port entry on which to listen.

    Note:

    For additional parameters, see the ACLI Configuration Guide.

    The following example shows the full contents of the sip-interface-peer1.xml file.

    <?xml version="1.0"?>
    <configElement>
      <elementType>sip-interface</elementType>
      <attribute>
        <name>realm-id</name>
        <value>peer1</value>
      </attribute>
      <subElement>
        <subElementType>sip-port</subElementType>
        <attribute>
          <name>address</name>
          <value>192.168.1.101</value>
        </attribute>
      </subElement>
    </configElement>

    Note:

    Missing parameters assume the default values shown in the template.
  5. Acquire the configuration lock.
    curl -X POST \
        --header "Accept: application/xml" \
        --header "Authorization: Bearer $TOKEN" \
        "https://10.0.0.2/rest/v1.1/configuration/lock"
  6. Add both sip-interface configurations to the SBC.
    curl -X POST \
        -d@sip-interface-s0p0.xml \
        --header "Accept: application/xml" \
        --header "Authorization: Bearer $TOKEN" \
        "https://10.0.0.2/rest/v1.1/configuration/configElements"
    curl -X POST \
        -d@sip-interface-s0p1.xml \
        --header "Accept: application/xml" \
        --header "Authorization: Bearer $TOKEN" \
        "https://10.0.0.2/rest/v1.1/configuration/configElements"
  7. If done editing the configuration, save, verify, and activate the configuration.
  8. Release the configuration lock.
    curl -X POST \
        --header "Accept: application/xml" \
        --header "Authorization: Bearer $TOKEN" \
        "https://10.0.0.2/rest/v1.1/configuration/unlock"