Overview

You can configure an SBC using the provided example RESTCONF API configurating using the JSON payload.

Copy the JSON files mentioned after the "@" in the cURL commands and run these cURL commands in the same folder as the JSON files or mention the complete path for the JSON files.

If you saved the JSON files on the SBC, replace to <SBC_MGT_IP> with local address.


Steps:



Start

  1. Create a codec entry

    {"sonusCodecEntry:codecEntry":{
    "name":"G711DSP",
    "codec":"g711",
    "packetSizeG711":10
    }}

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


  2. Create Packet Service Profiles

    [root@ip-172-31-10-46 REST_JSON]# cat packetServiceProfile
    {
        "sonusPacketServiceProfile:packetServiceProfile": [
          {
            "name": "PSP3",
            "codec": {
              "codecEntry1": "G711-DEFAULT"
            }
              }
        ]
    }

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


  3. Create Address Context

    [root@ip-172-31-10-46 REST_JSON]# cat ADDR_CNTXT
    {
            "sonusAddressContext:addressContext": [{
                    "name": "ADDR_CONTEXT"
            }]
    }

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


  4. Create Zones

    cat ZONE1
    {
    "sonusZone:zone": [
    {
    "name": "ZONE7",
    "id": "104"
    }]
    }

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


    cat ZONE2
    {
    "sonusZone:zone": [
    {
    "name": "ZONE8",
    "id": "105"
    }]
    }

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


  5. Create IP Interface Groups

    [root@ip-172-31-10-46 REST_JSON]# cat ipInterfaceGroup_1
    {
        "sonusIpInterface:ipInterfaceGroup": [
          {
            "name": "INGRESS_LIG"
          }
        ]
    }

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


    [root@ip-172-31-10-46 REST_JSON]# cat ipInterfaceGroup_2
    {
        "sonusIpInterface:ipInterfaceGroup": [
          {
            "name": "EGRESS_LIG"
          }
        ]
    }

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


  6. Create IP interfaces

    [root@ip-172-31-10-46 REST_JSON]# cat ipInterface_IN
    {
        "sonusIpInterface:ipInterface": [
          {
            "name": "LIF_IN",
                    "ceName":"vsbc1",
                    "portName":"pkt0",
                    "ipVarV4":"IF2.IPV4",
                    "prefixVarV4":"IF2.PrefixV4",
                    "mode":"inService",
                    "state":"enabled"
          }
        ]
    }

    curl -kisu 'admin:<Password>' -H "Accept: application/yang-data+json" -H "Content-Type: application/yang-data+json" -X POST -d @ipInterface_IN "https://<SBC_MGT_IP>/restconf/data/sonusAddressContext:addressContext=ADDR_CONTEXT/sonusIpInterface:ipInterfaceGroup=INGRESS_LIG"


    [root@ip-172-31-10-46 REST_JSON]# cat ipInterface_OUT
    {
        "sonusIpInterface:ipInterface": [
          {
            "name": "LIF_OUT",
                    "ceName":"vsbc1",
                    "portName":"pkt1",
                    "ipVarV4":"IF3.IPV4",
                    "prefixVarV4":"IF3.PrefixV4",
                    "mode":"inService",
                    "state":"enabled"
          }
        ]
    }

    curl -kisu 'admin:<Password>' -H "Accept: application/yang-data+json" -H "Content-Type: application/yang-data+json" -X POST -d @ipInterface_OUT "https://<SBC_MGT_IP>/restconf/data/sonusAddressContext:addressContext=ADDR_CONTEXT/sonusIpInterface:ipInterfaceGroup=EGRESS_LIG"


    To configure the public or EIP to the interfaces , add the "ipPublicVarV4": <MetaVariable> in the JSON file.



  7. Create static routes

    [root@ip-172-31-10-46 REST_JSON]# cat staticRoute_2
    {
    "sonusIpInterface:staticRoute": [
          {
                    "destinationIpAddress":"0.0.0.0",
                    "prefix":"0",
                    "nextHop":"172.31.13.1",
                    "ipInterfaceGroupName":"EGRESS_LIG",
                    "ipInterfaceName":"LIF_OUT",
                    "preference":"100"
          }
        ]
    }

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


    [root@ip-172-31-10-46 REST_JSON]# cat staticRoute_1
    {
    "sonusIpInterface:staticRoute": [
          {
                    "destinationIpAddress":"0.0.0.0",
                    "prefix":"0",
                    "nextHop":"172.31.12.1",
                    "ipInterfaceGroupName":"INGRESS_LIG",
                    "ipInterfaceName":"LIF_IN",
                    "preference":"100"
          }
        ]
    }
    curl -kisu 'admin:<Password>' -H "Accept: application/yang-data+json" -H "Content-Type: application/yang-data+json" -X POST -d @staticRoute_1 "https://<SBC_MGT_IP>/restconf/data/sonusAddressContext:addressContext=ADDR_CONTEXT"


  8. Create IP Peer

    [root@ip-172-31-10-46 REST_JSON]# cat ipPeer_2
    {
    "sonusIpPeer:ipPeer": [
          {
                    "name":"EGRESS_PEER",
                    "ipAddress":"172.31.13.202",
                    "ipPort":"9884"
          }
        ]
    }

    curl -kisu 'admin:<Password>' -H "Accept: application/yang-data+json" -H "Content-Type: application/yang-data+json" -X POST -d @ipPeer_2 "https://<SBC_MGT_IP>/restconf/data/sonusAddressContext:addressContext=ADDR_CONTEXT/sonusZone:zone=ZONE8"


  9. Create SIP Trunk Groups

    [root@ip-172-31-10-46 REST_JSON]# cat sipTrunkGroup_1
    {
      "sonusSipTrunkGroup:sipTrunkGroup": {
        "name": "INGRESS_TRGP",
        "state": "enabled",
        "mode": "inService",
        "policy": {
          "media": {
            "packetServiceProfile": "PSP3"
          },
          "signaling": {
            "ipSignalingProfile": "DEFAULT_SIP"
          }
        },
        "media": {
          "mediaIpInterfaceGroupName": "INGRESS_LIG"
        },
        "ingressIpPrefix": [
          {
            "ipAddress": "172.31.12.174",
            "prefixLength": 32
          }
        ]
      }
    }

    curl -kisu 'admin:<Password>' -H "Accept: application/yang-data+json" -H "Content-Type: application/yang-data+json" -X POST -d @sipTrunkGroup_1 "https://<SBC_MGT_IP>/restconf/data/sonusAddressContext:addressContext=ADDR_CONTEXT/sonusZone:zone=ZONE7"


    [root@ip-172-31-10-46 REST_JSON]# cat sipTrunkGroup_2
    {
      "sonusSipTrunkGroup:sipTrunkGroup": {
        "name": "EGRESS_TRGP",
        "state": "enabled",
        "mode": "inService",
        "policy": {
          "media": {
            "packetServiceProfile": "PSP3"
          },
          "signaling": {
            "ipSignalingProfile": "DEFAULT_SIP"
          }
        },
        "media": {
          "mediaIpInterfaceGroupName": "EGRESS_LIG"
        }
      }
    }

    curl -kisu 'admin:<Password>' -H "Accept: application/yang-data+json" -H "Content-Type: application/yang-data+json" -X POST -d @sipTrunkGroup_2 "https://<SBC_MGT_IP>/restconf/data/sonusAddressContext:addressContext=ADDR_CONTEXT/sonusZone:zone=ZONE8"


  10. Create SIP Signaling Ports

    [root@ip-172-31-10-46 REST_JSON]# cat sipSigPort_1
    {
        "sonusSipSigPort:sipSigPort": [
          {
            "index": 7,
            "ipInterfaceGroupName": "INGRESS_LIG",
            "portNumber": 5060,
            "mode": "inService",
            "state": "enabled",
            "ipVarV4": "IF2.IPV4"
          }
        ]
    }

    curl -kisu 'admin:<Password>' -H "Accept: application/yang-data+json" -H "Content-Type: application/yang-data+json" -X POST -d @sipSigPort_1 "https://<SBC_MGT_IP>/restconf/data/sonusAddressContext:addressContext=ADDR_CONTEXT/sonusZone:zone=ZONE7"


    [root@ip-172-31-10-46 REST_JSON]# cat sipSigPort_2
    {
        "sonusSipSigPort:sipSigPort": [
          {
            "index": 8,
            "ipInterfaceGroupName": "EGRESS_LIG",
            "portNumber": 5060,
            "mode": "inService",
            "state": "enabled",
            "ipVarV4": "IF3.IPV4"
          }
        ]
    }

    curl -kisu 'admin:<Password>' -H "Accept: application/yang-data+json" -H "Content-Type: application/yang-data+json" -X POST -d @sipSigPort_2 "https://<SBC_MGT_IP>/restconf/data/sonusAddressContext:addressContext=ADDR_CONTEXT/sonusZone:zone=ZONE8"


    To configure the public or EIP to the interfaces , add the "ipPublicVarV4": <MetaVariable> in the JSON file



  11. Create standard routes and routing labels

    [root@ip-172-31-10-46 REST_JSON]# cat routingLabel_1
    {
      "sonusRoutingLabel:routingLabel": {
        "name": "VRF_RL_EG"
          }
    }

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


    cat routingLabelRoute_1
    {
        "routingLabelRoute": [
          {
            "sequence": "0",
                    "routeType":"trunkGroup",
                    "trunkGroup":"EGRESS_TRGP",
                    "ipPeer":"EGRESS_PEER",
                    "proportion":"0",
                    "cost":"1000000",
                    "inService":"inService",
                    "testing":"normal"
          }
        ]
    }

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


    cat route_1
    {
        "sonusRoute:route": [
        {
            "elementType": "trunkGroup",
            "elementId1": "INGRESS_TRGP",
            "elementId2": "VSBCSYSTEM",
            "routingType": "standard",
            "destinationNational": "Sonus_NULL",
            "destinationCountry": "1",
            "callType": "all",
            "digitType": "all",
            "timeRangeProfile": "ALL",
            "callParameterFilterProfile": "none",
            "domainName": "Sonus_NULL",
            "routingLabel":"VRF_RL_EG"
        }
      ]
    }
    


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

    You can also have Trunk Group-based routing in lieu of Number-based routing:

    [root@ip-172-31-10-46 ARJUN_REST_JSON]# cat route_1_TG
    {
        "sonusRoute:route": [
    {
    "elementType": "trunkGroup",
    "elementId1": "INGRESS_TRGP",
    "elementId2": "VSBCSYSTEM",
    "routingType": "standard",
    "destinationNational": "Sonus_NULL",
    "destinationCountry": "1",
    "callType": "all",
    "digitType": "all",
    "timeRangeProfile": "ALL",
    "callParameterFilterProfile": "none",
    "domainName": "Sonus_NULL",
    "routingLabel":"VRF_RL_EG"
    }