Skip to content

Poundbury-Systems/FastAGI-go

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FastAGI-go

Asterisk FastAGI server for GoLang

Install

go get https://github.com/BlayD91/FastAGI-go

Usage

import "time"

func callHandler(r Request) {
	r.SendCommand("ANSWER")

	if r.Params["agi_language"] == "en" {
		r.SendCommand("SET LANG_CODE 1")
	} else {
		r.SendCommand("SET LANG_CODE 0")
	}

	r.SendCommand("HANGUP")
}

func main() {
	server := NewServer(":8000", 10*time.Second, 10*1024)
	err := server.AddRoute("inner_call", callHandler)
	if err != nil {
		panic(err)
	}
	go server.ListenAndServe()

	time.Sleep(10 * time.Second)
}

About

Asterisk FastAGI server for GoLang

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%