Versions in this module Expand all Collapse all v1 v1.9.2-rc1 Mar 12, 2024 v1.9.1 Feb 26, 2024 Changes in this version + const EndOfMessage + const EventListenAll + const TypeAPIResponse + const TypeAuthRequest + const TypeDisconnect + const TypeEventJSON + const TypeEventPlain + const TypeEventXML + const TypeReply + func BuildVars(format string, vars map[string]string) string + func ListenAndServe(address string, handler OutboundHandler, opts *Options) error + type Channels struct + func (c *Channels) ApiResponseChannel() chan *RawResponse + func (c *Channels) AuthRequestChannel() chan *RawResponse + func (c *Channels) ByType(channelType string) chan *RawResponse + func (c *Channels) Close() + func (c *Channels) DisconnectChannel() chan *RawResponse + func (c *Channels) EventJsonChannel() chan *RawResponse + func (c *Channels) EventPlainChannel() chan *RawResponse + func (c *Channels) EventXmlChannel() chan *RawResponse + func (c *Channels) ReplyChannel() chan *RawResponse + type Conn struct + func Dial(address, password string, timeout time.Duration, onDisconnect func(string), ...) (*Conn, error) + func NewConnection(c net.Conn, outbound bool, logger zerolog.Logger, connectionId string, ...) *Conn + func (c *Conn) AnswerCall(ctx context.Context, uuid string) error + func (c *Conn) ApiResponseChannel() chan *RawResponse + func (c *Conn) AuthRequestChannel() chan *RawResponse + func (c *Conn) Close() + func (c *Conn) ConnectionId() string + func (c *Conn) DebugEvents(w io.Writer) string + func (c *Conn) DebugOff(id string) + func (c *Conn) DisconnectChannel() chan *RawResponse + func (c *Conn) EnableEvents(ctx context.Context) error + func (c *Conn) EnterpriseOriginateCall(ctx context.Context, background bool, vars map[string]string, bLeg Leg, ...) (*RawResponse, error) + func (c *Conn) EventJsonChannel() chan *RawResponse + func (c *Conn) EventPlainChannel() chan *RawResponse + func (c *Conn) EventXmlChannel() chan *RawResponse + func (c *Conn) ExitAndClose() + func (c *Conn) FinishedChannel() chan bool + 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) Outbound() bool + 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) ReplyChannel() chan *RawResponse + func (c *Conn) RunningContext() context.Context + 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) SetFinishedChannel(finishedChannel chan bool) + 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 Leg struct + CallURL string + LegVariables map[string]string + func (l Leg) String() string + type Options struct + Logger zerolog.Logger + Network string + OnDisconnect func(string) + Timeout time.Duration + func NewOptions(network string, timout time.Duration, logger zerolog.Logger, ...) *Options + type OutboundHandler func(ctx context.Context, conn *Conn, connectResponse *RawResponse) + 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