HTTP API - Set Configuration

From Ultiroam User Docs
Revision as of 22:55, 2 May 2024 by Administrator (talk | contribs) (Created page with "== 9.1         Request == POST   http:// gateway /api/set_config == 9.2         Request Parameter == {| class="wikitable" |'''Parameter''' |'''Type''' |'''Description''' |- | colspan="3" |The request is an object in JSON format, the following is the description of the object content |- |sip_proxy |Array,contain s only one object |"domain":"172.18.25.31"            Domain/IP "port":5060                            Port "check_network_st...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

9.1         Request

POST   http:// gateway /api/set_config

9.2         Request Parameter

Parameter Type Description
The request is an object in JSON format, the following is the description of the object content
sip_proxy Array,contain s only one object "domain":"172.18.25.31"            Domain/IP "port":5060                            Port

"check_network_status":"on"                                                Keepalive Enable

sip_trunk Array,contain s at least one object "index":0                                   Index

"enable":"on"                              Status

"domain":"172.18.25.31"                                                  Domain/IP

"port":5060                                 Port

"description":"xxxx"                     Description "check_network_status":"on"                                                  Keepalive Enable

ip_to_tel_routing Array,contain s at least one object "index":0                                    Index

"enable":"on"                               Status

"operation": "Allow"       Call restriction Allow/ Forbid "description":""                                            Description

"src_mode":"sip_trunk"         Call Source

SIP Trunk/SIP Trunk Group/SIP Server

"src_id":0     SIP Trunk/SIP Trunk Group ID "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 Array,contain s at least one object "index":63                               Index

"enable":"on"                            Status

"description":"default"                                          Description "operation": "Allow"       Call restriction Allow/ Forbid

"src_mode":"port_group"           Call Source

Port/Port Group

"dst_mode":"sip_trunk_group"    Call delivery

SIP Trunk/SIP Trunk Group/SIP Server

"src_id":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 Array,contain s at least one object "index":0                                 Index,int

"enable":"on"                            Status

"description":"all"                     Description

"sip_account":""                        SIP ID

"sip_authid":""                          SIP Auth ID

"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

9.3         Response Paramete

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. The following is the description
{"sip_proxy":"succe ss"} 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

9.4         Example

Request

curl -d '

{"sip_proxy":[],"sip_trunk":[ ],"ip_to_tel_routing":[ ],"port_gr

oup":[],"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":"","pr efix_to_be_added":"","suffix_to_be_added":"","del_digit":0,"reserve_digit":0}],"tel_to_ip_ro uting":[{"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_ad ded":"","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"]}]