goagent

command module
v0.0.0-...-675a9c4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 20, 2024 License: LGPL-2.1 Imports: 20 Imported by: 0

README

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

Documentation

Overview

goagent document

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL