GET (Getting the Trunk's list)
GET
1) Info of the entire list of trunks and their unique IDs
rest/domain/domain_name/domain_trunks
Parameters
Field |
Type |
Description |
---|
domain_name |
String |
Name of the existing domain. |
Success (200 OK)
Example Request: curl -u admin: GET -D - http://192.168.1.194:8080/rest/domain/localhost/domain_trunks
[ { id: "1", name: "CallCentric", type: "register", disabled: "false", account: "17778648639", proxy: "sip:callcentric.com:5060", registrar: "callcentric.com", direction: "", ani: "sachinpchhajed", global: "true", status1: "200 Ok", status2: "60 s" }, { id: "2", name: "Int Trunk", type: "register", disabled: "false", account: "441", proxy: "nyc.vodia.com", registrar: "nyc.vodia.com", direction: "", ani: "", global: "false", status1: "200 Ok", status2: "180 s" }, { id: "3", name: "WebRTC", type: "wrtc", disabled: "", account: "", proxy: "", registrar: "", direction: "", ani: "", global: "", status1: "", status2: "" }, { id: "28", name: "Action Kumar", type: "register", disabled: "", account: "", proxy: "", registrar: "", direction: "", ani: "", global: "", status1: "", status2: "" } ]
2) Info of a SINGLE trunk
rest/domain/domain_name/edit_trunk/trunk_number
Parameters
Field |
Type |
Description |
---|
domain_name |
String |
Name of the existing domain. |
trunk_number |
Int |
Unique ID number generated |
Success (200 OK)
Example Request: curl -u admin: -D - http://192.168.1.194:8080/rest/domain/localhost/edit_trunk/2
{ aadr: "", analog: "false", bcp: "", behind_nat: "false", cid_update: "", cobusy: "500 Line Unavailable", codec_lock: "true", codecs: "", codest: "", cur: "", dial_extension: "hi", dialplan: "1", dir: "", dis: "false", domain: "1", dtmf: "false", dtmf_mode: "", earlymedia: "true", expires: "3600", failover: "never", fraction: "128", from_source: "ppi", from_user: "", glob: "", global: "false", hcv: "", hd: "", hf: "{from}", hpai: "", hppi: "{trunk}", hpr: "{if clip true}id{fi clip true}", hrpi: "", hru: "{request-uri}", ht: "{to}", icid: "", ignore_18x_sdp: "false", interoffice: "false", minimum: "10", minor: "181 s", name: "Int Trunk", outbound_proxy: "nyc.vodia.com", pcap: "false", prack: "true", prefix: "", redirect: "false", reg_account: "441", reg_display: "Int Trunk", reg_keep: "", reg_pass: "vodia2013@1234!", reg_registrar: "nyc.vodia.com", reg_user: "441", remote_party: "", request_timeout: "", require: "", rfcrtp: "false", ring180: "false", rtcpxr: "false", rtp_begin: "", rtp_end: "", send_email: "", sip_port: "", status: "200 Ok", tel: "true", trusted: "false", type: "register", use_epid: "false", use_history: "false", use_uuid: "false", user_defined_hdr: "", uuid: "urn:uuid:47af6eb5-f535-449f-b955-25964ba0df4e", wrtc_dest_name: "", wrtc_dest_number: "" }
Response |
Code |
Description |
---|
Success |
200 |
OK |
Invalid ID supplied |
400 |
Only authenticated a Admins can access the data |
Permission Denied |
403 |
Forbidden |
Not Found |
404 |
The id of the User was not found or there are errors in the URL. |
POST (Create, Update and Delete the Attributes of the Webpage)
post
Create
/rest/domain/domain_name/domain_trunks
Example Request: curl -u admin: -D - http://127.0.0.1:8080/rest/domain/localhost/domain_trunks -X POST -d "{ 'type':'register', 'name':'Trunk New' }" Response:
Response |
Code |
Description |
---|
Success |
200 |
OK |
Invalid ID supplied |
400 |
Only authenticated a Admins can access the data |
Permission Denied |
403 |
Forbidden |
Not Found |
404 |
The id of the User was not found or there are errors in the URL. |
Update
/rest/domain/domain_name/edit_trunk/trunk_number
Example Request: curl -u admin: -D - http://127.0.0.1:8080/rest/domain/localhost/edit_trunk/27 -X POST -d "{ 'remote_party':'888888888', 'hru':'new_group', 'remote_party':'456456456456', 'name':'Replaced Trunk' }" Response:
Response |
Code |
Description |
---|
Success |
200 |
OK |
Invalid ID supplied |
400 |
Only authenticated a Admins can access the data |
Permission Denied |
403 |
Forbidden |
Not Found |
404 |
The id of the User was not found or there are errors in the URL. |
Delete
/rest/domain/domain_name/edit_trunk/trunk_number
Example:
The trunk number in the API call below can be obtained using the GET
for entire trunk list
If multiple trunks have to be deleted at once, multiple API calls have to be sent, with varying Trunk IDs.
Request:
curl -u admin: -D - http://192.168.1.194:8080/rest/domain/localhost/domain_trunks?trunk=26 -X DELETE Response:
Response |
Code |
Description |
---|
Success |
200 |
OK |
Invalid ID supplied |
400 |
Only authenticated a Admins can access the data |
Permission Denied |
403 |
Forbidden |
Not Found |
404 |
The id of the User was not found or there are errors in the URL. |