Documentation
¶
Index ¶
Constants ¶
View Source
const ( HTTP_POST = "POST" HTTP_GET = "GET" HTTP_DELETE = "DELETE" )
Variables ¶
View Source
var (
ErrZeroConnectAttempts = errors.New("ZERO_CONNECT_ATTEMPTS")
)
Functions ¶
Types ¶
type ARInGO ¶
type ARInGO struct {
// contains filtered or unexported fields
}
ARInGO represents one ARI connection/application
func NewARInGO ¶
func NewARInGO(wsUrl, wsOrigin, username, password, userAgent string, evChannel chan map[string]interface{}, errChannel chan error, stopChan <-chan struct{}, connectAttempts, reconnects int, maxReconnectInterval time.Duration, delayFunc func(time.Duration, time.Duration) func() time.Duration) (ari *ARInGO, err error)
type ARInGOV1 ¶
type ARInGOV1 struct {
// contains filtered or unexported fields
}
ARInGOV1 represents one ARI connection/application
func NewARInGOV1 ¶
func NewARInGOV1(wsUrl, wsOrigin, username, password, address, userAgent string, evChannel chan map[string]interface{}, errChannel chan error, stopChan <-chan struct{}, connectAttempts, reconnects int, maxReconnectInterval time.Duration, delayFunc func(time.Duration, time.Duration) func() time.Duration) (ari *ARInGOV1, err error)
func (*ARInGOV1) Call ¶
func (ari *ARInGOV1) Call(method, uri string, queryStr map[string]string, bodyParams map[string]string) (reply RESTResponse, err error)
Call represents one REST call to Asterisk using httpClient call If there is a reply from Asterisk it should be in form map[string]interface{}
type QueryString ¶
type RESTRequest ¶
type RESTRequest struct {
Type string `json:"type"` // must be "RESTRequest"
TransactionID string `json:"transaction_id,omitempty"`
RequestID string `json:"request_id"`
Method string `json:"method"`
URI string `json:"uri"`
ContentType string `json:"content_type,omitempty"`
QueryStrings []QueryString `json:"query_strings,omitempty"`
}
RESTRequest represents an ARI REST-over-WebSocket request envelope.
type RESTResponse ¶
type RESTResponse struct {
Type string `json:"type"`
TransactionID string `json:"transaction_id,omitempty"`
RequestID string `json:"request_id"`
StatusCode int `json:"status_code"`
ReasonPhrase string `json:"reason_phrase,omitempty"`
ContentType string `json:"content_type,omitempty"`
Uri string `json:"uri,omitempty"`
MessageBody string `json:"message_body,omitempty"`
Timestamp string `json:"timestamp,omitempty"`
AsteriskID string `json:"asterisk_id,omitempty"`
Application string `json:"application,omitempty"`
}
RESTResponse represents an ARI REST-over-WebSocket response envelope.
Click to show internal directories.
Click to hide internal directories.