Last modified by ryanp on 2021/09/10 23:34

Show last authors
1 {{layout}}
2 {{layout-section ac:type="two_right_sidebar"}}
3 {{layout-cell}}
4 {{warning}}
5 This page is currently being written. Although the information below is probably accurate, it may not be complete or may have errors.
6 {{/warning}}
7
8 {{info}}
9 The information on this page applies to **iSymphony 3.1+**.
10 {{/info}}
11
12 = (% style="color: rgb(0,0,0);" %)Description(%%) =
13
14 The Asterisk PBX server REST resource allows access to the configuration for Asterisk PBX connections. This resource allows adding, removing, and updating of PBX server connections in the system.
15
16
17 {{/layout-cell}}
18
19 {{layout-cell}}
20 {{panel title="On this page:"}}
21
22
23 {{toc maxLevel="2" indent="1"/}}
24 {{/panel}}
25 {{/layout-cell}}
26 {{/layout-section}}
27
28 {{layout-section ac:type="single"}}
29 {{layout-cell}}
30 = (% style="color: rgb(0,0,0);" %)Root Resource Path(%%) =
31
32 {{code}}
33 communication_manager/rest/config/asterisk/{coreServerId}/pbxServers
34 {{/code}}
35
36 = JSON Representation =
37
38 {{code}}
39 {
40 "id": "91a7d992-a442-4c30-baa4-39c0db0a2153",
41 "displayName": "FreePBX",
42 "host": "pbx.mydomain.com",
43 "port": 5038,
44 "username": "cxpanel",
45 "password": "cxmanager*con",
46 "enabled": true,
47 "cdrName": "asteriskcdrdb",
48 "cdrHost": "pbx.mydomain.com",
49 "cdrPort": 3306,
50 "cdrUsername": "freepbxuser",
51 "cdrPassword": "mycdrpass",
52 "recordingAgentIdentifier": "local-rec"
53 }
54 {{/code}}
55
56 |=(((
57 Property
58 )))|=(((
59 Type
60 )))|=(((
61 Description
62 )))
63 |(((
64 {{{id}}}
65 )))|(((
66 String
67 )))|(((
68 Configuration id of the PBX server.
69 )))
70 |(% colspan="1" %)(% colspan="1" %)
71 (((
72 {{{displayName}}}
73 )))|(% colspan="1" %)(% colspan="1" %)
74 (((
75 String
76 )))|(% colspan="1" %)(% colspan="1" %)
77 (((
78 The display name of the PBX server.
79 )))
80 |(% colspan="1" %)(% colspan="1" %)
81 (((
82 host
83 )))|(% colspan="1" %)(% colspan="1" %)
84 (((
85 String
86 )))|(% colspan="1" %)(% colspan="1" %)
87 (((
88 The hostname or ip for the PBX server connection.
89 )))
90 |(% colspan="1" %)(% colspan="1" %)
91 (((
92 {{{port}}}
93 )))|(% colspan="1" %)(% colspan="1" %)
94 (((
95 Integer
96 )))|(% colspan="1" %)(% colspan="1" %)
97 (((
98 The port for the PBX server connection.
99 )))
100 |(% colspan="1" %)(% colspan="1" %)
101 (((
102 {{{username}}}
103 )))|(% colspan="1" %)(% colspan="1" %)
104 (((
105 String
106 )))|(% colspan="1" %)(% colspan="1" %)
107 (((
108 The username used for authentication with the PBX server.
109 )))
110 |(% colspan="1" %)(% colspan="1" %)
111 (((
112 {{{password}}}
113 )))|(% colspan="1" %)(% colspan="1" %)
114 (((
115 String
116 )))|(% colspan="1" %)(% colspan="1" %)
117 (((
118 The password used for authentication with the PBX server.
119 )))
120 |(% colspan="1" %)(% colspan="1" %)
121 (((
122 {{{enabled}}}
123 )))|(% colspan="1" %)(% colspan="1" %)
124 (((
125 Boolean
126 )))|(% colspan="1" %)(% colspan="1" %)
127 (((
128 Flag specifying if the PBX server is enabled or not.
129 )))
130 |(% colspan="1" %)(% colspan="1" %)
131 (((
132 {{{cdrName}}}
133 )))|(% colspan="1" %)(% colspan="1" %)
134 (((
135 String
136 )))|(% colspan="1" %)(% colspan="1" %)
137 (((
138 The name of the CDR database.
139 )))
140 |(% colspan="1" %)(% colspan="1" %)
141 (((
142 {{{cdrHost}}}
143 )))|(% colspan="1" %)(% colspan="1" %)
144 (((
145 String
146 )))|(% colspan="1" %)(% colspan="1" %)
147 (((
148 The hostname or ip for the CDR database connection.
149 )))
150 |(% colspan="1" %)(% colspan="1" %)
151 (((
152 {{{cdrPort}}}
153 )))|(% colspan="1" %)(% colspan="1" %)
154 (((
155 Integer
156 )))|(% colspan="1" %)(% colspan="1" %)
157 (((
158 The port for the CDR database connection.
159 )))
160 |(% colspan="1" %)(% colspan="1" %)
161 (((
162 {{{cdrUsername}}}
163 )))|(% colspan="1" %)(% colspan="1" %)
164 (((
165 String
166 )))|(% colspan="1" %)(% colspan="1" %)
167 (((
168 The username used for authentication with the CDR database.
169 )))
170 |(% colspan="1" %)(% colspan="1" %)
171 (((
172 {{{cdrPassword}}}
173 )))|(% colspan="1" %)(% colspan="1" %)
174 (((
175 String
176 )))|(% colspan="1" %)(% colspan="1" %)
177 (((
178 The password used to authentication with the CDR database.
179 )))
180 |(% colspan="1" %)(% colspan="1" %)
181 (((
182 {{{recordingAgentIdentifier}}}
183 )))|(% colspan="1" %)(% colspan="1" %)
184 (((
185 String
186 )))|(% colspan="1" %)(% colspan="1" %)
187 (((
188 The agent identifier of the recording agent that is bound to this PBX server.
189 )))
190
191 = Resource Paths =
192
193 |=(% colspan="2" %)(% colspan="2" %)
194 (((
195 {{{communication_manager/rest/config/asterisk/{coreServerId}/pbxServers}}}
196 )))
197 |(% class="highlight-grey" data-highlight-colour="grey" %)(% class="highlight-grey" data-highlight-colour="grey" %)
198 (((
199 **Description**
200 )))|(((
201 Accesses all the PBX server connections in the core server.
202 )))
203 |(% class="highlight-grey" data-highlight-colour="grey" %)(% class="highlight-grey" data-highlight-colour="grey" %)
204 (((
205 **GET**
206 )))|(((
207 Gets the configuration for all the PBX server connections in the core server.
208 )))
209 |(% class="highlight-grey" colspan="1" data-highlight-colour="grey" %)(% class="highlight-grey" colspan="1" data-highlight-colour="grey" %)
210 (((
211 **POST
212 **
213 )))|(% colspan="1" %)(% colspan="1" %)
214 (((
215 Adds a PBX server connection to the configuration.
216
217 (% style="line-height: 1.42857;" %)**Errors:**
218
219 * 409 'A PBXServer with the given id already exists.': Returned if a PBX server with the given id already exists.
220 * 409 'Specified recordingAgentIdentifier is already set on another pbxServer.': Returned if a recording agent identifier is already bound to another PBX server.
221 * 412 'No displayName provided.': Returned if no display name was provided.
222 * 412 'No host provided.': Returned if no host was provided.
223 * 412 'No username provided.': Returned if no username was provided.
224 * 412 'No password provided.': Returned if no password was provided.
225 )))
226 |(% colspan="2" %)(% colspan="2" %)
227 (((
228
229 )))
230 |=(% colspan="2" %)(% colspan="2" %)
231 (((
232 {{{communication_manager/rest/config/asterisk/{coreServerId}/pbxServers/{pbxServerId}}}}
233 )))
234 |(% class="highlight-grey" data-highlight-colour="grey" %)(% class="highlight-grey" data-highlight-colour="grey" %)
235 (((
236 **Description**
237 )))|(((
238 Accesses the configuration of a specific PBX server connection.
239
240 **Parameters:**
241
242 * pbxServerId: The configuration id of the PBX server.
243 )))
244 |(% class="highlight-grey" data-highlight-colour="grey" %)(% class="highlight-grey" data-highlight-colour="grey" %)
245 (((
246 **GET**
247 )))|(((
248 Gets the configuration of the specified PBX server connection.
249
250 **Errors:**
251
252 * 404 'A PBX Server with the given id does not exist': Returned if no PBX server exists with the given id.
253 )))
254 |(% class="highlight-grey" colspan="1" data-highlight-colour="grey" %)(% class="highlight-grey" colspan="1" data-highlight-colour="grey" %)
255 (((
256 **PUT**
257 )))|(% colspan="1" %)(% colspan="1" %)
258 (((
259 Updates the specified PBX server configuration.
260
261 **Errors:**
262
263 * 404 'A queue with the given id does not exist': Returned if no queue exists with the given id.
264 * 409 'Specified recordingAgentIdentifier is already set on another pbxServer.': Returned if a recording agent identifier is already bound to another PBX server.
265 * 412 'No displayName provided.': Returned if no display name was provided.
266 * 412 'No host provided.': Returned if no host was provided.
267 * 412 'No username provided.': Returned if no username was provided.
268 * 412 'No password provided.': Returned if no password was provided.
269 )))
270 |(% class="highlight-grey" colspan="1" data-highlight-colour="grey" %)(% class="highlight-grey" colspan="1" data-highlight-colour="grey" %)
271 (((
272 **DELETE**
273 )))|(% colspan="1" %)(% colspan="1" %)
274 (((
275 Deletes the specified PBX server connection.
276
277 **Errors:**
278
279 * 404 'A PBXServer with the given id does not exist': Returned if no PBX server exists with the given id.
280 )))
281
282 = Curl Examples =
283
284 === Get all PBX server connections in a core server ===
285
286 {{code language="bash"}}
287 curl --user manager:manag3rpa55word -k -i -H "Accept: application/json" http://localhost:58080/communication_manager/rest/config/asterisk/ee828da8-5ee6-412d-82ac-1273f598659d/pbxServers
288 {{/code}}
289
290 === Get the configuration for a specific PBX server connection ===
291
292 {{code language="bash"}}
293 curl --user manager:manag3rpa55word -k -i -H "Accept: application/json" http://localhost:58080/communication_manager/rest/config/asterisk/ee828da8-5ee6-412d-82ac-1273f598659d/pbxServer/56cf70a3-1ee0-4b09-8f40-297430eeeddf
294 {{/code}}
295
296 === Add a new PBX server connection ===
297
298 {{code language="bash"}}
299 curl --user manager:manag3rpa55word -k -i -H "Content-Type: application/json" -H "Accept: application/json" -X POST -d '{"id":"91a7d992-a442-4c30-baa4-39c0db0a2153","displayName":"FreePBX","host":"pbx.mydomain.com","port":5038,"username":"cxpanel","password":"cxmanager*con","enabled":true,"cdrName":"asteriskcdrdb","cdrHost":"pbx.mydomain.com","cdrPort":3306,"cdrUsername":"freepbxuser","cdrPassword":"myspass","recordingAgentIdentifier":"local-rec"}' http://localhost:58080/communication_manager/rest/config/asterisk/ee828da8-5ee6-412d-82ac-1273f598659d/pbxServers
300 {{/code}}
301
302 === Delete a PBX server connection ===
303
304 {{code language="bash"}}
305 curl --user manager:manag3rpa55word -k -i -X DELETE http://localhost:58080/communication_manager/rest/config/asterisk/ee828da8-5ee6-412d-82ac-1273f598659d/pbxServers/56cf70a3-1ee0-4b09-8f40-297430eeeddf
306 {{/code}}
307
308 === Update a PBX server connection ===
309
310 {{code language="bash"}}
311 curl --user manager:manag3rpa55word -k -i -H "Content-Type: application/json" -H "Accept: application/json" -X PUT -d '{"id":"91a7d992-a442-4c30-baa4-39c0db0a2153","displayName":"FreePBX New","host":"pbx.mydomain.com","port":5038,"username":"cxpanel","password":"cxmanager*con","enabled":true,"cdrName":"asteriskcdrdb","cdrHost":"pbx.mydomain.com","cdrPort":3306,"cdrUsername":"freepbxuser","cdrPassword":"myspass","recordingAgentIdentifier":"local-rec"}' http://localhost:58080/communication_manager/rest/config/asterisk/ee828da8-5ee6-412d-82ac-1273f598659d/pbxServers/91a7d992-a442-4c30-baa4-39c0db0a2153
312 {{/code}}
313 {{/layout-cell}}
314 {{/layout-section}}
315 {{/layout}}