Actions

ProSBC:Restful API Route: Difference between revisions

No edit summary
No edit summary
Line 31: Line 31:
</pre>
</pre>


Parameters in the JSON file
Important parameters in the JSON file


* [[Parameter: Name|name]]
* [[Parameter: Name|name]]
* [[Parameter: Routeset Name|Routeset Name]]
* [[Parameter: Called|called]]
* [[Parameter: Called|Called]]
* [[Parameter: Calling|calling]]
* [[Parameter: Calling|Calling]]
* [[Parameter: NAP|nap]]
* [[Parameter: NAP|NAP]]
* [[Parameter: Remapped Called|remapped_called]]
* [[Parameter: Remapped Called|Remapped Called]]
* [[Parameter: Remapped Calling|remapped_calling]]
* [[Parameter: Remapped Calling|Remapped Calling]]
* [[Parameter: Remapped NAP|remapped_nap]]
* [[Parameter: Remapped NAP|Remapped NAP]]
* [[Parameter: Source call leg remapped Profile|remapped_source_leg_profile]]
* [[Parameter: Source call leg remapped Profile|Source call leg remapped Profile]]
* [[Parameter: Destination call leg remapped Profile|remapped_destination_leg_profile]]
* [[Parameter: Destination call leg remapped Profile|Destination call leg remapped Profile]]


Custom Parameters
==Adding a new Route==
* [[Parameter: prio|prio (or priority)]]
 
* [[Parameter: additonal_naps|additonal_naps]]
You can add a new Route with the POST command:
* [[Parameter: domain|domain]]
 
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/
 
[[Image:RestFul_route_Post_Send.png|800px| ]]
 
If the new Route is created successfully, you will see the following information in the Postman Tool
 
[[Image:RestFul_route_Post_Response.png|800px| ]]
 
==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
 
[[Image:Route_Put_Send.png|800px| ]]
 
If the update is successful you will see the following information in the Postman Tool
 
[[Image:Route_Put_Response.png|800px| ]]
 
 
You can get more information about how to use RestFul API and Postman Tool from the following link [[Northbound_interface:RESTful]]

Revision as of 06:50, 23 January 2023

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

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

File:Route Put Send.png

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