ami

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 12, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Stop the playback operation
	Stop AGIControl = "stop"
	// Forward move the current position in the media forward.
	Forward = "forward"
	// Reverse move the current poistion in the media backward.
	Reverse = "reverse"
	// Pause pause/unpause the playback operation.
	Pause = "pause"
	// Restart the playback operation.
	Restart = "restart"
)

Variables

This section is empty.

Functions

func Connect

func Connect(ctx context.Context, client Client) (bool, error)

Connect verify connect response.

func GetUUID

func GetUUID() (string, error)

GetUUID returns a new UUID based on /dev/urandom (unix).

func Login

func Login(ctx context.Context, client Client, user, secret, events, actionID string) error

Login provides the login manager.

func Logoff

func Logoff(ctx context.Context, client Client, actionID string) error

Logoff logoff the current manager session.

func Ping

func Ping(ctx context.Context, client Client, actionID string) error

Ping action will ellicit a 'Pong' response. Used to keep the manager connection open.

Types

type AGIControl

type AGIControl string

AGIControl represents the control type to playback actions

type AOCData

type AOCData struct {
	Channel                   string `ami:"Channel"`
	ChannelPrefix             string `ami:"ChannelPrefix"`
	MsgType                   string `ami:"MsgType"`
	ChargeType                string `ami:"ChargeType"`
	UnitAmount                string `ami:"UnitAmount(0)"`
	UnitType                  string `ami:"UnitType(0)"`
	CurrencyName              string `ami:"CurrencyName"`
	CurrencyAmount            string `ami:"CurrencyAmount"`
	CurrencyMultiplier        string `ami:"CurrencyMultiplier"`
	TotalType                 string `ami:"TotalType"`
	AOCBillingID              string `ami:"AOCBillingId"`
	ChargingAssociationID     string `ami:"ChargingAssociationId"`
	ChargingAssociationNumber string `ami:"ChargingAssociationNumber"`
	ChargingAssociationPlan   string `ami:"ChargingAssociationPlan"`
}

AOCData holds the information to generate an Advice of Charge message on a channel.

Channel - Channel name to generate the AOC message on.
ChannelPrefix -	Partial channel prefix. By using this option one can match the beginning part of a channel name without having to put the entire name in.
				For example if a channel name is SIP/snom-00000001 and this value is set to SIP/snom, then that channel matches and the message will be sent.
				Note however that only the first matched channel has the message sent on it.

MsgType - Defines what type of AOC message to create, AOC-D or AOC-E
	D
	E

ChargeType - Defines what kind of charge this message represents.
	NA
	FREE
	Currency
	Unit

UnitAmount(0) -	This represents the amount of units charged. The ETSI AOC standard specifies that this value along with the optional UnitType value are entries in a list.
				To accommodate this these values take an index value starting at 0 which can be used to generate this list of unit entries.
				For Example, If two unit entires were required this could be achieved by setting the paramter UnitAmount(0)=1234 and UnitAmount(1)=5678.
				Note that UnitAmount at index 0 is required when ChargeType=Unit, all other entries in the list are optional.

UnitType(0) -	Defines the type of unit. ETSI AOC standard specifies this as an integer value between 1 and 16, but this value is left open to accept any positive integer.
				Like the UnitAmount parameter, this value represents a list entry and has an index parameter that starts at 0.
CurrencyName - Specifies the currency's name. Note that this value is truncated after 10 characters.
CurrencyAmount - Specifies the charge unit amount as a positive integer. This value is required when ChargeType==Currency.

CurrencyMultiplier - Specifies the currency multiplier. This value is required when ChargeType==Currency.
	OneThousandth
	OneHundredth
	OneTenth
	One
	Ten
	Hundred
	Thousand

TotalType - Defines what kind of AOC-D total is represented.
	Total
	SubTotal

AOCBillingId - Represents a billing ID associated with an AOC-D or AOC-E message. Note that only the first 3 items of the enum are valid AOC-D billing IDs
	Normal
	ReverseCharge
	CreditCard
	CallFwdUnconditional
	CallFwdBusy
	CallFwdNoReply
	CallDeflection
	CallTransfer

ChargingAssociationId - 	Charging association identifier. This is optional for AOC-E and can be set to any value between -32768 and 32767
ChargingAssociationNumber -	Represents the charging association party number. This value is optional for AOC-E.
ChargingAssociationPlan - 	Integer representing the charging plan associated with the ChargingAssociationNumber.
							The value is bits 7 through 1 of the Q.931 octet containing the type-of-number and numbering-plan-identification fields.

type CallData

type CallData struct {
	Channel       string `ami:"Channel"`
	ExtraChannel  string `ami:"ExtraChannel,omitempty"`
	Exten         string `ami:"Exten"`
	ExtraExten    string `ami:"ExtraExten,omitempty"`
	Context       string `ami:"Context"`
	ExtraContext  string `ami:"ExtraContext,omitempty"`
	Priority      string `ami:"Priority"`
	ExtraPriority string `ami:"ExtraPriority,omitempty"`
}

