ProSBC:Restful API Route
You can create/modify a route in your system with RestFul API using JSON format. The JSON must be in the following format:
{
"called": "",
"remapped_source_leg_profile": "(same as NAP)",
"calling": "",
"name": "TO_CLIENT",
"remapped_nap": "(By registered or DNS user)",
"nap": "3CX",
"remapped_calling": "",
"remapped_called": "",
"custom_attributes": {
"private_address": "",
"weight": "",
"remapped_private_address": "",
"priority": "1",
"forward_sip_domain": "1",
"forward_sip_parameters": "1",
"***meta***": {
"valid_url": false
}
},
"remapped_destination_leg_profile": "(same as NAP)",
"routeset_name": "",
"***meta***": {
"version": "3.1.137",
"src_path": ""
}
}
Important parameters in the JSON file
- name
- called
- calling
- nap
- remapped_called
- remapped_calling
- remapped_nap
- remapped_source_leg_profile
- remapped_destination_leg_profile
Adding a new Route
You can add a new Route with the POST command:
POST http://ProSBCIP:12358/configurations/configuration name/routes/
ProSBC will create a new Route from the name in the JSON file.
Example: We use the Postman tool in this example and the URL is:
http://192.168.1.25:12358/configurations/config_2/routes/
File:RestFul route Post Send.png
If the new Route is created successfully, you will see the following information in the Postman Tool
Modifiying a Route
You can modify the existing Route with the PUT command:
PUT http://ProSBCIP:12358/configurations/Configurationname/routes/Routename
Example: We use the Postman tool in this example and the URL is
http://192.168.1.25:12358/configurations/config_2/routes/TEST and changed called number to 123456789
If the update is successful you will see the following information in the Postman Tool
You can get more information about how to use RestFul API and Postman Tool from the following link Northbound_interface:RESTful