An SBC can be configured using the provided REST interface.
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
Code Block |
---|
{"sonusCodecEntry:codecEntry":{ "name":"G711DSP", "codec":"g711", "packetSizeG711":10 }} |
curl -kisu 'admin:Sonus@123' -H "Accept: application/vnd.yang.data+json" -H "Content-Type: application/vnd.yang.data+json" -X POST -d @codecEntryJson "https://<SBC_MGT_IP>/api/config/profiles/media"
2. Creating Packet service profiles :-
Code Block |
---|
[root@ip-172-31-10-46 ARJUN_REST_JSON]# cat packetServiceProfile { "sonusPacketServiceProfile:packetServiceProfile": [ { "name": "PSP3", "codec": { "codecEntry1": "G711-DEFAULT" } } ] } |
curl -kisu 'admin:Sonus@123' -H "Accept: application/vnd.yang.data+json" -H "Content-Type: application/vnd.yang.data+json" -X POST -d @packetServiceProfile "https://<SBC_MGT_IP>/api/config/profiles/media"
3.Creating Address contexts :-
Code Block |
---|
[root@ip-172-31-10-46 ARJUN_REST_JSON]# cat ADDR_CNTXT { "sonusAddressContext:addressContext": [{ "name": "ADDR_CONTEXT" }] } |
curl -kisu 'admin:Sonus@123' -H "Accept: application/vnd.yang.data+json" -H "Content-Type: application/vnd.yang.data+json" -X POST -d @ADDR_CNTXT "https://<SBC_MGT_IP>/api/config"
4.Creating Zones :-
Code Block |
---|
{ "sonusZone:zone": [ { "name": "ZONE7", "id": "104" }] } |
curl -kisu 'admin:Sonus@123' -H "Accept: application/vnd.yang.data+json" -H "Content-Type: application/vnd.yang.data+json" -X POST -d @ZONE1 "https://<SBC_MGT_IP>/api/config/addressContext/ADDR_CONTEXT"
Code Block |
---|
[root@ip-172-31-10-46 ARJUN_REST_JSON]# cat ZONE2 { "sonusZone:zone": [ { "name": "ZONE8", "id": "105" }] } |
curl -kisu 'admin:Sonus@123' -H "Accept: application/vnd.yang.data+json" -H "Content-Type: application/vnd.yang.data+json" -X POST -d @ZONE2 "https://<SBC_MGT_IP>/api/config/addressContext/ADDR_CONTEXT"
5.Creating IP interface groups :-
Code Block |
---|
[root@ip-172-31-10-46 ARJUN_REST_JSON]# cat ipInterfaceGroup_1 { "sonusIpInterface:ipInterfaceGroup": [ { "name": "INGRESS_LIG" } ] } |
curl -kisu 'admin:Sonus@123' -H "Accept: application/vnd.yang.data+json" -H "Content-Type: application/vnd.yang.data+json" -X POST -d @ipInterfaceGroup_1 "https://<SBC_MGT_IP>/api/config/addressContext/ADDR_CONTEXT"
Code Block |
---|
[root@ip-172-31-10-46 ARJUN_REST_JSON]# cat ipInterfaceGroup_2 { "sonusIpInterface:ipInterfaceGroup": [ { "name": "EGRESS_LIG" } ] } |
curl -kisu 'admin:Sonus@123' -H "Accept: application/vnd.yang.data+json" -H "Content-Type: application/vnd.yang.data+json" -X POST -d @ipInterfaceGroup_2 "https://<SBC_MGT_IP>/api/config/addressContext/ADDR_CONTEXT"
6. Creating IP interface :-
Code Block |
---|
[root@ip-172-31-10-46 ARJUN_REST_JSON]# cat ipInterface_IN { "sonusIpInterface:ipInterface": [ { "name": "LIF_IN", "ceName":"vsbc1", "portName":"pkt0", "ipVarV4":"IF2.IPV4", "prefixVarV4":"IF2.PrefixV4", "mode":"inService", "state":"enabled" } ] } |
Note |
---|
To configure the public or EIP to the interfaces , add the "ipPublicVarV4": <MetaVariable> in the JSON file |
curl -kisu 'admin:Sonus@123' -H "Accept: application/vnd.yang.data+json" -H "Content-Type: application/vnd.yang.data+json" -X POST -d @ipInterface_IN "https://<SBC_MGT_IP>/api/config/addressContext/ADDR_CONTEXT/ipInterfaceGroup/INGRESS_LIG"
Code Block |
---|
[root@ip-172-31-10-46 ARJUN_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:Sonus@123' -H "Accept: application/vnd.yang.data+json" -H "Content-Type: application/vnd.yang.data+json" -X POST -d @ipInterface_OUT "https://<SBC_MGT_IP>/api/config/addressContext/ADDR_CONTEXT/ipInterfaceGroup/EGRESS_LIG"
Note |
---|
To configure the public or EIP to the interfaces , add the "ipPublicVarV4": <MetaVariable> in the JSON file |
7. Creating Static routes :-
Code Block |
---|
[root@ip-172-31-10-46 ARJUN_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:Sonus@123' -H "Accept: application/vnd.yang.data+json" -H "Content-Type: application/vnd.yang.data+json" -X POST -d @staticRoute_2 "https://<SBC_MGT_IP>/api/config/addressContext/ADDR_CONTEXT"
Code Block |
---|
[root@ip-172-31-10-46 ARJUN_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:Sonus@123' -H "Accept: application/vnd.yang.data+json" -H "Content-Type: application/vnd.yang.data+json" -X POST -d @staticRoute_1 "https://<SBC_MGT_IP>/api/config/addressContext/ADDR_CONTEXT"
8. Creating IP Peer :-
Code Block |
---|
[root@ip-172-31-10-46 ARJUN_REST_JSON]# cat ipPeer_2 { "sonusIpPeer:ipPeer": [ { "name":"EGRESS_PEER", "ipAddress":"172.31.13.202", "ipPort":"9884" } ] } |
curl -kisu 'admin:Sonus@123' -H "Accept: application/vnd.yang.data+json" -H "Content-Type: application/vnd.yang.data+json" -X POST -d @ipPeer_2 "https://<SBC_MGT_IP>/api/config/addressContext/ADDR_CONTEXT/zone/ZONE8"
9. Creating SIP Trunk groups :-
Code Block |
---|
[root@ip-172-31-10-46 ARJUN_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:Sonus@123' -H "Accept: application/vnd.yang.data+json" -H "Content-Type: application/vnd.yang.data+json" -X POST -d @sipTrunkGroup_1 "https://<SBC_MGT_IP>/api/config/addressContext/ADDR_CONTEXT/zone/ZONE7"
Code Block |
---|
[root@ip-172-31-10-46 ARJUN_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:Sonus@123' -H "Accept: application/vnd.yang.data+json" -H "Content-Type: application/vnd.yang.data+json" -X POST -d @sipTrunkGroup_2 "https://<SBC_MGT_IP>/api/config/addressContext/ADDR_CONTEXT/zone/ZONE8"
10. Creating SIP Signalling Ports :-
Code Block |
---|
[root@ip-172-31-10-46 ARJUN_REST_JSON]# cat sipSigPort_1 { "sonusSipSigPort:sipSigPort": [ { "index": 7, "ipInterfaceGroupName": "INGRESS_LIG", "portNumber": 5060, "mode": "inService", "state": "enabled", "transportProtocolsAllowed": "sip-udp sip-tcp sip-tls-tcp sip-sctp", "ipVarV4": "IF2.IPV4" } ] } |
Note |
---|
To configure the public or EIP to the interfaces , add the "ipPublicVarV4": <MetaVariable> in the JSON file |
curl -kisu 'admin:Sonus@123' -H "Accept: application/vnd.yang.data+json" -H "Content-Type: application/vnd.yang.data+json" -X POST -d @sipSigPort_1 "https://<SBC_MGT_IP>/api/config/addressContext/ADDR_CONTEXT/zone/ZONE7"
Code Block |
---|
[root@ip-172-31-10-46 ARJUN_REST_JSON]# cat sipSigPort_2 { "sonusSipSigPort:sipSigPort": [ { "index": 8, "ipInterfaceGroupName": "EGRESS_LIG", "portNumber": 5060, "mode": "inService", "state": "enabled", "transportProtocolsAllowed": "sip-udp sip-tcp sip-tls-tcp sip-sctp", "ipVarV4": "IF3.IPV4" } ] } |
Note |
---|
To configure the public or EIP to the interfaces , add the "ipPublicVarV4": <MetaVariable> in the JSON file |
curl -kisu 'admin:Sonus@123' -H "Accept: application/vnd.yang.data+json" -H "Content-Type: application/vnd.yang.data+json" -X POST -d @sipSigPort_2 "https://<SBC_MGT_IP>/api/config/addressContext/ADDR_CONTEXT/zone/ZONE8"
11. Creating Standars Routes and Routing Labels :-
Code Block |
---|
[root@ip-172-31-10-46 ARJUN_REST_JSON]# cat routingLabel_1 { "sonusRoutingLabel:routingLabel": { "name": "VRF_RL_EG" } } |
curl -kisu 'admin:Sonus@123' -H "Accept: application/vnd.yang.data+json" -H "Content-Type: application/vnd.yang.data+json" -X POST -d @routingLabel_1 "https://<SBC_MGT_IP>/api/config/global/callRouting"
Code Block |
---|
{ "routingLabelRoute": [ { "sequence": "0", "routeType":"trunkGroup", "trunkGroup":"EGRESS_TRGP", "ipPeer":"EGRESS_PEER", "proportion":"0", "cost":"1000000", "inService":"inService", "testing":"normal" } ] } |
curl -kisu 'admin:Sonus@123' -H "Accept: application/vnd.yang.data+json" -H "Content-Type: application/vnd.yang.data+json" -X POST -X POST -d @routingLabelRoute_1 "https://<SBC_MGT_IP>/api/config/global/callRouting/routingLabel/VRF_RL_EG"
Code Block |
---|
[root@ip-172-31-10-46 ARJUN_REST_JSON]# cat route_1 { "sonusRoute:route": [ { "elementType": "none", "elementId1": "Sonus_NULL", "elementId2": "Sonus_NULL", "routingType": "standard", "destinationNational": "98402", "destinationCountry": "1", "callType": "all", "digitType": "all", "timeRangeProfile": "ALL", "callParameterFilterProfile": "none", "domainName": "Sonus_NULL", "routingLabel":"VRF_RL_EG" } ] } |
curl -kisu 'admin:Sonus@123' -H "Accept: application/vnd.yang.data+json" -H "Content-Type: application/vnd.yang.data+json" -X POST -d @route_1 "https://<SBC_MGT_IP>/api/config/global/callRouting/"
Here I have configured the Standard route for Number based routing with called number being "98402".
Note |
---|
You can also have Trunk group based routing in case You don't want to use Number based routing [root@ip-172-31-10-46 ARJUN_REST_JSON]# cat route_1_TG |
Copy the XML 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.
Given below are the configurations to configure SBC for a basic A-B call using Rest API.
Code Block |
---|
wfats1:~/REST_API> cat codecEntry <codecEntry> <name>G711</name> <codec>g711</codec> <packetSizeG711>10</packetSizeG711> </codecEntry> |
curl -kisu 'admin:<Password>' -X POST -d @codecEntry -H 'Content-Type: application/vnd.yang.data+xml' https://<SBC_MGT_IP>/api/config/profiles/media
2. Creating Packet service profiles :-
Code Block |
---|
wfats1:~/REST_API> cat packetServiceProfile <packetServiceProfile> <name>G711</name> <codec> <codecEntry1>G711</codecEntry1> </codec> </packetServiceProfile> |
curl -kisu 'admin:<Password>' -X POST -d @packetServiceProfile -H 'Content-Type: application/vnd.yang.data+xml' https://<SBC_MGT_IP>/api/config/profiles/media
3.Creating Address contexts :-
Code Block |
---|
wfats1:~/REST_API> cat addressContext <addressContext> <name>ADDR_CONTEXT</name> </addressContext> |
curl -kisu 'admin:<Password>' -X POST -d @addressContext -H 'Content-Type: application/vnd.yang.data+xml' https://<SBC_MGT_IP>/api/config
4.Creating IP interface groups :-
Code Block |
---|
wfats1:~/REST_API> cat ipInterfaceGroup_1 <ipInterfaceGroup> <name>LIG7</name> </ipInterfaceGroup> |
curl -kisu 'admin:<Password>' -X POST -d @ipInterfaceGroup_1 -H 'Content-Type: application/vnd.yang.data+xml' https://<SBC_MGT_IP>/api/config/addressContext/ADDR_CONTEXT
Code Block |
---|
wfats1:~/REST_API> cat ipInterfaceGroup_2 <ipInterfaceGroup> <name>LIG8</name> </ipInterfaceGroup> |
curl -kisu 'admin:<Password>' -X POST -d @ipInterfaceGroup_2 -H 'Content-Type: application/vnd.yang.data+xml' https://<SBC_MGT_IP>/api/config/addressContext/ADDR_CONTEXT
5.Creating Zones :-
Code Block |
---|
wfats1:~/REST_API> cat zones_1 <zone> <name>ZONE7</name> <id>104</id> </zone> |
curl -kisu 'admin:<Password>' -X POST -d @zones_1 -H 'Content-Type: application/vnd.yang.data+xml' https://<SBC_MGT_IP>/api/config/addressContext/ADDR_CONTEXT
Code Block |
---|
wfats1:~/REST_API> cat zones_2 <zone> <name>ZONE8</name> <id>204</id> </zone> |
curl -kisu 'admin:<Password>' -X POST -d @zones_2 -H 'Content-Type: application/vnd.yang.data+xml' https://<SBC_MGT_IP>/api/config/addressContext/ADDR_CONTEXT
6.Creating ip interfaces :-
Code Block |
---|
wfats1:~/REST_API> cat ipInterface_1 <ipInterface> <name>LIF7</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>' -X POST -d @ipInterface_1 -H 'Content-Type: application/vnd.yang.data+xml' https://<SBC_MGT_IP>/api/config/addressContext/ADDR_CONTEXT/ipInterfaceGroup/LIG7
Note |
---|
to configure the public or EIP to the interfaces , add the <ipPublicVarV4>MetaVariable</ipPublicVarV4> in the XML file |
Code Block |
---|
wfats1:~/REST_API> cat ipInterface_2 <ipInterface> <name>LIF8</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>' -X POST -d @ipInterface_2 -H 'Content-Type: application/vnd.yang.data+xml' https://<SBC_MGT_IP>/api/config/addressContext/ADDR_CONTEXT/ipInterfaceGroup/LIG8
7.Creating static Routes :-
Code Block |
---|
wfats1:~/REST_API> cat staticRoute_1 <staticRoute> <destinationIpAddress>0.0.0.0</destinationIpAddress> <prefix>0</prefix> <nextHop>172.31.12.1</nextHop> <ipInterfaceGroupName>LIG7</ipInterfaceGroupName> <ipInterfaceName>LIF7</ipInterfaceName> <preference>100</preference> </staticRoute> |
curl -kisu 'admin:<Password>' -X POST -d @staticRoute_1 -H 'Content-Type: application/vnd.yang.data+xml' https://<SBC_MGT_IP>/api/config/addressContext/ADDR_CONTEXT
Code Block |
---|
wfats1:~/REST_API> cat staticRoute_2 <staticRoute> <destinationIpAddress>0.0.0.0</destinationIpAddress> <prefix>0</prefix> <nextHop>172.31.13.1</nextHop> <ipInterfaceGroupName>LIG8</ipInterfaceGroupName> <ipInterfaceName>LIF8</ipInterfaceName> <preference>100</preference> </staticRoute> |
curl -kisu 'admin:<Password>' -X POST -d @staticRoute_2 -H 'Content-Type: application/vnd.yang.data+xml' https://<SBC_MGT_IP>/api/config/addressContext/ADDR_CONTEXT
8.Creating IP peers :-
Code Block |
---|
wfats1:~/REST_API> cat ipPeer_1 <ipPeer> <name>INGRESS_PEER</name> <ipAddress>172.31.12.202</ipAddress> <ipPort>9884</ipPort> </ipPeer> |
curl -kisu 'admin:<Password>' -X POST -d @ipPeer_1 -H 'Content-Type: application/vnd.yang.data+xml' https://<SBC_MGT_IP>/api/config/addressContext/ADDR_CONTEXT/zone/ZONE7
Code Block |
---|
wfats1:~/REST_API> cat ipPeer_2 <ipPeer> <name>EGRESS_PEER</name> <ipAddress>172.31.13.202</ipAddress> <ipPort>9884</ipPort> </ipPeer> |
curl -kisu 'admin:<Password>' -X POST -d @ipPeer_2 -H 'Content-Type: application/vnd.yang.data+xml' https://<SBC_MGT_IP>/api/config/addressContext/ADDR_CONTEXT/zone/ZONE8
9.Creating SIP Sig ports :-
Code Block |
---|
wfats1:~/REST_API> cat sipSigPort_1 <sipSigPort> <index>7</index> <ipInterfaceGroupName>LIG7</ipInterfaceGroupName> <ipVarV4>IF2.IPV4</ipVarV4> <portNumber>5060</portNumber> <mode>inService</mode> <state>enabled</state> <transportProtocolsAllowed>sip-udp sip-tcp sip-tls-tcp sip-sctp</transportProtocolsAllowed> </sipSigPort> |
curl -kisu 'admin:<Password>' -X POST -d @sipSigPort_1 -H 'Content-Type: application/vnd.yang.data+xml' https://<SBC_MGT_IP>/api/config/addressContext/ADDR_CONTEXT/zone/ZONE7
Note |
---|
to configure the public or EIP to the SIP Signalling port , add the <ipPublicVarV4>MetaVariable</ipPublicVarV4> in the XML file |
Code Block |
---|
wfats1:~/REST_API> cat sipSigPort_2 <sipSigPort> <index>8</index> <ipInterfaceGroupName>LIG8</ipInterfaceGroupName> <ipVarV4>IF3.IPV4</ipVarV4> <portNumber>5060</portNumber> <mode>inService</mode> <state>enabled</state> <transportProtocolsAllowed>sip-udp sip-tcp sip-tls-tcp sip-sctp</transportProtocolsAllowed> </sipSigPort> |
curl -kisu 'admin:<Password>' -X POST -d @sipSigPort_2 -H 'Content-Type: application/vnd.yang.data+xml' https://<SBC_MGT_IP>/api/config/addressContext/ADDR_CONTEXT/zone/ZONE8
10.creating SIP trunk groups :-
Code Block |
---|
wfats1:~/REST_API> cat sipTrunkGroup_1 <sipTrunkGroup> <name>INGRESS_TG</name> <state>enabled</state> <mode>inService</mode> <policy> <media> <packetServiceProfile>G711</packetServiceProfile> </media> </policy> <media> <mediaIpInterfaceGroupName>LIG7</mediaIpInterfaceGroupName> </media> <ingressIpPrefix> <ipAddress>172.31.12.174</ipAddress> <prefixLength>24</prefixLength> </ingressIpPrefix> </sipTrunkGroup> |
curl -kisu 'admin:<Password>' -X POST -d @sipTrunkGroup_1 -H 'Content-Type: application/vnd.yang.data+xml' https://<SBC_MGT_IP>/api/config/addressContext/ADDR_CONTEXT/zone/ZONE7
Code Block |
---|
wfats1:~/REST_API> cat sipTrunkGroup_2 <sipTrunkGroup> <name>EGRESS_TG</name> <state>enabled</state> <mode>inService</mode> <policy> <media> <packetServiceProfile>G711</packetServiceProfile> </media> </policy> <media> <mediaIpInterfaceGroupName>LIG8</mediaIpInterfaceGroupName> </media> </sipTrunkGroup> |
curl -kisu 'admin:<Password>' -X POST -d @sipTrunkGroup_2 -H 'Content-Type: application/vnd.yang.data+xml' https://<SBC_MGT_IP>/api/config/addressContext/ADDR_CONTEXT/zone/ZONE8
11.creating Standard route and routing Label :-
Code Block |
---|
wfats1:~/REST_API> cat routingLabel_1 <routingLabel> <name>VRF_RL_EG</name> </routingLabel> |
curl -kisu 'admin:<Password>' -X POST -d @routingLabel_1 -H 'Content-Type: application/vnd.yang.data+xml' https://<SBC_MGT_IP>/api/config/global/callRouting/
Code Block |
---|
wfats1:~/REST_API> cat routingLabelRoute_1 <routingLabelRoute> <sequence>0</sequence> <routeType>trunkGroup</routeType> <trunkGroup>EGRESS_TG</trunkGroup> <ipPeer>EGRESS_PEER</ipPeer> <proportion>0</proportion> <cost>1000000</cost> <inService>inService</inService> <testing>normal</testing> </routingLabelRoute> |
curl -kisu 'admin:<Password>' -X POST -d @routingLabelRoute_1 -H 'Content-Type: application/vnd.yang.data+xml' https://<SBC_MGT_IP>/api/config/global/callRouting/routingLabel/VRF_RL_EG
Code Block |
---|
wfats1:~/REST_API> cat route_1 <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>' -X POST -d @route_1 -H 'Content-Type: application/vnd.yang.data+xml' https://<SBC_MGT_IP>/api/config/global/callRouting/
The call can be made successfully from Ingress to egress.
Pagebreak |
---|