CallData holds the call data to transfer.

type Client

type Client interface {
	// Connected returns the client status.
	Connected() bool

	// Close closes the client connection.
	Close(ctx context.Context) error

	// Send sends data from client to server.
	Send(message string) error

	// Recv receives a string from server.
	Recv(ctx context.Context) (string, error)
}

Client defines an interface to client socket.

type ExtensionData

type ExtensionData struct {
	Context         string `ami:"Context"`
	Extension       string `ami:"Extension"`
	Priority        string `ami:"Priority,omitempty"`
	Application     string `ami:"Application,omitempty"`
	ApplicationData string `ami:"ApplicationData,omitempty"`
	Replace         string `ami:"Replace,omitempty"`
}

ExtensionData holds the extension data to dialplan.

type KhompSMSData

type KhompSMSData struct {
	Device       string `ami:"Device"`
	Destination  string `ami:"Destination"`
	Confirmation bool   `ami:"Confirmation"`
	Message      string `ami:"Message"`
}

KhompSMSData holds the Khomp SMS information.

type MessageData

type MessageData struct {
	To         string `ami:"To"`
	From       string `ami:"From"`
	Body       string `ami:"Body"`
	Base64Body string `ami:"Base64Body,omitempty"`
	Variable   string `ami:"Variable"`
}

MessageData holds the message data to message send command.

type OriginateData

type OriginateData struct {
	Channel        string   `ami:"Channel,omitempty"`
	Exten          string   `ami:"Exten,omitempty"`
	Context        string   `ami:"Context,omitempty"`
	Priority       int      `ami:"Priority,omitempty"`
	Application    string   `ami:"Application,omitempty"`
	Data           string   `ami:"Data,omitempty"`
	Timeout        int      `ami:"Timeout,omitempty"`
	CallerID       string   `ami:"CallerID,omitempty"`
	Variable       []string `ami:"Variable,omitempty"`
	Account        string   `ami:"Account,omitempty"`
	EarlyMedia     string   `ami:"EarlyMedia,omitempty"`
	Async          string   `ami:"Async,omitempty"`
	Codecs         string   `ami:"Codecs,omitempty"`
	ChannelID      string   `ami:"ChannelId,omitempty"`
	OtherChannelID string   `ami:"OtherChannelId,omitempty"`
}

OriginateData holds information used to originate outgoing calls.

Channel - Channel name to call.
Exten - Extension to use (requires Context and Priority)
Context - Context to use (requires Exten and Priority)
Priority - Priority to use (requires Exten and Context)
Application - Application to execute.
Data - Data to use (requires Application).
Timeout - How long to wait for call to be answered (in ms.).
CallerID - Caller ID to be set on the outgoing channel.
Variable - Channel variable to set, multiple Variable: headers are allowed.
Account - Account code.
EarlyMedia - Set to true to force call bridge on early media.
Async - Set to true for fast origination.
Codecs - Comma-separated list of codecs to use for this call.
ChannelId - Channel UniqueId to be set on the channel.
OtherChannelId - Channel UniqueId to be set on the second local channel.

type QueueData

type QueueData struct {
	Queue          string `ami:"Queue,omitempty"`
	Interface      string `ami:"Interface,omitempty"`
	Penalty        string `ami:"Penalty,omitempty"`
	Paused         string `ami:"Paused,omitempty"`
	MemberName     string `ami:"MemberName,omitempty"`
	StateInterface string `ami:"StateInterface,omitempty"`
	Event          string `ami:"Event,omitempty"`
	UniqueID       string `ami:"UniqueID,omitempty"`
	Message        string `ami:"Message,omitempty"`
	Reason         string `ami:"Reason,omitempty"`
	Members        string `ami:"Members,omitempty"`
	Rules          string `ami:"Rules,omitempty"`
	Parameters     string `ami:"Parameters,omitempty"`
}

QueueData holds to queue calls. used in functions:

QueueAdd, QueueLog, QueuePause,
QueuePenalty, QueueReload, QueueRemove,
QueueReset

type Response

type Response map[string][]string

Response maps a string key to a list of values.

func AGI

func AGI(ctx context.Context, client Client, actionID, channel, agiCommand, agiCommandID string) (Response, error)

AGI add an AGI command to execute by Async AGI.

func AOCMessage

func AOCMessage(ctx context.Context, client Client, actionID string, aocData AOCData) (Response, error)

AOCMessage generates an Advice of Charge message on a channel.

func AbsoluteTimeout

func AbsoluteTimeout(ctx context.Context, client Client, actionID, channel string, timeout int) (Response, error)

AbsoluteTimeout set absolute timeout. Hangup a channel after a certain time. Acknowledges set time with Timeout Set message.

