HTTP API - Set Configuration: Difference between revisions
No edit summary |
No edit summary |
||
(7 intermediate revisions by the same user not shown) | |||
Line 45: | Line 45: | ||
|Keepalive Enable | |Keepalive Enable | ||
|} | |} | ||
|- | |- | ||
|ip_to_tel_routing | |ip_to_tel_routing | ||
|Array, contains at least one object | |Array, contains at least one object | ||
|"index":0 | | | ||
{| | |||
"enable":"on" | |"index":0 | ||
|index | |||
"operation": | |- | ||
|"enable":"on" | |||
"src_mode":"sip_trunk" | |Status | ||
|- | |||
SIP Trunk/SIP Trunk Group/SIP Server | |"operation": "Allow" | ||
|Call restriction Allow/ Forbid | |||
"src_id":0 | |- | ||
|"description":"" | |||
Port/Port Group | |Description | ||
|- | |||
"dst_id":0 | |"src_mode":"sip_trunk" | ||
|Call Source | |||
"prefix_to_be_added":"" | SIP Trunk/SIP Trunk Group/SIP Server | ||
|- | |||
"suffix_to_be_added":"" | |"src_id":0 | ||
|SIP Trunk/SIP Trunk Group ID | |||
"reserve_digit":255 | |- | ||
|"dst_mode":"port_group" | |||
|Call delivery Port/Port Group | |||
|- | |||
|"dst_id":0 | |||
|Port/Port Group ID | |||
|- | |||
|"src_prefix":"" | |||
|Calling number prefix | |||
|- | |||
|"dst_prefix":"" | |||
|Called number prefix | |||
|- | |||
|"prefix_to_be_added":"" | |||
|Add prefix number | |||
|- | |||
|"suffix_to_be_added":"" | |||
|Add suffix number | |||
|- | |||
|"del_digit":0 | |||
|Remove prefix digits | |||
|- | |||
|"reserve_digit":255 | |||
|Reserved number digits | |||
|} | |||
|- | |- | ||
|tel_to_ip_routing | |tel_to_ip_routing | ||
|Array, contains at least one object | |Array, contains at least one object | ||
|"index":63 | | | ||
"enable":"on" | {| | ||
|"index":63 | |||
"description":"default" | |index | ||
|- | |||
"src_mode":"port_group" | |"enable":"on" | ||
|Status | |||
Port/Port Group | |- | ||
|"description":"default" | |||
"dst_mode":"sip_trunk_group" | |Description | ||
|- | |||
SIP Trunk/SIP Trunk Group/SIP Server | |"operation": "Allow" | ||
|Call restriction Allow/ Forbid | |||
"src_id":0 | |- | ||
|"src_mode":"port_group" | |||
"dst_id":0 | |Call Source | ||
Port/Port Group | |||
"dst_prefix":"" | |- | ||
|"dst_mode":"sip_trunk_group" | |||
"prefix_to_be_added":"" | |Call delivery | ||
SIP Trunk/SIP Trunk Group/SIP Server | |||
"del_digit":0 | |- | ||
|"src_id":0 | |||
"reserve_digit":0 | |Port/Port Group ID | ||
|- | |||
|"dst_id":0 | |||
|SIP Trunk/SIP Trunk Group ID | |||
|- | |||
|"src_prefix":"" | |||
|Calling number prefix | |||
|- | |||
|"dst_prefix":"" | |||
|Called number prefix | |||
|- | |||
|"prefix_to_be_added":"" | |||
|Add prefix number | |||
|- | |||
|"suffix_to_be_added":"" | |||
|Add suffix number | |||
|- | |||
|"del_digit":0 | |||
|Remove prefix digits | |||
|- | |||
|"reserve_digit":0 | |||
|Reserved number digits | |||
|} | |||
|- | |- | ||
|port_group | |port_group | ||
|Array, contains at least one object | |Array, contains at least one object | ||
|"index":0 | | | ||
"enable":"on" | {| | ||
|"index":0 | |||
"description":"all" | |Index, int | ||
|- | |||
"sip_account":"" | |"enable":"on" | ||
|Status | |||
"sip_authid":"" | |- | ||
|"description":"all" | |||
"sip_authpswd":"" | |Description | ||
|- | |||
"port_map":"[ 0,1,2,3,4,5,6,7]" | |"sip_account":"" | ||
|SIP ID | |||
"reg_type":"no_register" | |- | ||
|"sip_authid":"" | |||
"select_type":"cyclic_ascending" | |SIP Auth ID | ||
|- | |||
"tel_to_ip_hot_line":"" | |"sip_authpswd":"" | ||
|Password | |||
|- | |||
|"port_map":"[ 0,1,2,3,4,5,6,7]" | |||
|Port, Array | |||
|- | |||
|"reg_type":"no_register" | |||
|no_register/ sip_proxy/ | |||
Trunk-index | |||
|- | |||
|"select_type":"cyclic_ascending" | |||
|ascending/ cyclic_ascending/ | |||
descending/ | |||
cyclic_descending/ unknown | |||
|- | |||
|"tel_to_ip_hot_line":"" | |||
|VOIP Hotline | |||
|- | |||
|"ip_to_tel_hot_line":"" | |||
|PSTN Hotline | |||
|} | |||
|} | |} | ||
'''Response Parameters:''' | '''Response Parameters:''' | ||
Line 128: | Line 193: | ||
The array contains multiple types of objects, at least one of which is determined by the setting type. | The array contains multiple types of objects, at least one of which is determined by the setting type. | ||
|- | |- | ||
|{"sip_proxy":" | |{"sip_proxy":"success"} | ||
|Object | |Object | ||
|Success | |Success | ||
Line 153: | Line 218: | ||
'''Request:''' | '''Request:''' | ||
curl -d ' | curl -d '{"sip_proxy":[],"sip_trunk":[ ],"ip_to_tel_routing":[ ],"port_group":[],"tel_to_ip_routing":[]}' -H "Content-Type: application/json" <nowiki>http://gateway_ip/api/</nowiki>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":""}]} | ||
{"sip_proxy":[],"sip_trunk":[ ],"ip_to_tel_routing":[ ]," | |||
{"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:''' | '''Response:''' | ||
[ {"sip_proxy":"success"},{"sip_trunk":[ "31_success"]},{"ip_to_tel_routing":[ "1_success"]},{"tel_to_ip_routing":[ "1_success"]},{"port_group":[ "12_success"]}] | [ {"sip_proxy":"success"},{"sip_trunk":[ "31_success"]},{"ip_to_tel_routing":[ "1_success"]},{"tel_to_ip_routing":[ "1_success"]},{"port_group":[ "12_success"]}] |
Latest revision as of 21:50, 26 September 2024
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"]}]