Versions in this module Expand all Collapse all v1 v1.4.3 Feb 12, 2023 Changes in this version + const EndOfMessage + const EventListenAll + const TypeAPIResponse + const TypeAuthRequest + const TypeDisconnect + const TypeEventJSON + const TypeEventPlain + const TypeEventXML + const TypeReply + var DefaultInboundOptions = InboundOptions + var DefaultOptions = Options + var DefaultOutboundOptions = OutboundOptions + func BuildVars(format string, vars map[string]string) string + func ListenAndServe(address string, handler OutboundHandler) error + type Conn struct + func Dial(address, password string, onDisconnect func()) (*Conn, error) + func (c *Conn) AnswerCall(ctx context.Context, uuid string) error + func (c *Conn) Close() + func (c *Conn) DebugEvents(w io.Writer) string + func (c *Conn) DebugOff(id string) + func (c *Conn) EnableEvents(ctx context.Context, formats ...string) error + func (c *Conn) EnterpriseOriginateCall(ctx context.Context, background bool, vars map[string]string, bLeg Leg, ...) (*RawResponse, error) + func (c *Conn) ExitAndClose() + func (c *Conn) HangupCall(ctx context.Context, uuid, cause string) error + func (c *Conn) OriginateCall(ctx context.Context, background bool, aLeg, bLeg Leg, vars map[string]string) (*RawResponse, error) + func (c *Conn) Phrase(ctx context.Context, uuid, macro string, times int, wait bool) (*RawResponse, error) + func (c *Conn) PhraseWithArg(ctx context.Context, uuid, macro string, argument interface{}, times int, ...) (*RawResponse, error) + func (c *Conn) Playback(ctx context.Context, uuid, audioArgs string, times int, wait bool) (*RawResponse, error) + func (c *Conn) RegisterEventListener(channelUUID string, listener EventListener) string + func (c *Conn) RemoveEventListener(channelUUID string, id string) + func (c *Conn) Say(ctx context.Context, uuid, audioArgs string, times int, wait bool) (*RawResponse, error) + func (c *Conn) SendCommand(ctx context.Context, command command.Command) (*RawResponse, error) + func (c *Conn) Speak(ctx context.Context, uuid, audioArgs string, times int, wait bool) (*RawResponse, error) + func (c *Conn) WaitForDTMF(ctx context.Context, uuid string) (byte, error) + type Event struct + Body []byte + Headers textproto.MIMEHeader + func (e Event) GetHeader(header string) string + func (e Event) GetName() string + func (e Event) GoString() string + func (e Event) HasHeader(header string) bool + func (e Event) String() string + type EventListener func(event *Event) + type InboundOptions struct + AuthTimeout time.Duration + Network string + OnDisconnect func() + Password string + func (opts InboundOptions) Dial(address string) (*Conn, error) + type Leg struct + CallURL string + LegVariables map[string]string + func (l Leg) String() string + type Logger interface + Debug func(format string, args ...interface{}) + Error func(format string, args ...interface{}) + Info func(format string, args ...interface{}) + Warn func(format string, args ...interface{}) + type NilLogger struct + func (l NilLogger) Debug(string, ...interface{}) + func (l NilLogger) Error(string, ...interface{}) + func (l NilLogger) Info(string, ...interface{}) + func (l NilLogger) Warn(string, ...interface{}) + type NormalLogger struct + func (l NormalLogger) Debug(format string, args ...interface{}) + func (l NormalLogger) Error(format string, args ...interface{}) + func (l NormalLogger) Info(format string, args ...interface{}) + func (l NormalLogger) Warn(format string, args ...interface{}) + type Options struct + Context context.Context + ExitTimeout time.Duration + Logger Logger + type OutboundHandler func(ctx context.Context, conn *Conn, connectResponse *RawResponse) + type OutboundOptions struct + ConnectTimeout time.Duration + ConnectionDelay time.Duration + Network string + func (opts OutboundOptions) ListenAndServe(address string, handler OutboundHandler) error + type RawResponse struct + Body []byte + Headers textproto.MIMEHeader + func (r RawResponse) ChannelUUID() string + func (r RawResponse) GetHeader(header string) string + func (r RawResponse) GetReply() string + func (r RawResponse) GetVariable(variable string) string + func (r RawResponse) GoString() string + func (r RawResponse) HasHeader(header string) bool + func (r RawResponse) IsOk() bool + func (r RawResponse) String() string v1.4.2-1 Feb 12, 2023