func AgentLogoff

func AgentLogoff(ctx context.Context, client Client, actionID, agent string, soft bool) (Response, error)

AgentLogoff sets an agent as no longer logged in.

func Agents

func Agents(ctx context.Context, client Client, actionID string) ([]Response, error)

Agents lists agents and their status.

func Atxfer

func Atxfer(ctx context.Context, client Client, actionID, channel, exten, context string) (Response, error)

Atxfer attended transfer.

func BlindTransfer

func BlindTransfer(ctx context.Context, client Client, actionID, channel, context, extension string) (Response, error)

BlindTransfer blind transfer channel(s) to the given destination.

func Bridge

func Bridge(ctx context.Context, client Client, actionID, channel1, channel2 string, tone string) (Response, error)

Bridge bridges two channels already in the PBX.

func BridgeDestroy

func BridgeDestroy(ctx context.Context, client Client, actionID, bridgeUniqueID string) (Response, error)

BridgeDestroy destroy a bridge.

func BridgeInfo

func BridgeInfo(ctx context.Context, client Client, actionID, bridgeUniqueID string) (Response, error)

BridgeInfo get information about a bridge.

func BridgeKick

func BridgeKick(ctx context.Context, client Client, actionID, bridgeUniqueID, channel string) (Response, error)

BridgeKick kick a channel from a bridge.

func BridgeList

func BridgeList(ctx context.Context, client Client, actionID, bridgeType string) (Response, error)

BridgeList get a list of bridges in the system.

func BridgeTechnologyList

func BridgeTechnologyList(ctx context.Context, client Client, actionID string) ([]Response, error)

BridgeTechnologyList list available bridging technologies and their statuses.

func BridgeTechnologySuspend

func BridgeTechnologySuspend(ctx context.Context, client Client, actionID, bridgeTechnology string) (Response, error)

BridgeTechnologySuspend suspend a bridging technology.

func BridgeTechnologyUnsuspend

func BridgeTechnologyUnsuspend(ctx context.Context, client Client, actionID, bridgeTechnology string) (Response, error)

BridgeTechnologyUnsuspend unsuspend a bridging technology.

func CancelAtxfer

func CancelAtxfer(ctx context.Context, client Client, actionID, channel string) (Response, error)

CancelAtxfer cancel an attended transfer.

func Challenge

func Challenge(ctx context.Context, client Client, actionID string) (Response, error)

Challenge generates a challenge for MD5 authentication.

func ChangeMonitor

func ChangeMonitor(ctx context.Context, client Client, actionID, channel, file string) (Response, error)

ChangeMonitor changes monitoring filename of a channel. This action may be used to change the file started by a previous 'Monitor' action.

func Command

func Command(ctx context.Context, client Client, actionID, cmd string) (Response, error)

Command executes an Asterisk CLI Command.

func ConfbridgeKick

func ConfbridgeKick(ctx context.Context, client Client, actionID string, conference string, channel string) (Response, error)

ConfbridgeKick removes a specified user from a specified conference.

func ConfbridgeList

func ConfbridgeList(ctx context.Context, client Client, actionID string, conference string) ([]Response, error)

ConfbridgeList lists all users in a particular ConfBridge conference.

func ConfbridgeListRooms

func ConfbridgeListRooms(ctx context.Context, client Client, actionID string) ([]Response, error)

ConfbridgeListRooms lists data about all active conferences.

func ConfbridgeLock

func ConfbridgeLock(ctx context.Context, client Client, actionID string, conference string, channel string) (Response, error)

ConfbridgeLock locks a specified conference.

func ConfbridgeMute

func ConfbridgeMute(ctx context.Context, client Client, actionID string, conference string, channel string) (Response, error)

ConfbridgeMute mutes a specified user in a specified conference.

func ConfbridgeSetSingleVideoSrc

func ConfbridgeSetSingleVideoSrc(ctx context.Context, client Client, actionID string, conference string, channel string) (Response, error)

ConfbridgeSetSingleVideoSrc sets a conference user as the single video source distributed to all other video-capable participants.

func ConfbridgeStartRecord

func ConfbridgeStartRecord(ctx context.Context, client Client, actionID string, conference string, recordFile string) (Response, error)

ConfbridgeStartRecord starts a recording in the context of given conference and creates a file with the name specified by recordFile

func ConfbridgeStopRecord

func ConfbridgeStopRecord(ctx context.Context, client Client, actionID string, conference string) (Response, error)

ConfbridgeStopRecord stops a recording pertaining to the given conference

func ConfbridgeUnlock

func ConfbridgeUnlock(ctx context.Context, client Client, actionID string, conference string, channel string) (Response, error)

ConfbridgeUnlock unlocks a specified conference.

func ConfbridgeUnmute

func ConfbridgeUnmute(ctx context.Context, client Client, actionID string, conference string, channel string) (Response, error)

