Skip to content

Latest commit

 

History

History
44 lines (33 loc) · 742 Bytes

README.md

File metadata and controls

44 lines (33 loc) · 742 Bytes

Amichan package

Simple wrapper for https://github.com/ivahaev/amigo with channels for errors and events

If you need more than just get errors and events from Asterisk, please see original repository, there is much more power

Installation

go get github.com/kcasctiv/amichan

Maybe you will need also install amigo manually:

go get github.com/ivahaev/amigo

Usage

package main

import (
	"fmt"

	"github.com/kcasctiv/amichan"
)

func main() {
	port := 7080
	keepalive := true
	a := amichan.New("username", "password", "localhost", port, keepalive)
	a.Connect()

	for {
		select {
		case err := <-a.Err():
			fmt.Println(err)
		case event := <-a.Event():
			fmt.Println(event.Name())
		}
	}
}