Asterisk PBX Server Configuration

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

Warning

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

Information

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:

The [toc] macro is a standalone macro and it cannot be used inline. Click on this message for details.
 

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

Property

Type

Description

id

String

Configuration id of the PBX server.

displayName

String

The display name of the PBX server.

host

String

The hostname or ip for the PBX server connection.

port

Integer

The port for the PBX server connection.

username

String

The username used for authentication with the PBX server.

password

String

The password used for authentication with the PBX server.

enabled

Boolean

Flag specifying if the PBX server is enabled or not.

cdrName

String

The name of the CDR database.

cdrHost

String

The hostname or ip for the CDR database connection.

cdrPort

Integer

The port for the CDR database connection.

cdrUsername

String

The username used for authentication with the CDR database.

cdrPassword

String

The password used to authentication with the CDR database.

recordingAgentIdentifier

String

The agent identifier of the recording agent that is bound to this PBX server.

Resource Paths

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

Description

Accesses 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