ConfbridgeUnmute unmutes a specified user in a specified conferene.

func ControlPlayback

func ControlPlayback(ctx context.Context, client Client, actionID, channel string, control AGIControl) (Response, error)

ControlPlayback control the playback of a file being played to a channel.

func CoreSettings

func CoreSettings(ctx context.Context, client Client, actionID string) (Response, error)

CoreSettings shows PBX core settings (version etc).

func CoreShowChannels

func CoreShowChannels(ctx context.Context, client Client, actionID string) ([]Response, error)

CoreShowChannels list currently active channels.

func CoreStatus

func CoreStatus(ctx context.Context, client Client, actionID string) (Response, error)

CoreStatus shows PBX core status variables.

func CreateConfig

func CreateConfig(ctx context.Context, client Client, actionID, filename string) (Response, error)

CreateConfig creates an empty file in the configuration directory. This action will create an empty file in the configuration directory. This action is intended to be used before an UpdateConfig action.

func DAHDIDNDoff

func DAHDIDNDoff(ctx context.Context, client Client, actionID, channel string) (Response, error)

DAHDIDNDoff toggles DAHDI channel Do Not Disturb status OFF.

func DAHDIDNDon

func DAHDIDNDon(ctx context.Context, client Client, actionID, channel string) (Response, error)

DAHDIDNDon toggles DAHDI channel Do Not Disturb status ON.

func DAHDIDialOffhook

func DAHDIDialOffhook(ctx context.Context, client Client, actionID, channel, number string) (Response, error)

DAHDIDialOffhook dials over DAHDI channel while offhook. Generate DTMF control frames to the bridged peer.

func DAHDIHangup

func DAHDIHangup(ctx context.Context, client Client, actionID, channel string) (Response, error)

DAHDIHangup hangups DAHDI Channel.

func DAHDIRestart

func DAHDIRestart(ctx context.Context, client Client, actionID string) (Response, error)

DAHDIRestart fully Restart DAHDI channels (terminates calls).

func DAHDIShowChannels

func DAHDIShowChannels(ctx context.Context, client Client, actionID, channel string) ([]Response, error)

DAHDIShowChannels show status of DAHDI channels.

func DAHDITransfer

func DAHDITransfer(ctx context.Context, client Client, actionID, channel string) (Response, error)

DAHDITransfer transfers DAHDI Channel.

func DBDel

func DBDel(ctx context.Context, client Client, actionID, family, key string) (Response, error)

DBDel Delete DB entry.

func DBDelTree

func DBDelTree(ctx context.Context, client Client, actionID, family, key string) (Response, error)

DBDelTree delete DB tree.

func DBGet

func DBGet(ctx context.Context, client Client, actionID, family, key string) (Response, error)

DBGet gets DB Entry.

func DBPut

func DBPut(ctx context.Context, client Client, actionID, family, key, val string) (Response, error)

DBPut puts DB entry.

func DataGet

func DataGet(ctx context.Context, client Client, actionID, path, search, filter string) (Response, error)

DataGet retrieves the data api tree.

func DeviceStateList

func DeviceStateList(ctx context.Context, client Client, actionID string) ([]Response, error)

DeviceStateList list the current known device states.

func DialplanExtensionAdd

func DialplanExtensionAdd(ctx context.Context, client Client, actionID string, extension ExtensionData) (Response, error)

DialplanExtensionAdd add an extension to the dialplan.

func DialplanExtensionRemove

func DialplanExtensionRemove(ctx context.Context, client Client, actionID string, extension ExtensionData) (Response, error)

DialplanExtensionRemove remove an extension from the dialplan.

func EventFlow

func EventFlow(ctx context.Context, client Client, actionID, eventMask string) (Response, error)

EventFlow control Event Flow. Enable/Disable sending of events to this manager client.

func Events

func Events(ctx context.Context, client Client) (Response, error)

Events gets events from current client connection It is mandatory set 'events' of ami.Login with "system,call,all,user", to received events.

func ExtensionState

func ExtensionState(ctx context.Context, client Client, actionID, exten, context string) (Response, error)

ExtensionState checks extension status.

func ExtensionStateList

func ExtensionStateList(ctx context.Context, client Client, actionID string) ([]Response, error)

ExtensionStateList list the current known extension states.

func FAXSession

func FAXSession(ctx context.Context, client Client, actionID, sessionNumber string) (Response, error)

FAXSession responds with a detailed description of a single FAX session.

func FAXSessions

func FAXSessions(ctx context.Context, client Client, actionID string) ([]Response, error)

FAXSessions list active FAX sessions.

func FAXStats

func FAXStats(ctx context.Context, client Client, actionID string) (Response, error)

FAXStats responds with fax statistics.

func Filter

func Filter(ctx context.Context, client Client, actionID, operation, filter string) (Response, error)

