HTTP API - Set Configuration
POST http:// gateway /api/set_config
Request Parameters:
Parameter | Type | Description | ||||||||||||||||||||||||||||
The request is an object in JSON format. | ||||||||||||||||||||||||||||||
sip_proxy | Array, contains only one object |
| ||||||||||||||||||||||||||||
sip_trunk | Array, contains at least one object |
| ||||||||||||||||||||||||||||
ip_to_tel_routing | Array, contains at least one object |
| ||||||||||||||||||||||||||||
tel_to_ip_routing | Array, contains at least one object |
| ||||||||||||||||||||||||||||
port_group | Array, contains at least one object |
|
Response Parameters:
Parameter | Type | Description |
The return is an array in JSON format.
The array contains multiple types of objects, at least one of which is determined by the setting type. | ||
{"sip_proxy":"success"} | Object | Success |
{"sip_trunk":[]} | Object contains array | 1_success, means that the SIP Trunk(index 1)is successfully set |
{"ip_to_tel_routing":[]} | Object contains array | 2_success, means that the IP to Tel Route(index 2) is successfully set |
{"tel_to_ip_routing":[]} | Object contains array | 3_success, means that the Tel to IP Route(index 3) is successfully set |
{"port_group":[ ]} | Object contains array | 4_success, means that the Port Group(index 4) is successfully set |
Example:
Request:
curl -d '{"sip_proxy":[],"sip_trunk":[ ],"ip_to_tel_routing":[ ],"port_group":[],"tel_to_ip_routing":[]}' -H "Content-Type: application/json" http://gateway_ip/api/set_config{"sip_proxy":[{"domain":"","port":2,"check_network_status":"off"}],"sip_trunk":[{"index":3 1,"enable":"on", "domain":"172.18.110.110","port":9367,"description":"benji","check_network_status":"on"}], "ip_to_tel_routing":[{"index":1,"enable":"on","description":"cs","src_mode":"sip_trunk","src_id":31,"dst_mode":"prot","dst_id":3,"operation":"Forbid","src_prefix":"","dst_prefix":"","prefix_to_be_added":"","suffix_to_be_added":"","del_digit":0,"reserve_digit":0}],"tel_to_ip_routing,[{"index":1,"enable":"on","description":"cs","src_mode":"port","src_id":1,"dst_mode":"sip_trunk","dst_id":31,"operation":"Forbid","src_prefix":"","dst_prefix":"","prefix_to_be_added":"","suffix_to_be_added":"","del_digit":0,"reserve_digit":0}],"port_group":[ {"index":12,"enable":"on","description":"aa","sip_account":"","sip_authid":"","sip_authpswd":"","sip_por t":0,"port_map":[1,2,3,5,7],"reg_type":"sip_proxy","select_type":"cyclic_ascending", "tel_to_ip_hot_line":"", "ip_to_tel_hot_line":""}]}
Response:
[ {"sip_proxy":"success"},{"sip_trunk":[ "31_success"]},{"ip_to_tel_routing":[ "1_success"]},{"tel_to_ip_routing":[ "1_success"]},{"port_group":[ "12_success"]}]