Vodia PBX API

Dial Plans

GET Dial Plan's setting(s)

GET

1) Info of the entire list of Dial Plans

rest/domain/domain_name/dialplans

Parameters

Field Type Description
domain_name String Name of the existing domain.

Success (200 OK)

Example:

Request:

curl -u username:password GET -D - http://192.168.1.194/rest/domain/localhost/dialplans
[ { name: "Default", value: "1", global: true }, { name: "CallCentric_Dial", value: "2", global: true } ]

2) Info of a SINGLE Dial Plan

rest/domain/domain_name/edit_dialplan?dialplan=dial_plan_value

Parameters

Field Type Description
domain_name String Name of the existing domain.
dial_plan_value Int Unique value number associated with each dial plan.

Success (200 OK)

Example:

Request:

curl -u username:password -D - https://localhost/rest/domain/localhost/edit_dialplan?dialplan=2f
{ name: "CallCentric_Dial", global: "true", dps: [ { id: "478", preference: "10", trunk: "2", pattern: "*", replacement: "*", cmc: "", sf: "", dis: "false" }, { id: "479", preference: "150", trunk: "1", pattern: "(balance-ivr-en)@.*", replacement: "sip:\1@\r;user=phone", cmc: "", sf: "", dis: "false" }, { id: "480", preference: "151", trunk: "1", pattern: "[911|411]", replacement: "1*", cmc: "", sf: "", dis: "false" }, { id: "481", preference: "152", trunk: "3", pattern: "011*", replacement: "011*", cmc: "", sf: "", dis: "true" }, { id: "482", preference: "153", trunk: "1", pattern: "1xxxxxxxxxx", replacement: "1*", cmc: "", sf: "", dis: "true" }, { id: "483", preference: "154", trunk: "1", pattern: "^([0-9]{11})@.*", replacement: "sip:\1@\r;user=phone", cmc: "", sf: "", dis: "false" }, { id: "484", preference: "155", trunk: "1", pattern: "^([0-9]{10})@.*", replacement: "sip:*\1@\d;user=phone", cmc: "", sf: "", dis: "false" }, { id: "485", preference: "900", trunk: "1", pattern: "xxxxxxxx", replacement: "02*", cmc: "", sf: "", dis: "true" }, { id: "486", preference: "999", trunk: "1", pattern: "\*67", replacement: "sip:*\1@\d;user=phone", cmc: "", sf: "", dis: "true" } ] }

CREATE Dial Plan

post
/rest/domain/domain_name/dialplans

Example:

Request:

curl -u username:password -D - http://192.168.1.194:8080/rest/domain/localhost/dialplans -X POST -d "{ 'name':'Dial_plan_New' }"

UPDATE Dial Plan

post
/rest/domain/domain_name/edit_dialplan?dialplan=dial_plan_value

Parameters

Field Type Description
domain_name String Name of the existing domain.
dial_plan_value Int / String Unique value (number or string) of the dial plan

Example:

Request:

curl -u username:password -D - http://192.168.1.194:8080/rest/domain/localhost/edit_dialplan?dialplan=11 -X POST -d "{ 'name':'self', 'global':'false', 'dps':[ {'preference':'105', 'trunk':'1', 'cmc':'c', 'pattern':'^([0-9]{11})@.*', 'replacement':'sip:\\1@\\r;user:phone', 'sf':'', 'dis':'true' }] }"

DELETE Dial Plan

Example:

The Dial Plan's Value ID number in the API call below can be obtained using the GET for an entire Dial Plan's list

/rest/domain/domain_name/dialplans?id=dial_plan_value

Parameters used

Field Type Description
domain_name String Name of the existing domain.
dial_plan_value Int / String Unique value (String or number) of the dial plan to be deleted.

Request:

curl -u username:password -D - https://localhost/rest/domain/localhost/dialplans?id=19 -X DELETE

Response for Create, Update and Delete requests:

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.