Filter dinamically add filters for the current manager session.

func GetConfig

func GetConfig(ctx context.Context, client Client, actionID, filename, category, filter string) (Response, error)

GetConfig retrieves configuration. This action will dump the contents of a configuration file by category and contents or optionally by specified category only.

func GetConfigJSON

func GetConfigJSON(ctx context.Context, client Client, actionID, filename, category, filter string) (Response, error)

GetConfigJSON retrieves configuration (JSON format). This action will dump the contents of a configuration file by category and contents in JSON format. This only makes sense to be used using rawman over the HTTP interface.

func Getvar

func Getvar(ctx context.Context, client Client, actionID, channel, variable string) (Response, error)

Getvar gets a channel variable.

func Hangup

func Hangup(ctx context.Context, client Client, actionID, channel, cause string) (Response, error)

Hangup hangups channel.

func IAXnetstats

func IAXnetstats(ctx context.Context, client Client, actionID string) ([]Response, error)

IAXnetstats show IAX channels network statistics.

func IAXpeerlist

func IAXpeerlist(ctx context.Context, client Client, actionID string) ([]Response, error)

IAXpeerlist show IAX channels network statistics.

func IAXpeers

func IAXpeers(ctx context.Context, client Client, actionID string) ([]Response, error)

IAXpeers list IAX peers.

func IAXregistry

func IAXregistry(ctx context.Context, client Client, actionID string) ([]Response, error)

IAXregistry show IAX registrations.

func JabberSend

func JabberSend(ctx context.Context, client Client, actionID, jabber, jid, message string) (Response, error)

JabberSend sends a message to a Jabber Client

func KSendSMS

func KSendSMS(ctx context.Context, client Client, actionID string, data KhompSMSData) (Response, error)

KSendSMS sends a SMS using KHOMP device.

func ListCategories

func ListCategories(ctx context.Context, client Client, actionID, filename string) (Response, error)

ListCategories lists categories in configuration file.

func ListCommands

func ListCommands(ctx context.Context, client Client, actionID string) (Response, error)

ListCommands lists available manager commands. Returns the action name and synopsis for every action that is available to the user

func LocalOptimizeAway

func LocalOptimizeAway(ctx context.Context, client Client, actionID, channel string) (Response, error)

LocalOptimizeAway optimize away a local channel when possible. A local channel created with "/n" will not automatically optimize away. Calling this command on the local channel will clear that flag and allow it to optimize away if it's bridged or when it becomes bridged.

func LoggerRotate

func LoggerRotate(ctx context.Context, client Client, actionID string) (Response, error)

LoggerRotate reload and rotate the Asterisk logger.

func MWIDelete

func MWIDelete(ctx context.Context, client Client, actionID, mailbox string) (Response, error)

MWIDelete delete selected mailboxes.

func MWIGet

func MWIGet(ctx context.Context, client Client, actionID, mailbox string) (Response, error)

MWIGet get selected mailboxes with message counts.

func MWIUpdate

func MWIUpdate(ctx context.Context, client Client, actionID, mailbox, oldMessages, newMessages string) (Response, error)

MWIUpdate update the mailbox message counts.

func MailboxCount

func MailboxCount(ctx context.Context, client Client, actionID, mailbox string) (Response, error)

MailboxCount checks Mailbox Message Count.

func MailboxStatus

func MailboxStatus(ctx context.Context, client Client, actionID, mailbox string) (Response, error)

MailboxStatus checks Mailbox Message Count.

func MeetmeList

func MeetmeList(ctx context.Context, client Client, actionID, conference string) ([]Response, error)

MeetmeList lists all users in a particular MeetMe conference. Will follow as separate events, followed by a final event called MeetmeListComplete.

func MeetmeListRooms

func MeetmeListRooms(ctx context.Context, client Client, actionID string) ([]Response, error)

MeetmeListRooms list active conferences.

func MeetmeMute

func MeetmeMute(ctx context.Context, client Client, actionID, meetme, usernum string) (Response, error)

MeetmeMute mute a Meetme user.

func MeetmeUnMute

func MeetmeUnMute(ctx context.Context, client Client, actionID, meetme, usernum string) (Response, error)

MeetmeUnMute unmute a Meetme user.

func MessageSend

func MessageSend(ctx context.Context, client Client, actionID string, message MessageData) (Response, error)

MessageSend send an out of call message to an endpoint.

func MixMonitor

func MixMonitor(ctx context.Context, client Client, actionID, channel, file, options, command string) (Response, error)

MixMonitor record a call and mix the audio during the recording.

func MixMonitorMute

func MixMonitorMute(ctx context.Context, client Client, actionID, channel, direction string, state bool) (Response, error)

MixMonitorMute Mute / unMute a Mixmonitor recording. This action may be used to mute a MixMonitor recording.

func ModuleCheck

