Page tree
Skip to end of metadata
Go to start of metadata

This page is currently being written. Although the information below is probably accurate, it may not be complete or may have errors.

The information on this page applies to iSymphony 3.1+.

Description

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.

 

On this page:

 

Root Resource Path

communication_manager/rest/config/asterisk/{coreServerId}/pbxServers

JSON Representation

{
  "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": "mycdrpass",
  "recordingAgentIdentifier": "local-rec"
}
PropertyTypeDescription
id
String

Configuration id of the PBX server.

displayName
StringThe display name of the PBX server.
hostStringThe hostname or ip for the PBX server connection.
port
IntegerThe port for the PBX server connection.
username
StringThe username used for authentication with the PBX server.
password
StringThe password used for authentication with the PBX server.
enabled
BooleanFlag specifying if the PBX server is enabled or not.
cdrName
StringThe name of the CDR database.
cdrHost
StringThe hostname or ip for the CDR database connection.
cdrPort
IntegerThe port for the CDR database connection.
cdrUsername
StringThe username used for authentication with the CDR database.
cdrPassword
StringThe password used to authentication with the CDR database.
recordingAgentIdentifier
StringThe agent identifier of the recording agent that is bound to this PBX server.

Resource Paths

communication_manager/rest/config/asterisk/{coreServerId}/pbxServers
DescriptionAccesses all the PBX server connections in the core server.
GET Gets the configuration for all the PBX server connections in the core server.
POST

Adds a PBX server connection to the configuration.

Errors:

  • 409 'A PBXServer with the given id already exists.': Returned if a PBX server with the given id already exists.
  • 409 'Specified recordingAgentIdentifier is already set on another pbxServer.': Returned if a recording agent identifier is already bound to another PBX server.
  • 412 'No displayName provided.': Returned if no display name was provided.
  • 412 'No host provided.': Returned if no host was provided.
  • 412 'No username provided.': Returned if no username was provided.
  • 412 'No password provided.': Returned if no password was provided.
 
communication_manager/rest/config/asterisk/{coreServerId}/pbxServers/{pbxServerId}
Description

Accesses the configuration of a specific PBX server connection.

Parameters:

  • pbxServerId: The configuration id of the PBX server.
GET

Gets the configuration of the specified PBX server connection.

Errors:

  • 404 'A PBX Server with the given id does not exist': Returned if no PBX server exists with the given id.
PUT

Updates the specified PBX server configuration.

Errors:

  • 404 'A queue with the given id does not exist': Returned if no queue exists with the given id.
  • 409 'Specified recordingAgentIdentifier is already set on another pbxServer.': Returned if a recording agent identifier is already bound to another PBX server.
  • 412 'No displayName provided.': Returned if no display name was provided.
  • 412 'No host provided.': Returned if no host was provided.
  • 412 'No username provided.': Returned if no username was provided.
  • 412 'No password provided.': Returned if no password was provided.
DELETE

Deletes the specified PBX server connection.

Errors:

  • 404 'A PBXServer with the given id does not exist': Returned if no PBX server exists with the given id.

Curl Examples

Get all PBX server connections in a core server

curl --user manager:manag3rpa55word -k -i -H "Accept: application/json" http://localhost:58080/communication_manager/rest/config/asterisk/ee828da8-5ee6-412d-82ac-1273f598659d/pbxServers

Get the configuration for a specific PBX server connection

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

Add a new PBX server connection

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

Delete a PBX server connection

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

Update a PBX server connection

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
  • No labels