Overview

You can configure an SBC using the provided RESTCONF API interface with the XML.

Copy the files mentioned after the "@" in the cURL commands and run these cURL commands in the same folder as the XML files or mention the complete path for the XML files. If you saved the XML files on the SBC, replace to <SBC_MGT_IP> with local address.

Use the following example configurations to configure the SBC for a basic A-B call using RESTCONF API.


Steps:



Start

  1. Create a codec entry

    cat codecEntryXml
    <codecEntry>
    <name>G711</name>
    <codec>g711</codec>
    <packetSizeG711>10</packetSizeG711>
    </codecEntry>

    curl -kisu 'admin:<Password>' -H "Accept: application/yang-data+xml" -H "Content-Type: application/yang-data+xml" -X POST -d @codecEntryXml "https://<SBC_MGT_IP>/restconf/data/sonusGen2Profiles:profiles/media"


  2. Create Packet Service Profiles

    cat packetServiceProfileXml
    <packetServiceProfile>
    <name>G711</name>
    <codec>
    <codecEntry1>G711</codecEntry1>
    </codec>
    </packetServiceProfile>

    curl -kisu 'admin:<Password>' -H "Accept: application/yang-data+xml" -H "Content-Type: application/yang-data+xml" -X POST -d @packetServiceProfileXml "https://<SBC_MGT_IP>/restconf/data/sonusGen2Profiles:profiles/media"


  3. Create Address Context

    cat ADDR_CNTXTXml
    <addressContext>
    <name>ADDR_CONTEXT1</name>
    </addressContext>

    curl -kisu 'admin:<Password>' -H "Accept: application/yang-data+xml" -H "Content-Type: application/yang-data+xml" -X POST -d @ADDR_CNTXTXml "https://<SBC_MGT_IP>/restconf/data"


  4. Create Zones

    cat zone_1
    <zone>
    <name>ZONE9</name>
    <id>109</id>
    </zone>

    curl -kisu 'admin:<Password>' -H "Accept: application/yang-data+xml" -H "Content-Type: application/yang-data+xml" -X POST -d @zone_1 "https://<SBC_MGT_IP>/restconf/data/sonusAddressContext:addressContext=ADDR_CONTEXT1"


    cat zone_2
    <zone>
    <name>ZONE10</name>
    <id>204</id>
    </zone>

    curl -kisu 'admin:<Password>' -H "Accept: application/yang-data+xml" -H "Content-Type: application/yang-data+xml" -X POST -d @zone_2 "https://<SBC_MGT_IP>/restconf/data/sonusAddressContext:addressContext=ADDR_CONTEXT1"


  5. Create IP Interface Groups

    cat ipInterfaceGroup_1_xml
    <ipInterfaceGroup>
    <name>LIG9</name>
    </ipInterfaceGroup>

    curl -kisu 'admin:<Password>' -H "Accept: application/yang-data+xml" -H "Content-Type: application/yang-data+xml" -X POST -d @ipInterfaceGroup_1_xml "https://<SBC_MGT_IP>/restconf/data/sonusAddressContext:addressContext=ADDR_CONTEXT1"


    cat ipInterfaceGroup_2_xml
    <ipInterfaceGroup>
    <name>LIG10</name>
    </ipInterfaceGroup>

    curl -kisu 'admin:<Password>' -H "Accept: application/yang-data+xml" -H "Content-Type: application/yang-data+xml" -X POST -d @ipInterfaceGroup_2_xml "https://<SBC_MGT_IP>/restconf/data/sonusAddressContext:addressContext=ADDR_CONTEXT1"


  6. Create IP interfaces

    cat ipInterface_1_xml
    <ipInterface>
    <name>LIF9</name>
    <ceName>vsbc1</ceName>
    <portName>pkt0</portName>
    <ipVarV4>IF2.IPV4</ipVarV4>
    <prefixVarV4>IF2.PrefixV4</prefixVarV4>
    <mode>inService</mode>
    <state>enabled</state>
    </ipInterface>

    curl -kisu 'admin:<Password>' -H "Accept: application/yang-data+xml" -H "Content-Type: application/yang-data+xml" -X POST -d @ipInterface_1_xml "https://<SBC_MGT_IP>/restconf/data/sonusAddressContext:addressContext=ADDR_CONTEXT1/sonusIpInterface:ipInterfaceGroup=LIG9"


    cat ipInterface_2_xml
    <ipInterface>
    <name>LIF10</name>
    <ceName>vsbc1</ceName>
    <portName>pkt1</portName>
    <ipVarV4>IF3.IPV4</ipVarV4>
    <prefixVarV4>IF3.PrefixV4</prefixVarV4>
    <mode>inService</mode>
    <state>enabled</state>
    </ipInterface>

    curl -kisu 'admin:<Password>' -H "Accept: application/yang-data+xml" -H "Content-Type: application/yang-data+xml" -X POST -d @ipInterface_2_xml "https://<SBC_MGT_IP>/restconf/data/sonusAddressContext:addressContext=ADDR_CONTEXT1/sonusIpInterface:ipInterfaceGroup=LIG10"


  7. Create static routes

    cat staticRoute_1_xml
    <staticRoute>
    <destinationIpAddress>0.0.0.0</destinationIpAddress>
    <prefix>0</prefix>
    <nextHop>172.31.12.1</nextHop>
    <ipInterfaceGroupName>LIG9</ipInterfaceGroupName>
    <ipInterfaceName>LIF9</ipInterfaceName>
    <preference>100</preference>
    </staticRoute>

    curl -kisu 'admin:<Password>' -H "Accept: application/yang-data+xml" -H "Content-Type: application/yang-data+xml" -X POST -d @staticRoute_1_xml "https://<SBC_MGT_IP>/restconf/data/sonusAddressContext:addressContext=ADDR_CONTEXT1"


    cat staticRoute_2_xml
    <staticRoute>
    <destinationIpAddress>0.0.0.0</destinationIpAddress>
    <prefix>0</prefix>
    <nextHop>172.31.13.1</nextHop>
    <ipInterfaceGroupName>LIG10</ipInterfaceGroupName>
    <ipInterfaceName>LIF10</ipInterfaceName>
    <preference>100</preference>
    </staticRoute>
    curl -kisu 'admin:<Password>' -H "Accept: application/yang-data+xml" -H "Content-Type: application/yang-data+xml" -X POST -d @staticRoute_2_xml "https://<SBC_MGT_IP>/restconf/data/sonusAddressContext:addressContext=ADDR_CONTEXT1"


  8. Create IP Peer

    cat ipPeer_1_xml
    <ipPeer>
    <name>PEER1</name>
    <ipAddress>172.31.12.202</ipAddress>
    <ipPort>9884</ipPort>
    </ipPeer>

    curl -kisu 'admin:<Password>' -H "Accept: application/yang-data+xml" -H "Content-Type: application/yang-data+xml" -X POST -d @ipPeer_1_xml "https://<SBC_MGT_IP>/restconf/data/sonusAddressContext:addressContext=ADDR_CONTEXT1/sonusZone:zone=ZONE9"

    cat ipPeer_2_xml
    <ipPeer>
    <name>PEER2</name>
    <ipAddress>172.31.13.202</ipAddress>
    <ipPort>9884</ipPort>
    </ipPeer>

    curl -kisu 'admin:<Password>' -H "Accept: application/yang-data+xml" -H "Content-Type: application/yang-data+xml" -X POST -d @ipPeer_2_xml "https://<SBC_MGT_IP>/restconf/data/sonusAddressContext:addressContext=ADDR_CONTEXT1/sonusZone:zone=ZONE10"


  9. Create SIP Trunk Groups

    cat sipSigPort_1_xml
    <sipSigPort>
    <index>9</index>
    <ipInterfaceGroupName>LIG9</ipInterfaceGroupName>
    <ipVarV4>IF2.IPV4</ipVarV4>
    <portNumber>5060</portNumber>
    <mode>inService</mode>
    <state>enabled</state>
    </sipSigPort>

    curl -kisu 'admin:<Password>' -H "Accept: application/yang-data+xml" -H "Content-Type: application/yang-data+xml" -X POST -d @sipSigPort_1_xml "https://<SBC_MGT_IP>/restconf/data/sonusAddressContext:addressContext=ADDR_CONTEXT1/sonusZone:zone=ZONE9"


    cat sipSigPort_2_xml
    <sipSigPort>
    <index>10</index>
    <ipInterfaceGroupName>LIG10</ipInterfaceGroupName>
    <ipVarV4>IF3.IPV4</ipVarV4>
    <portNumber>5060</portNumber>
    <mode>inService</mode>
    <state>enabled</state>
    </sipSigPort>


    curl -kisu 'admin:<Password>' -H "Accept: application/yang-data+xml" -H "Content-Type: application/yang-data+xml" -X POST -d @sipSigPort_2_xml "https://<SBC_MGT_IP>/restconf/data/sonusAddressContext:addressContext=ADDR_CONTEXT1/sonusZone:zone=ZONE10"


  10. Create SIP Signaling Ports

    cat sipTrunkGroup_1_xml
    <sipTrunkGroup>
    <name>INGRESS_TG</name>
    <state>enabled</state>
    <mode>inService</mode>
    <policy>
    <media>
    <packetServiceProfile>G711</packetServiceProfile>
    </media>
    </policy>
    <media>
    <mediaIpInterfaceGroupName>LIG9</mediaIpInterfaceGroupName>
    </media>
    <ingressIpPrefix>
    <ipAddress>172.31.12.174</ipAddress>
    <prefixLength>32</prefixLength>
    </ingressIpPrefix>
    </sipTrunkGroup>

    curl -kisu 'admin:<Password>' -H "Accept: application/yang-data+xml" -H "Content-Type: application/yang-data+xml" -X POST -d @sipTrunkGroup_1_xml "https://<SBC_MGT_IP>/restconf/data/sonusAddressContext:addressContext=ADDR_CONTEXT1/sonusZone:zone=ZONE9"


    cat sipTrunkGroup_2_xml
    <sipTrunkGroup>
    <name>EGRESS_TG</name>
    <state>enabled</state>
    <mode>inService</mode>
    <policy>
    <media>
    <packetServiceProfile>G711</packetServiceProfile>
    </media>
    </policy>
    <media>
    <mediaIpInterfaceGroupName>LIG10</mediaIpInterfaceGroupName>
    </media>
    </sipTrunkGroup>

    curl -kisu 'admin:<Password>' -H "Accept: application/yang-data+xml" -H "Content-Type: application/yang-data+xml" -X POST -d @sipTrunkGroup_2_xml "https://<SBC_MGT_IP>/restconf/data/sonusAddressContext:addressContext=ADDR_CONTEXT1/sonusZone:zone=ZONE10"


  11. Create standard routes and routing labels

    cat routingLabel_1_xml
    <routingLabel>
    <name>VRF_RL_EG</name>
    </routingLabel>

    curl -kisu 'admin:<Password>'  -H "Accept: application/yang-data+xml" -H "Content-Type: application/yang-data+xml" -X POST -d @routingLabel_1_xml  "https://<SBC_MGT_IP>/restconf/data/sonusGlobal:global/callRouting"


    cat routingLabelRoute_1_xml
    <routingLabelRoute>
    <sequence>0</sequence>
    <routeType>trunkGroup</routeType>
    <trunkGroup>EGRESS_TG</trunkGroup>
    <ipPeer>PEER2</ipPeer>
    <proportion>0</proportion>
    <cost>1000000</cost>
    <inService>inService</inService>
    <testing>normal</testing>
    </routingLabelRoute>

    curl -kisu 'admin:<Password>' -H "Accept: application/yang-data+xml" -H "Content-Type: application/yang-data+xml" -X POST -d @routingLabelRoute_1_xml "https://<SBC_MGT_IP>/restconf/data/sonusGlobal:global/callRouting/sonusRoutingLabel:routingLabel=VRF_RL_EG"

    cat route_1_xml
    <route>
    <elementType>trunkGroup</elementType>
    <elementId1>INGRESS_TG</elementId1>
    <elementId2>VSBCSYSTEM</elementId2>
    <routingType>standard</routingType>
    <destinationNational>Sonus_NULL</destinationNational>
    <destinationCountry>1</destinationCountry>
    <callType>all</callType>
    <digitType>all</digitType>
    <timeRangeProfile>ALL</timeRangeProfile>
    <callParameterFilterProfile>none</callParameterFilterProfile>
    <domainName>Sonus_NULL</domainName>
    <routingLabel>VRF_RL_EG</routingLabel>
    </route>

    curl -kisu 'admin:<Password>'  -H "Accept: application/yang-data+xml" -H "Content-Type: application/yang-data+xml" -X POST -d @route_1_xml  "https://<SBC_MGT_IP>/restconf/data/sonusGlobal:global/callRouting/"