func ModuleCheck(ctx context.Context, client Client, actionID, module string) (Response, error)

ModuleCheck checks if module is loaded. Checks if Asterisk module is loaded. Will return Success/Failure. For success returns, the module revision number is included.

func ModuleLoad

func ModuleLoad(ctx context.Context, client Client, actionID, module, loadType string) (Response, error)

ModuleLoad module management. Loads, unloads or reloads an Asterisk module in a running system.

func Monitor

func Monitor(ctx context.Context, client Client, actionID, channel, file, format string, mix bool) (Response, error)

Monitor monitors a channel. This action may be used to record the audio on a specified channel.

func MuteAudio

func MuteAudio(ctx context.Context, client Client, actionID, channel, direction string, state bool) (Response, error)

MuteAudio mute an audio stream.

func Originate

func Originate(ctx context.Context, client Client, actionID string, originate OriginateData) (Response, error)

Originate originates a call. Generates an outgoing call to a Extension/Context/Priority or Application/Data.

func PJSIPNotify

func PJSIPNotify(ctx context.Context, client Client, actionID, endpoint, uri, variable string) (Response, error)

PJSIPNotify send NOTIFY to either an endpoint, an arbitrary URI, or inside a SIP dialog.

func PJSIPQualify

func PJSIPQualify(ctx context.Context, client Client, actionID, endpoint string) (Response, error)

PJSIPQualify qualify a chan_pjsip endpoint.

func PJSIPRegister

func PJSIPRegister(ctx context.Context, client Client, actionID, registration string) (Response, error)

PJSIPRegister register an outbound registration.

func PJSIPShowEndpoint

func PJSIPShowEndpoint(ctx context.Context, client Client, actionID, endpoint string) ([]Response, error)

PJSIPShowEndpoint detail listing of an endpoint and its objects.

func PJSIPShowEndpoints

func PJSIPShowEndpoints(ctx context.Context, client Client, actionID string) ([]Response, error)

PJSIPShowEndpoints list pjsip endpoints.

func PJSIPShowRegistrationInboundContactStatuses

func PJSIPShowRegistrationInboundContactStatuses(ctx context.Context, client Client, actionID string) ([]Response, error)

PJSIPShowRegistrationInboundContactStatuses lists ContactStatuses for PJSIP inbound registrations.

func PJSIPShowRegistrationsInbound

func PJSIPShowRegistrationsInbound(ctx context.Context, client Client, actionID string) ([]Response, error)

PJSIPShowRegistrationsInbound lists PJSIP inbound registrations.

func PJSIPShowRegistrationsOutbound

func PJSIPShowRegistrationsOutbound(ctx context.Context, client Client, actionID string) ([]Response, error)

PJSIPShowRegistrationsOutbound lists PJSIP outbound registrations.

func PJSIPShowResourceLists

func PJSIPShowResourceLists(ctx context.Context, client Client, actionID string) ([]Response, error)

PJSIPShowResourceLists displays settings for configured resource lists.

func PJSIPShowSubscriptionsInbound

func PJSIPShowSubscriptionsInbound(ctx context.Context, client Client, actionID string) ([]Response, error)

PJSIPShowSubscriptionsInbound list of inbound subscriptions.

func PJSIPShowSubscriptionsOutbound

func PJSIPShowSubscriptionsOutbound(ctx context.Context, client Client, actionID string) ([]Response, error)

PJSIPShowSubscriptionsOutbound list of outbound subscriptions.

func PJSIPUnregister

func PJSIPUnregister(ctx context.Context, client Client, actionID, registration string) (Response, error)

PJSIPUnregister unregister an outbound registration.

func PRIDebugFileSet

func PRIDebugFileSet(ctx context.Context, client Client, actionID, filename string) (Response, error)

PRIDebugFileSet set the file used for PRI debug message output.

func PRIDebugFileUnset

func PRIDebugFileUnset(ctx context.Context, client Client, actionID string) (Response, error)

PRIDebugFileUnset disables file output for PRI debug messages.

func PRIDebugSet

func PRIDebugSet(ctx context.Context, client Client, actionID, span, level string) (Response, error)

PRIDebugSet set PRI debug levels for a span.

func PRIShowSpans

func PRIShowSpans(ctx context.Context, client Client, actionID, span string) ([]Response, error)

PRIShowSpans show status of PRI spans.

func Park

func Park(ctx context.Context, client Client, actionID, channel1, channel2 string, timeout int, parkinglot string) (Response, error)

Park parks a channel.

func ParkedCalls

func ParkedCalls(ctx context.Context, client Client, actionID string) ([]Response, error)

ParkedCalls list parked calls.

func Parkinglots

func Parkinglots(ctx context.Context, client Client, actionID string) ([]Response, error)

Parkinglots get a list of parking lots.

func PauseMonitor

func PauseMonitor(ctx context.Context, client Client, actionID, channel string) (Response, error)

