HTTP API - Set Configuration: Difference between revisions

From Ultiroam User Docs
Jump to navigation Jump to search
(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...")
 
No edit summary
Tag: 2017 source edit
Line 1: Line 1:
== 9.1         Request ==
'''POST   http:// gateway /api/set_config'''
POST   http:// gateway /api/set_config


== 9.2         Request Parameter ==
'''Request Parameters:'''
{| class="wikitable"
{| class="wikitable"
|'''Parameter'''
|'''Parameter'''
Line 11: Line 10:
|-
|-
|sip_proxy
|sip_proxy
|Array,contain  s  only one object
|Array, contains only one object
|"domain":"172.18.25.31"            Domain/IP "port":5060                             Port
|"domain":"172.18.25.31"            Domain/IP "port":5060                             Port


Line 17: Line 16:
|-
|-
|sip_trunk
|sip_trunk
|Array,contain s at least one object
|Array, contains at least one object
|"index":0                                   Index
|"index":0                                   Index


Line 29: Line 28:
|-
|-
|ip_to_tel_routing
|ip_to_tel_routing
|Array,contain  s  at least one object
|Array, contains at least one object
|"index":0                                    Index
|"index":0                                    Index


Line 47: Line 46:


"prefix_to_be_added":""     Add prefix number
"prefix_to_be_added":""     Add prefix number
|}


{| class="wikitable"
"suffix_to_be_added":""     Add suffix number "del_digit":0                                        Remove prefix  digits
|
|
|"suffix_to_be_added":""     Add suffix number "del_digit":0                                        Remove prefix  digits


"reserve_digit":255              Reserved number  digits
"reserve_digit":255              Reserved number  digits
|-
|-
|tel_to_ip_routing
|tel_to_ip_routing
|Array,contain  s  at least one object
|Array, contains at least one object
|"index":63                               Index
|"index":63                               Index
"enable":"on"                            Status
"enable":"on"                            Status


Line 86: Line 79:
|-
|-
|port_group
|port_group
|Array,contain  s  at least one object
|Array, contains at least one object
|"index":0                                 Index,int
|"index":0                                 Index,int
"enable":"on"                            Status
"enable":"on"                            Status


Line 107: Line 99:
"tel_to_ip_hot_line":""                                    VOIP Hotline "ip_to_tel_hot_line":""     PSTN Hotline
"tel_to_ip_hot_line":""                                    VOIP Hotline "ip_to_tel_hot_line":""     PSTN Hotline
|}
|}
 
'''Response Parameters:'''
== 9.3         Response Paramete ==
{| class="wikitable"
{| class="wikitable"
|'''Parameter'''
|'''Parameter'''
Line 114: Line 105:
|'''Description'''
|'''Description'''
|-
|-
| colspan="3" |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
| colspan="3" |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":"succe  ss"}
|{"sip_proxy":"succe  ss"}
Line 122: Line 114:
|{"sip_trunk":[]}
|{"sip_trunk":[]}
|Object  contains array
|Object  contains array
|1_success, means that the SIP Trunk(index 1) is successfully set
|1_success, means that the SIP Trunk(index 1)is successfully set
|-
|-
|{"ip_to_tel_routing"
|{"ip_to_tel_routing"<nowiki>:</nowiki>[]}
 
<nowiki>:</nowiki>[]}
|Object  contains array
|Object  contains array
|2_success, means that the IP to Tel Route(index 2) is successfully set
|2_success, means that the IP to Tel Route(index 2) is successfully set
|-
|-
|{"tel_to_ip_routing"
|{"tel_to_ip_routing"<nowiki>:</nowiki>[]}
 
<nowiki>:</nowiki>[]}
|Object  contains array
|Object  contains array
|3_success, means that the Tel to IP Route(index 3) is successfully set
|3_success, means that the Tel to IP Route(index 3) is successfully set
|-
|-
|{"port_group":[ ]}
|{"port_group":[ ]}
|Object  contains array
|Object  contains array
|4_success, means that the Port Group(index 4) is successfully set
|4_success, means that the Port Group(index 4) is successfully set
|}  
|}  


== 9.4         Example ==
== Example: ==
Request
Request:


curl -d '
curl -d '
Line 150: Line 138:
oup":[],"tel_to_ip_routing":[]}' -H "Content-Type:  application/json" <nowiki>http://gateway_ip/api/</nowiki> set_config  
oup":[],"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
{"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":""}]}
 
_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"]},
Response:


{"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"]}]

Revision as of 07:04, 8 May 2024

POST   http:// gateway /api/set_config

Request Parameters:

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

"check_network_status":"on"                                                Keepalive Enable

sip_trunk Array, contains 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, contains 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, contains 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, contains 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

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":"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

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":"","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"]}]