All Projects → heltonmarx → goami

heltonmarx / goami

Licence: MIT license
Asterisk Manager Interface (AMI) client in Go

Programming Languages

go
31211 projects - #10 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to goami

ami
integration asterisk manager interface (AMI) in laravel
Stars: ✭ 25 (-30.56%)
Mutual labels:  ami, asterisk
amiws queue
Asterisk Queues Dashboard with amiws
Stars: ✭ 40 (+11.11%)
Mutual labels:  ami, asterisk
callme
No description or website provided.
Stars: ✭ 45 (+25%)
Mutual labels:  ami, asterisk
Starpy
Mirror of Python twisted library for AMI and FastAGI: No pull requests here please. Use Gerrit: https://gerrit.asterisk.org
Stars: ✭ 77 (+113.89%)
Mutual labels:  ami, asterisk
Astive
Media controller for Asterisk PBX (FastAGI Server)
Stars: ✭ 37 (+2.78%)
Mutual labels:  ami, asterisk
ya-node-asterisk
node.js client library for Asterisk Manager Interface
Stars: ✭ 18 (-50%)
Mutual labels:  ami, asterisk
amiws
Asterisk Management Interface (AMI) to Web-socket proxy
Stars: ✭ 60 (+66.67%)
Mutual labels:  ami, asterisk
Pami
PHP Asterisk Manager Interface ( AMI ) supports synchronous command ( action )/ responses and asynchronous events using the pattern observer-listener. Supports commands with responses with multiple events. Very suitable for development of operator consoles and / or asterisk / channels / peers monitoring through SOA, etc
Stars: ✭ 351 (+875%)
Mutual labels:  ami, asterisk
Python Ami
Python AMI Client
Stars: ✭ 70 (+94.44%)
Mutual labels:  ami, asterisk
Nami
Asterisk manager interface (ami) client for nodejs
Stars: ✭ 94 (+161.11%)
Mutual labels:  ami, asterisk
sccp manager
SCCP Manager
Stars: ✭ 35 (-2.78%)
Mutual labels:  asterisk
WindowTextExtractor
WindowTextExtractor allows you to get a text from any window of an operating system including asterisk passwords
Stars: ✭ 128 (+255.56%)
Mutual labels:  asterisk
asterisklint
Asterisk PBX configuration syntax checker
Stars: ✭ 45 (+25%)
Mutual labels:  asterisk
freepbx
FreePBX container (Asterisk 16; OpenPBX 15 with Backup and IVR modules installed)
Stars: ✭ 36 (+0%)
Mutual labels:  asterisk
ssm-ami-automation
Automated AMI creation using SSM
Stars: ✭ 14 (-61.11%)
Mutual labels:  ami
ami-io
Use node.js or io.js to manage Asterisk through AMI
Stars: ✭ 28 (-22.22%)
Mutual labels:  ami
ominicontacto
The Open Source Contact Center Solution (mirror of https://gitlab.com/omnileads/ominicontacto)
Stars: ✭ 24 (-33.33%)
Mutual labels:  asterisk
ami-spec
Acceptance testing your AMIs
Stars: ✭ 47 (+30.56%)
Mutual labels:  ami
asterisk-ami-client
Asterisk AMI Client for NodeJS (ES2015)
Stars: ✭ 32 (-11.11%)
Mutual labels:  asterisk
vnf-asterisk
Documentation, configuration, reference material and other information around an Asterisk-based VNF
Stars: ✭ 38 (+5.56%)
Mutual labels:  asterisk

goami

Asterisk Manager Interface (AMI) client in Go.

About

This code is based on C libami library interface

Installation and Requirements

The following command will install the AMI client.

go get -u github.com/heltonmarx/goami/ami

To test this package with Asterisk it's necessary set the file /etc/asterisk/manager.conf with configuration bellow:

[general]
enabled = yes
port = 5038
bindaddr = 127.0.0.1

[admin]
secret = admin
deny = 0.0.0.0/0.0.0.0
permit = 127.0.0.1/255.255.255.255
read = all,system,call,log,verbose,command,agent,user,config
write = all,system,call,log,verbose,command,agent,user,config

Using the code

Login/Logoff:

package main

import (
	"flag"
	"fmt"
	"log"

	"github.com/heltonmarx/goami/ami"
)

var (
	username = flag.String("username", "admin", "AMI username")
	secret   = flag.String("secret", "admin", "AMI secret")
	host     = flag.String("host", "127.0.0.1:5038", "AMI host address")
)

func main() {
	flag.Parse()

	ctx, cancel := context.WithCancel(context.Background())
	defer cancel()

	socket, err := ami.NewSocket(ctx, *host)
	if err != nil {
		log.Fatalf("socket error: %v\n", err)
	}
	if _, err := ami.Connect(ctx, socket); err != nil {
		log.Fatalf("connect error: %v\n", err)
	}
	//Login
	uuid, _ := ami.GetUUID()
	if err := ami.Login(ctx, socket, *username, *secret, "Off", uuid); err != nil {
		log.Fatalf("login error: %v\n", err)
	}
	fmt.Printf("login ok!\n")

	//Logoff
	fmt.Printf("logoff\n")
	if err := ami.Logoff(ctx, socket, uuid); err != nil {
		log.Fatalf("logoff error: (%v)\n", err)
	}
	fmt.Printf("goodbye !\n")
}

Documentation

This projects documentation can be found on godoc at goami and supports:

License

MIT-LICENSE. See LICENSE or the LICENSE file provided in the repository for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].