PauseMonitor pauses monitoring of a channel. This action may be used to temporarily stop the recording of a channel.

func PlayDTMF

func PlayDTMF(ctx context.Context, client Client, actionID, channel, digit string, duration int) (Response, error)

PlayDTMF plays DTMF signal on a specific channel.

func PresenceState

func PresenceState(ctx context.Context, client Client, actionID, provider string) (Response, error)

PresenceState check presence state.

func PresenceStateList

func PresenceStateList(ctx context.Context, client Client, actionID string) ([]Response, error)

PresenceStateList list the current known presence states.

func QueueAdd

func QueueAdd(ctx context.Context, client Client, actionID string, queueData QueueData) (Response, error)

QueueAdd adds interface to queue.

func QueueLog

func QueueLog(ctx context.Context, client Client, actionID string, queueData QueueData) (Response, error)

QueueLog adds custom entry in queue_log.

func QueueMemberRingInUse

func QueueMemberRingInUse(ctx context.Context, client Client, actionID, iface, ringInUse, queue string) (Response, error)

QueueMemberRingInUse set the ringinuse value for a queue member.

func QueuePause

func QueuePause(ctx context.Context, client Client, actionID string, queueData QueueData) (Response, error)

QueuePause makes a queue member temporarily unavailable.

func QueuePenalty

func QueuePenalty(ctx context.Context, client Client, actionID string, queueData QueueData) (Response, error)

QueuePenalty sets the penalty for a queue member.

func QueueReload

func QueueReload(ctx context.Context, client Client, actionID string, queueData QueueData) (Response, error)

QueueReload reloads a queue, queues, or any sub-section of a queue or queues.

func QueueRemove

func QueueRemove(ctx context.Context, client Client, actionID string, queueData QueueData) (Response, error)

QueueRemove removes interface from queue.

func QueueReset

func QueueReset(ctx context.Context, client Client, actionID, queue string) (Response, error)

QueueReset resets queue statistics.

func QueueRule

func QueueRule(ctx context.Context, client Client, actionID, rule string) (Response, error)

QueueRule queues Rules.

func QueueStatus

func QueueStatus(ctx context.Context, client Client, actionID, queue, member string) (Response, error)

QueueStatus show queue status by member.

func QueueStatuses

func QueueStatuses(ctx context.Context, client Client, actionID, queue string) ([]Response, error)

QueueStatuses show status all members in queue.

func QueueSummary

func QueueSummary(ctx context.Context, client Client, actionID, queue string) ([]Response, error)

QueueSummary show queue summary.

func Redirect

func Redirect(ctx context.Context, client Client, actionID string, call CallData) (Response, error)

Redirect redirects (transfer) a call.

func Reload

func Reload(ctx context.Context, client Client, actionID, module string) (Response, error)

Reload Sends a reload event.

func SIPNotify

func SIPNotify(ctx context.Context, client Client, actionID string, channel string, variable string) (Response, error)

SIPNotify sends a SIP notify

func SIPPeerStatus

func SIPPeerStatus(ctx context.Context, client Client, actionID string, peer string) ([]Response, error)

SIPPeerStatus show the status of one or all of the sip peers.

func SIPPeers

func SIPPeers(ctx context.Context, client Client, actionID string) ([]Response, error)

SIPPeers lists SIP peers in text format with details on current status. Peerlist will follow as separate events, followed by a final event called PeerlistComplete

func SIPQualifyPeer

func SIPQualifyPeer(ctx context.Context, client Client, actionID string, peer string) (Response, error)

SIPQualifyPeer qualify SIP peers.

func SIPShowPeer

func SIPShowPeer(ctx context.Context, client Client, actionID string, peer string) (Response, error)

SIPShowPeer shows one SIP peer with details on current status.

func SIPShowRegistry

func SIPShowRegistry(ctx context.Context, client Client, actionID string) ([]Response, error)

SIPShowRegistry shows SIP registrations (text format).

func SKINNYdevices

func SKINNYdevices(ctx context.Context, client Client, actionID string) ([]Response, error)

SKINNYdevices lists SKINNY devices (text format). Lists Skinny devices in text format with details on current status. Devicelist will follow as separate events, followed by a final event called DevicelistComplete.

func SKINNYlines

func SKINNYlines(ctx context.Context, client Client, actionID string) ([]Response, error)

SKINNYlines lists SKINNY lines (text format). Lists Skinny lines in text format with details on current status. Linelist will follow as separate events, followed by a final event called LinelistComplete.

func SKINNYshowdevice

func SKINNYshowdevice(ctx context.Context, client Client, actionID, device string) (Response, error)

SKINNYshowdevice show SKINNY device (text format). Show one SKINNY device with details on current status.

func SKINNYshowline

func SKINNYshowline(ctx context.Context, client Client, actionID, line string) (Response, error)

