Documentation ¶
Index ¶
Constants ¶
View Source
const ( // KindHangup indicates the message is a hangup signal KindHangup = 0x00 // KindID indicates the message contains the unique identifier of the call KindID = 0x01 // KindSilence indicates the presence of silence on the line KindDTMF = 0x02 // Payload is AST_CONTROL_ KindASTControl = 0x03 // KindSlin indicates the message contains signed-linear audio data KindSlin = 0x10 // KindError indicates the message contains an error code KindError = 0xff )
View Source
const ( // ErrNone indicates that no error is present ErrNone = 0x00 // ErrAstHangup indicates that the call has hung up ErrAstHangup = 0x01 // ErrAstFrameForwarding indicates that Asterisk had an error trying to forward an audio frame ErrAstFrameForwarding = 0x02 // ErrAstMemory indicates that Asterisk had a memory/allocation erorr ErrAstMemory = 0x04 )
View Source
const DefaultSlinChunkSize = 320 // 8000Hz * 20ms * 2 bytes
DefaultSlinChunkSize is the number of bytes which should be sent per slin AudioSocket message. Larger data will be chunked into this size for transmission of the AudioSocket.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Message ¶
type Message []byte
Message describes an audiosocket message/packet
func HangupMessage ¶
func HangupMessage() Message
HangupMessage creates a new Message indicating a hangup
func MessageFromData ¶
MessageFromData parses an audiosocket message into a Message
func NextMessage ¶
NextMessage reads and parses the next message from an audiosocket connection
func SlinMessage ¶
SlinMessage creates a new Message from signed linear audio data
func (Message) ContentLength ¶
ContentLength returns the length of the payload of the message
Click to show internal directories.
Click to hide internal directories.