Web service for SimpleTrunk Panel
Go
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
LICENSE
README.md
agents.go
cdr.go
cfg.go
clients.go
common.go
database.go
doc.go GoAgent Mar 14, 2017
files.go
log.go
main.go
queue.go
schedule.go
shell.go
start.sh start script Mar 15, 2017
test.go

README.md

Introduction

GoAgent is a web service used by SimpleTrunk Panel web application to read and exceute commands in remote Asterisk PBX https://github.com/motaz/stpanel Written by Code for computer software (www.code.sd)

GoAgent executes as background service and listens to port 9091 in super user mode

Service Methods

Command

Executes CLI command in Asterisk
input parameters:
Command

Example:

{"command":"sip show peers"}

Output (JSON):

success   bool  
errorcode int   
result    string
message   string

Shell

Executes Linux shell command in Asterisk server
input parameter:
command
Example:
{"command":"uptime"}

Result (JSON):

success   bool  
errorcode int   
result    string
message   string

CallAMI

Executes AMI command in Asterisk server
Input parameter:
username string
secret   string
command  string

output result (JSON):

success   bool  
errorcode int   
result    string
message   string

AddNode

Adds SIP node or Dialplan to specific configuratio file e.g.:
[103]
type=peer
username=test
secret=0987
host=dynamic

Input parameters:

	filename string
nodename string
content  string

output result (JSON):

success   bool  
errorcode int   
result    string
message   string

ModifyNode

Overwrites existing SIP node or Dialplan node in specific configuratio file with new contents e.g.:
[103]
type=peer
username=test2
secret=1234
host=dynamic

Input parameters:

    filename string
nodename string
content  string

output result (JSON):

success   bool  
errorcode int   
result    string
message   string

RemoveNode

Removes existing SIP node or Dialplan node from specific configuration file e.g. (JSON):
{
  "filename":"sip.conf",
  "nodename":"[103]"
 }

Input parameters:

    filename string
nodename string

output result (JSON):

success   bool  
errorcode int   
result    string
message   string