SKINNYshowline shows SKINNY line (text format). Show one SKINNY line with details on current status.

func SendText

func SendText(ctx context.Context, client Client, actionID, channel, msg string) (Response, error)

SendText sends text message to channel.

func Setvar

func Setvar(ctx context.Context, client Client, actionID, channel, variable, value string) (Response, error)

Setvar sets a channel variable. Sets a global or local channel variable. Note: If a channel name is not provided then the variable is global.

func ShowDialPlan

func ShowDialPlan(ctx context.Context, client Client, actionID, extension, context string) ([]Response, error)

ShowDialPlan shows dialplan contexts and extensions Be aware that showing the full dialplan may take a lot of capacity.

func SorceryMemoryCacheExpire

func SorceryMemoryCacheExpire(ctx context.Context, client Client, actionID, cache string) (Response, error)

SorceryMemoryCacheExpire expire (remove) all objects from a sorcery memory cache.

func SorceryMemoryCacheExpireObject

func SorceryMemoryCacheExpireObject(ctx context.Context, client Client, actionID, cache, object string) (Response, error)

SorceryMemoryCacheExpireObject expire (remove) an object from a sorcery memory cache.

func SorceryMemoryCachePopulate

func SorceryMemoryCachePopulate(ctx context.Context, client Client, actionID, cache string) (Response, error)

SorceryMemoryCachePopulate expire all objects from a memory cache and populate it with all objects from the backend.

func SorceryMemoryCacheStale

func SorceryMemoryCacheStale(ctx context.Context, client Client, actionID, cache string) (Response, error)

SorceryMemoryCacheStale marks all objects in a sorcery memory cache as stale.

func SorceryMemoryCacheStaleObject

func SorceryMemoryCacheStaleObject(ctx context.Context, client Client, actionID, cache, object string, reload bool) (Response, error)

SorceryMemoryCacheStaleObject mark an object in a sorcery memory cache as stale.

func Status

func Status(ctx context.Context, client Client, actionID, channel, variables string) (Response, error)

Status lists channel status. Will return the status information of each channel along with the value for the specified channel variables.

func StopMixMonitor

func StopMixMonitor(ctx context.Context, client Client, actionID, channel, mixMonitorID string) (Response, error)

StopMixMonitor stop recording a call through MixMonitor, and free the recording's file handle.

func StopMonitor

func StopMonitor(ctx context.Context, client Client, actionID, channel string) (Response, error)

StopMonitor stops monitoring a channel. This action may be used to end a previously started 'Monitor' action.

func UnpauseMonitor

func UnpauseMonitor(ctx context.Context, client Client, actionID, channel string) (Response, error)

UnpauseMonitor unpause monitoring of a channel. This action may be used to re-enable recording of a channel after calling PauseMonitor.

func UpdateConfig

func UpdateConfig(ctx context.Context, client Client, actionID, srcFilename, dstFilename string, reload bool, actions ...UpdateConfigAction) (Response, error)

UpdateConfig Updates a config file. Dynamically updates an Asterisk configuration file.

func VoicemailRefresh

func VoicemailRefresh(ctx context.Context, client Client, actionID, context, mailbox string) (Response, error)

VoicemailRefresh tell asterisk to poll mailboxes for a change.

func VoicemailUsersList

func VoicemailUsersList(ctx context.Context, client Client, actionID string) ([]Response, error)

VoicemailUsersList list all voicemail user information.

func (Response) Get

func (r Response) Get(key string) string

Get gets the first value associated with the given key.

type Socket

type Socket struct {
	// contains filtered or unexported fields
}

Socket holds the socket client connection data.

func NewSocket

func NewSocket(ctx context.Context, address string) (*Socket, error)

NewSocket provides a new socket client, connecting to a tcp server.

func (*Socket) Close

func (s *Socket) Close(ctx context.Context) error

Close closes socket connection.

func (*Socket) Connected

func (s *Socket) Connected() bool

Connected returns the socket status, true for connected, false for disconnected.

func (*Socket) Recv

func (s *Socket) Recv(ctx context.Context) (string, error)

Recv receives a string from socket server.

func (*Socket) Send

func (s *Socket) Send(message string) error

Send sends data to socket using fprintf format.

type UpdateConfigAction

type UpdateConfigAction struct {
	Action   string `ami:"Action"`
	Category string `ami:"Category"`
	Var      string `ami:"Var,omitempty"`
	Value    string `ami:"Value,omitempty"`
}

UpdateConfigAction holds the params for an action in UpdateConfig AMI command.

example

actions := make([]ami.UpdateConfigAction, 0)
actions = append(actions, ami.UpdateConfigAction{
	Action:   "EmptyCat",
	Category: "test01",
})
actions = append(actions, ami.UpdateConfigAction{
	Action:   "Append",
	Category: "test01",
	Var:      "type",
	Value:    "peer",
})

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL