Documentation ¶
Overview ¶
Asterisk Gateway Interface support
Usage:
a := agi.NewAgi() r := a.Answer() checkErr(r.Err) ... r = a.Noop("Hello New Chan") ... r = a.SayAlpha("Hi") ... r, status := a.ChannelStatus() ... r.Hangup()
Index ¶
- type Agi
- func (a *Agi) Answer() *Resp
- func (a *Agi) ChannelStatus() (*Resp, int)
- func (a *Agi) DBDel(familiy, key string) *Resp
- func (a *Agi) DBDelTree(family string) *Resp
- func (a *Agi) DBGet(family, key string) (*Resp, string)
- func (a *Agi) DBPut(family, key, val string) *Resp
- func (a *Agi) Exec(cmd Cmd, args ...string) *Resp
- func (a *Agi) GetVariable(name string) (*Resp, string)
- func (a *Agi) Hangup() *Resp
- func (a *Agi) Noop(args ...string) *Resp
- func (a *Agi) SayAlpha(str string) *Resp
- func (a *Agi) SayDateTime(unixtime int64, format string) *Resp
- func (a *Agi) SayDigits(num int) *Resp
- func (a *Agi) SendText(text string) *Resp
- func (a *Agi) SetContext(ctx string) *Resp
- func (a *Agi) SetExtension(ext string) *Resp
- func (a *Agi) SetPripority(pr string) *Resp
- func (a *Agi) SetVariable(name, val string) *Resp
- func (a *Agi) WaitForDigit(wait int) (*Resp, int)
- type Cmd
- type Resp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Agi ¶
type Agi struct { Env map[string]string // AGI environment variables // contains filtered or unexported fields }
main agi struct
func (*Agi) GetVariable ¶
get channel variable
func (*Agi) SayDateTime ¶
say datetime
func (*Agi) SetPripority ¶
set channel priority for exten
type Cmd ¶
type Cmd string
AGI command
const ( Answer Cmd = "ANSWER" Noop Cmd = "NOOP" Hangup Cmd = "HANGUP" ChannelStatus Cmd = "CHANNEL STATUS" SayAlpha Cmd = "SAY ALPHA" SayDigits Cmd = "SAY DIGITS" SayNumber Cmd = "SAY NUMBER" SayDate Cmd = "SAY DATE" SayTime Cmd = "SAY TIME" SayDateTime Cmd = "SAY DATETIME" WaitForDigit Cmd = "WAIT FOR DIGIT" GetVariable Cmd = "GET VARIABLE" SetVariable Cmd = "SET VARIABLE" SetCallerId Cmd = "SET CALLERID" SetContext Cmd = "SET CONTEXT" SetExtension Cmd = "SET EXTENSION" SetPripority Cmd = "SET PRIORITY" SendText Cmd = "SEND TEXT" DBDel Cmd = "DATABASE DEL" DBDelTree Cmd = "DATABASE DELTREE" DBGet Cmd = "DATABASE GET" DBPut Cmd = "DATABASE PUT" )
supported commands
Click to show internal directories.
Click to hide internal directories.