Documentation
¶
Index ¶
- Constants
- Variables
- func BuildDTMFRelayBody(signal string, durationMS int) ([]byte, error)
- func BuildGoodbye(sources []uint32, reason string) *rtcp.Goodbye
- func BuildRTPDTMFPacket(in RTPDTMFPacket) ([]byte, error)
- func BuildRTPDTMFSequence(cfg RTPDTMFSequenceConfig) ([][]byte, error)
- func BuildReceiverReport(senderSSRC uint32, stats []RTPStreamStats) *rtcp.ReceiverReport
- func BuildSDPAnswer(info SDPInfo) []byte
- func BuildSDPAnswerWithOptions(info SDPInfo, options SDPAnswerOptions) []byte
- func BuildSDPAnswerWithSecurity(info SDPInfo, security SDPSecurityInfo) []byte
- func BuildSDPCryptoInlineKeyParams(profile SRTPProtectionProfile, params SDPCryptoInlineKeyParams) (string, error)
- func BuildSDPFmtpParameters(params map[string]string) string
- func BuildSenderReport(cfg RTCPSenderReportConfig) *rtcp.SenderReport
- func BuildSourceDescription(cfg RTCPSourceDescriptionConfig) *rtcp.SourceDescription
- func NormalizeDTMFSignal(signal string) (string, error)
- func NormalizeRTPDTMFSignal(signal string) (string, error)
- func ParseDTMFRelayBody(body []byte) (signal string, durationMS int, err error)
- func ParseSDPCryptoAttributeKeys(attr SDPCryptoAttribute) (SRTPProtectionProfile, SDPCryptoInlineKeyParams, error)
- func ParseSDPFmtpParameters(fmtp string) map[string]string
- func ParseSDPWithSecurity(body []byte) (SDPInfo, SDPSecurityInfo, error)
- func RTPDTMFEventCode(signal string) (uint8, error)
- func RTPDTMFSignalFromEventCode(code uint8) string
- func RewriteRTPDTMFPayloadType(packet []byte, sourcePayloadTypes, targetPayloadTypes map[uint8]int) ([]byte, bool, error)
- func RewriteSDPMediaDirection(body []byte, direction string) ([]byte, error)
- func RewriteSDPMediaEndpoint(body []byte, endpoint SDPInfo) []byte
- func RewriteSDPMediaEndpointWithOptions(body []byte, endpoint SDPInfo, options SDPMediaRewriteOptions) []byte
- func RewriteSDPRTCPFeedback(body []byte, feedback []SDPRTCPFeedbackAttribute) []byte
- func SelectSDPAnswerDirection(offerDirection, localDirection string) (string, error)
- func SelectSDPAnswerPacketizationTime(offer, local SDPInfo) (int, int)
- func SelectSDPCryptoAttribute(crypto []SDPCryptoAttribute, preferred []SRTPProtectionProfile) (SDPCryptoAttribute, SRTPProtectionProfile, SDPCryptoInlineKeyParams, bool, ...)
- func SelectSDPSetupAnswer(offerSetup, preferred string) (string, error)
- func ValidateSDPCryptoAttribute(attr SDPCryptoAttribute) error
- type Agent
- type ClientAdapter
- type DialogAutoDTMFResult
- type DialogAutoDTMFSender
- type DialogCanceller
- type DialogCancellerWithResult
- type DialogDTMFRequest
- type DialogDTMFResult
- type DialogDTMFSender
- type DialogHoldController
- type DialogHoldRequest
- type DialogInfo
- type DialogInfoRequest
- type DialogInfoResult
- type DialogInfoSender
- type DialogMessageRequest
- type DialogMessageResult
- type DialogMessageSender
- type DialogNotifyRequest
- type DialogNotifyResult
- type DialogNotifySender
- type DialogOptionsRequest
- type DialogOptionsResult
- type DialogOptionsSender
- type DialogPrackRequest
- type DialogPrackResult
- type DialogPrackSender
- type DialogRTPDTMFRequest
- type DialogRTPDTMFResult
- type DialogRTPDTMFSender
- type DialogReferRequest
- type DialogReferResult
- type DialogReferSender
- type DialogReinviteRequest
- type DialogReinviteResult
- type DialogReinviter
- type DialogResumeRequest
- type DialogState
- type DialogSubscribeRequest
- type DialogSubscribeResult
- type DialogSubscribeSender
- type DialogTerminator
- type DialogTerminatorWithResult
- type DialogUpdateRequest
- type DialogUpdateResult
- type DialogUpdater
- type Gateway
- func (g *Gateway) DeviceStatus(deviceID string) map[string]interface{}
- func (g *Gateway) GetAgent(deviceID string) Agent
- func (g *Gateway) HandleClientAck(deviceID string, req *sip.Request, tx sip.ServerTransaction)
- func (g *Gateway) HandleClientBye(deviceID string, req *sip.Request, tx sip.ServerTransaction)
- func (g *Gateway) HandleClientCancel(deviceID string, req *sip.Request, tx sip.ServerTransaction)
- func (g *Gateway) HandleClientInfo(deviceID string, req *sip.Request, tx sip.ServerTransaction)
- func (g *Gateway) HandleClientInvite(deviceID string, req *sip.Request, tx sip.ServerTransaction)
- func (g *Gateway) HandleClientMessage(deviceID string, req *sip.Request, tx sip.ServerTransaction)
- func (g *Gateway) HandleClientNotify(deviceID string, req *sip.Request, tx sip.ServerTransaction)
- func (g *Gateway) HandleClientOptions(deviceID string, req *sip.Request, tx sip.ServerTransaction)
- func (g *Gateway) HandleClientPrack(deviceID string, req *sip.Request, tx sip.ServerTransaction)
- func (g *Gateway) HandleClientRefer(deviceID string, req *sip.Request, tx sip.ServerTransaction)
- func (g *Gateway) HandleClientSubscribe(deviceID string, req *sip.Request, tx sip.ServerTransaction)
- func (g *Gateway) HandleClientUpdate(deviceID string, req *sip.Request, tx sip.ServerTransaction)
- func (g *Gateway) RegisterAgent(deviceID string, agent Agent)
- func (g *Gateway) SetClientAdapter(a ClientAdapter)
- func (g *Gateway) SetNotifier(n any)
- func (g *Gateway) SimulateCall(ctx context.Context, deviceID string, req SimulateCallRequest) (SimulateCallResult, error)
- func (g *Gateway) Start(ctx context.Context) error
- func (g *Gateway) Stop() error
- type IMSByeHandler
- type IMSByeHandlerFunc
- type IMSByeRequest
- type IMSByeResult
- type IMSInboundAgent
- func (a *IMSInboundAgent) AckInboundCall(ctx context.Context, info DialogInfo) error
- func (a *IMSInboundAgent) CancelInboundCall(ctx context.Context, info DialogInfo) error
- func (a *IMSInboundAgent) CancelInboundCallWithResult(ctx context.Context, info DialogInfo) (DialogInfoResult, error)
- func (a *IMSInboundAgent) EndInboundCall(ctx context.Context, info DialogInfo) error
- func (a *IMSInboundAgent) EndInboundCallWithResult(ctx context.Context, info DialogInfo) (DialogInfoResult, error)
- func (a *IMSInboundAgent) HandleInboundInfo(ctx context.Context, req IMSInfoRequest) (IMSInfoResult, error)
- func (a *IMSInboundAgent) HandleInboundInvite(ctx context.Context, req InboundCallRequest) (InboundCallResult, error)
- func (a *IMSInboundAgent) HandleInboundMessage(ctx context.Context, req IMSMessageRequest) (IMSInfoResult, error)
- func (a *IMSInboundAgent) HandleInboundNotify(ctx context.Context, req InboundDialogRequest) (IMSInfoResult, error)
- func (a *IMSInboundAgent) HandleInboundPrack(ctx context.Context, req InboundDialogRequest) (InboundCallResult, error)
- func (a *IMSInboundAgent) HandleInboundRefer(ctx context.Context, req InboundDialogRequest) (InboundCallResult, error)
- func (a *IMSInboundAgent) HandleInboundSubscribe(ctx context.Context, req InboundDialogRequest) (IMSInfoResult, error)
- func (a *IMSInboundAgent) HandleInboundUpdate(ctx context.Context, req InboundDialogRequest) (InboundCallResult, error)
- func (a *IMSInboundAgent) SendDialogRTPDTMF(ctx context.Context, req DialogRTPDTMFRequest) (DialogRTPDTMFResult, error)
- type IMSInboundRequireOptionClassification
- type IMSInboundWireResponse
- type IMSInboundWireServer
- func (s *IMSInboundWireServer) CachedTransactionSnapshot(req voiceclient.SIPIncomingRequest) (IMSInboundWireTransactionSnapshot, bool)
- func (s *IMSInboundWireServer) HandleRequest(ctx context.Context, req voiceclient.SIPIncomingRequest) ([]IMSInboundWireResponse, error)
- func (s *IMSInboundWireServer) ServeListener(ctx context.Context, ln net.Listener) error
- func (s *IMSInboundWireServer) ServePacket(ctx context.Context, pc net.PacketConn) error
- type IMSInboundWireTransactionSnapshot
- type IMSInfoHandler
- type IMSInfoHandlerFunc
- type IMSInfoRequest
- type IMSInfoResult
- type IMSMessageHandler
- type IMSMessageHandlerFunc
- type IMSMessageRequest
- type IMSMessageResult
- type IMSOutboundAgent
- func (a *IMSOutboundAgent) CancelVoiceCall(ctx context.Context, info DialogInfo) error
- func (a *IMSOutboundAgent) CancelVoiceCallWithResult(ctx context.Context, info DialogInfo) (DialogInfoResult, error)
- func (a *IMSOutboundAgent) EndVoiceCall(ctx context.Context, info DialogInfo) error
- func (a *IMSOutboundAgent) EndVoiceCallWithResult(ctx context.Context, info DialogInfo) (DialogInfoResult, error)
- func (a *IMSOutboundAgent) SendDialogDTMF(ctx context.Context, req DialogDTMFRequest) (DialogDTMFResult, error)
- func (a *IMSOutboundAgent) SendDialogHold(ctx context.Context, req DialogHoldRequest) (DialogUpdateResult, error)
- func (a *IMSOutboundAgent) SendDialogInfo(ctx context.Context, req DialogInfoRequest) (DialogInfoResult, error)
- func (a *IMSOutboundAgent) SendDialogMessage(ctx context.Context, req DialogMessageRequest) (DialogMessageResult, error)
- func (a *IMSOutboundAgent) SendDialogNotify(ctx context.Context, req DialogNotifyRequest) (DialogNotifyResult, error)
- func (a *IMSOutboundAgent) SendDialogOptions(ctx context.Context, req DialogOptionsRequest) (DialogOptionsResult, error)
- func (a *IMSOutboundAgent) SendDialogPrack(ctx context.Context, req DialogPrackRequest) (DialogPrackResult, error)
- func (a *IMSOutboundAgent) SendDialogRTPDTMF(ctx context.Context, req DialogRTPDTMFRequest) (DialogRTPDTMFResult, error)
- func (a *IMSOutboundAgent) SendDialogRefer(ctx context.Context, req DialogReferRequest) (DialogReferResult, error)
- func (a *IMSOutboundAgent) SendDialogReinvite(ctx context.Context, req DialogReinviteRequest) (DialogReinviteResult, error)
- func (a *IMSOutboundAgent) SendDialogResume(ctx context.Context, req DialogResumeRequest) (DialogUpdateResult, error)
- func (a *IMSOutboundAgent) SendDialogSubscribe(ctx context.Context, req DialogSubscribeRequest) (DialogSubscribeResult, error)
- func (a *IMSOutboundAgent) SendDialogUpdate(ctx context.Context, req DialogUpdateRequest) (DialogUpdateResult, error)
- func (a *IMSOutboundAgent) StartOutboundCall(ctx context.Context, req OutboundCallRequest) (OutboundCallResult, error)
- func (a *IMSOutboundAgent) StopSessionTimers()
- func (a *IMSOutboundAgent) UpdateIMSRegistration(update IMSRegistrationUpdate)
- type IMSRegistrationUpdate
- type IMSRegistrationUpdater
- type InboundCallRequest
- type InboundCallResult
- type InboundDialogRequest
- type OutboundCallAgent
- type OutboundCallRequest
- type OutboundCallResult
- type RTCPFeedbackDirection
- type RTCPFeedbackEvent
- type RTCPFeedbackHandler
- type RTCPFeedbackKind
- type RTCPFeedbackSummary
- type RTCPReceptionReport
- type RTCPReportKind
- type RTCPSenderReportConfig
- type RTCPSourceDescriptionConfig
- type RTPDTMFDirection
- type RTPDTMFEvent
- type RTPDTMFHandler
- type RTPDTMFPacket
- type RTPDTMFSequenceConfig
- type RTPDTMFSummary
- type RTPPlaintextEvent
- type RTPPlaintextHandler
- type RTPRelayConfig
- type RTPRelayDTMFRequest
- type RTPRelayDTMFResult
- type RTPRelayDirectionQuality
- type RTPRelayQualityAction
- type RTPRelayQualityConfig
- type RTPRelayQualityEvent
- type RTPRelayQualityHandler
- type RTPRelayQualityStats
- type RTPRelayRTCPReportDiagnosis
- type RTPRelayRTCPReportJitterDiagnosis
- type RTPRelayRTCPReportLossDiagnosis
- type RTPRelayRTCPReportQuality
- type RTPRelayRTCPReportRoundTripTimeDiagnosis
- type RTPRelayRTCPReportScheduleConfig
- type RTPRelayRTCPRequest
- type RTPRelayRTCPResult
- type RTPRelayReceiverReportRequest
- type RTPRelaySRTPConfig
- type RTPRelaySenderReportRequest
- type RTPRelaySession
- func (s *RTPRelaySession) ClientAnswerSDP(imsAnswer SDPInfo) []byte
- func (s *RTPRelaySession) ClientEndpoint() SDPInfo
- func (s *RTPRelaySession) ClientToIMSRTPStreamStats() []RTPStreamStats
- func (s *RTPRelaySession) Close() error
- func (s *RTPRelaySession) HasRTCPReportSchedule() bool
- func (s *RTPRelaySession) IMSEndpoint() SDPInfo
- func (s *RTPRelaySession) IMSOfferSDP(clientOffer SDPInfo) []byte
- func (s *RTPRelaySession) IMSToClientRTPStreamStats() []RTPStreamStats
- func (s *RTPRelaySession) ObserveRTPPlaintext(event RTPPlaintextEvent)
- func (s *RTPRelaySession) Quality() RTPRelayQualityStats
- func (s *RTPRelaySession) RTPPlaintextHandler() RTPPlaintextHandler
- func (s *RTPRelaySession) SendRTCP(ctx context.Context, req RTPRelayRTCPRequest) (RTPRelayRTCPResult, error)
- func (s *RTPRelaySession) SendRTCPToClient(ctx context.Context, packets ...rtcp.Packet) (RTPRelayRTCPResult, error)
- func (s *RTPRelaySession) SendRTCPToIMS(ctx context.Context, packets ...rtcp.Packet) (RTPRelayRTCPResult, error)
- func (s *RTPRelaySession) SendRTPDTMF(ctx context.Context, req RTPRelayDTMFRequest) (RTPRelayDTMFResult, error)
- func (s *RTPRelaySession) SendRTPDTMFToClient(ctx context.Context, req RTPRelayDTMFRequest) (RTPRelayDTMFResult, error)
- func (s *RTPRelaySession) SendRTPDTMFToIMS(ctx context.Context, req RTPRelayDTMFRequest) (RTPRelayDTMFResult, error)
- func (s *RTPRelaySession) SendReceiverReport(ctx context.Context, req RTPRelayReceiverReportRequest) (RTPRelayRTCPResult, error)
- func (s *RTPRelaySession) SendReceiverReportToClient(ctx context.Context, senderSSRC uint32) (RTPRelayRTCPResult, error)
- func (s *RTPRelaySession) SendReceiverReportToIMS(ctx context.Context, senderSSRC uint32) (RTPRelayRTCPResult, error)
- func (s *RTPRelaySession) SendSenderReport(ctx context.Context, req RTPRelaySenderReportRequest) (RTPRelayRTCPResult, error)
- func (s *RTPRelaySession) SendSenderReportToClient(ctx context.Context, req RTPRelaySenderReportRequest) (RTPRelayRTCPResult, error)
- func (s *RTPRelaySession) SendSenderReportToIMS(ctx context.Context, req RTPRelaySenderReportRequest) (RTPRelayRTCPResult, error)
- func (s *RTPRelaySession) SetClientRemote(info SDPInfo) error
- func (s *RTPRelaySession) SetIMSRemote(info SDPInfo) error
- func (s *RTPRelaySession) SetTransforms(transforms RTPRelayTransforms) error
- func (s *RTPRelaySession) StartRTCPReportSchedule(ctx context.Context, cfg RTPRelayRTCPReportScheduleConfig) error
- func (s *RTPRelaySession) Stats() RTPRelayStats
- func (s *RTPRelaySession) StopRTCPReportSchedule()
- func (s *RTPRelaySession) Transforms() RTPRelayTransforms
- type RTPRelayStats
- type RTPRelayTransform
- type RTPRelayTransforms
- type RTPStreamDiagnosis
- type RTPStreamDiagnosisConfig
- type RTPStreamDiagnosisReason
- type RTPStreamDiagnosisStatus
- type RTPStreamJitterDiagnosis
- type RTPStreamLossDiagnosis
- type RTPStreamRTCPKeepaliveDiagnosis
- type RTPStreamStats
- type RTPStreamStatsTracker
- func (t *RTPStreamStatsTracker) ObserveRTCPPacket(packet []byte, arrival time.Time) ([]RTPStreamStats, error)
- func (t *RTPStreamStatsTracker) ObserveRTCPSenderReport(ssrc uint32, ntpTime uint64, arrival time.Time) (RTPStreamStats, bool)
- func (t *RTPStreamStatsTracker) ObserveRTPPacket(packet []byte, arrival time.Time, clockRate int) (RTPStreamStats, error)
- func (t *RTPStreamStatsTracker) Stats() []RTPStreamStats
- func (t *RTPStreamStatsTracker) StatsAt(now time.Time) []RTPStreamStats
- func (t *RTPStreamStatsTracker) StatsForSSRC(ssrc uint32) (RTPStreamStats, bool)
- func (t *RTPStreamStatsTracker) StatsForSSRCAt(ssrc uint32, now time.Time) (RTPStreamStats, bool)
- type SDPAMRFMTPCompatibility
- type SDPAMRFMTPCompatibilityStatus
- type SDPAnswerOptions
- type SDPCodec
- func NewSDPAMRCodec(payload int, fmtp string) SDPCodec
- func NewSDPAMRWBCodec(payload int, fmtp string) SDPCodec
- func NewSDPPCMACodec() SDPCodec
- func NewSDPPCMUCodec() SDPCodec
- func NewSDPTelephoneEventCodec(payload, clockRate int) SDPCodec
- func SelectSDPAnswerCodecs(offer, local []SDPCodec) []SDPCodec
- type SDPCryptoAttribute
- type SDPCryptoInlineKeyParams
- type SDPFingerprintAttribute
- type SDPInfo
- type SDPMediaDescription
- type SDPMediaRewriteOptions
- type SDPRTCPFeedbackAttribute
- type SDPRTCPFeedbackPolicy
- type SDPSecurityAnswerOptions
- type SDPSecurityInfo
- type SRTPKeys
- type SRTPMediaConfig
- type SRTPMediaSession
- func (s *SRTPMediaSession) ClientToIMSRTCP(packet []byte) ([]byte, error)
- func (s *SRTPMediaSession) ClientToIMSRTP(packet []byte) ([]byte, error)
- func (s *SRTPMediaSession) IMSToClientRTCP(packet []byte) ([]byte, error)
- func (s *SRTPMediaSession) IMSToClientRTP(packet []byte) ([]byte, error)
- func (s *SRTPMediaSession) ProtectClientRTCP(packet []byte) ([]byte, error)
- func (s *SRTPMediaSession) ProtectClientRTP(packet []byte) ([]byte, error)
- func (s *SRTPMediaSession) ProtectIMSRTCP(packet []byte) ([]byte, error)
- func (s *SRTPMediaSession) ProtectIMSRTP(packet []byte) ([]byte, error)
- func (s *SRTPMediaSession) RelayTransforms() RTPRelayTransforms
- func (s *SRTPMediaSession) RelayTransformsWithMediaEvents(rtcpHandler RTCPFeedbackHandler, dtmfHandler RTPDTMFHandler, ...) RTPRelayTransforms
- func (s *SRTPMediaSession) RelayTransformsWithMediaObservers(rtcpHandler RTCPFeedbackHandler, dtmfHandler RTPDTMFHandler, ...) RTPRelayTransforms
- func (s *SRTPMediaSession) RelayTransformsWithRTCPFeedback(handler RTCPFeedbackHandler) RTPRelayTransforms
- func (s *SRTPMediaSession) UnprotectClientRTCP(packet []byte) ([]byte, error)
- func (s *SRTPMediaSession) UnprotectClientRTP(packet []byte) ([]byte, error)
- func (s *SRTPMediaSession) UnprotectIMSRTCP(packet []byte) ([]byte, error)
- func (s *SRTPMediaSession) UnprotectIMSRTP(packet []byte) ([]byte, error)
- type SRTPProtectionProfile
- type SimulateCallRequest
- type SimulateCallResult
Constants ¶
const ( DTMFInfoPackage = "dtmf" DTMFRelayContentType = "application/dtmf-relay" DefaultDTMFDurationMS = 160 MaxDTMFDurationMS = 5000 DialogDTMFRouteRTP = "rtp" DialogDTMFRouteInfo = "info" )
const ( DefaultRTPDTMFPayloadType = 101 DefaultRTPDTMFClockRate = 8000 DefaultRTPDTMFVolume = 10 DefaultRTPDTMFStepMS = 50 DefaultRTPDTMFEndPackets = 3 )
const ( SDPCodecPCMU = "PCMU" SDPCodecPCMA = "PCMA" SDPCodecAMR = "AMR" SDPCodecAMRWB = "AMR-WB" SDPCodecTelephoneEvent = "telephone-event" )
const ( SDPPCMUPayloadType = 0 SDPPCMAPayloadType = 8 )
const ( DefaultSimulateCallHoldSeconds = 10 MaxSimulateCallHoldSeconds = 300 )
Variables ¶
var ErrIMSInboundAgentNotReady = errors.New("ims inbound voice agent not ready")
var ErrIMSVoiceAgentNotReady = errors.New("ims voice agent not ready")
var ErrInvalidDTMF = errors.New("invalid DTMF relay")
var ErrInvalidSDPDirection = errors.New("invalid SDP media direction")
var ErrInvalidSDPSecurity = errors.New("invalid SDP security")
var ErrRTPRelayConfig = errors.New("invalid rtp relay config")
var ErrRTPStreamStats = errors.New("invalid rtp stream stats")
var ErrSDPMediaNegotiation = errors.New("invalid SDP media negotiation")
var ErrSDPSecurityNegotiation = errors.New("SDP security negotiation failed")
var ErrSRTPMediaConfig = errors.New("invalid srtp media config")
Functions ¶
func BuildGoodbye ¶
BuildGoodbye builds an RTCP BYE packet for media sources that are no longer active.
func BuildRTPDTMFPacket ¶
func BuildRTPDTMFPacket(in RTPDTMFPacket) ([]byte, error)
func BuildRTPDTMFSequence ¶
func BuildRTPDTMFSequence(cfg RTPDTMFSequenceConfig) ([][]byte, error)
func BuildReceiverReport ¶
func BuildReceiverReport(senderSSRC uint32, stats []RTPStreamStats) *rtcp.ReceiverReport
BuildReceiverReport converts RTP reception snapshots into an RTCP RR packet. A ReceiverReport can carry at most 31 report blocks, so extra streams are ignored.
func BuildSDPAnswer ¶
func BuildSDPAnswerWithOptions ¶
func BuildSDPAnswerWithOptions(info SDPInfo, options SDPAnswerOptions) []byte
func BuildSDPAnswerWithSecurity ¶
func BuildSDPAnswerWithSecurity(info SDPInfo, security SDPSecurityInfo) []byte
func BuildSDPCryptoInlineKeyParams ¶
func BuildSDPCryptoInlineKeyParams(profile SRTPProtectionProfile, params SDPCryptoInlineKeyParams) (string, error)
func BuildSDPFmtpParameters ¶
func BuildSenderReport ¶
func BuildSenderReport(cfg RTCPSenderReportConfig) *rtcp.SenderReport
BuildSenderReport converts local sender counters and optional reception snapshots into an RTCP SR packet.
func BuildSourceDescription ¶
func BuildSourceDescription(cfg RTCPSourceDescriptionConfig) *rtcp.SourceDescription
BuildSourceDescription builds an RTCP SDES chunk for the local media source. CNAME should be stable for the lifetime of the RTP session.
func NormalizeDTMFSignal ¶
func NormalizeRTPDTMFSignal ¶
func ParseDTMFRelayBody ¶
func ParseSDPCryptoAttributeKeys ¶
func ParseSDPCryptoAttributeKeys(attr SDPCryptoAttribute) (SRTPProtectionProfile, SDPCryptoInlineKeyParams, error)
func ParseSDPFmtpParameters ¶
func ParseSDPWithSecurity ¶
func ParseSDPWithSecurity(body []byte) (SDPInfo, SDPSecurityInfo, error)
func RTPDTMFEventCode ¶
func RewriteSDPMediaEndpoint ¶
func RewriteSDPMediaEndpointWithOptions ¶
func RewriteSDPMediaEndpointWithOptions(body []byte, endpoint SDPInfo, options SDPMediaRewriteOptions) []byte
func RewriteSDPRTCPFeedback ¶
func RewriteSDPRTCPFeedback(body []byte, feedback []SDPRTCPFeedbackAttribute) []byte
func SelectSDPCryptoAttribute ¶
func SelectSDPCryptoAttribute(crypto []SDPCryptoAttribute, preferred []SRTPProtectionProfile) (SDPCryptoAttribute, SRTPProtectionProfile, SDPCryptoInlineKeyParams, bool, error)
func SelectSDPSetupAnswer ¶
func ValidateSDPCryptoAttribute ¶
func ValidateSDPCryptoAttribute(attr SDPCryptoAttribute) error
Types ¶
type ClientAdapter ¶
type DialogAutoDTMFResult ¶
type DialogAutoDTMFResult struct {
Accepted bool
StatusCode int
Reason string
Route string
RegistrationRecoveryNeeded bool
RetryAfter time.Duration
RTP DialogRTPDTMFResult
INFO DialogDTMFResult
}
type DialogAutoDTMFSender ¶
type DialogAutoDTMFSender interface {
SendDialogAutoDTMF(context.Context, DialogDTMFRequest) (DialogAutoDTMFResult, error)
}
type DialogCanceller ¶
type DialogCanceller interface {
CancelVoiceCall(context.Context, DialogInfo) error
}
type DialogCancellerWithResult ¶
type DialogCancellerWithResult interface {
CancelVoiceCallWithResult(context.Context, DialogInfo) (DialogInfoResult, error)
}
type DialogDTMFRequest ¶
type DialogDTMFResult ¶
type DialogDTMFResult = DialogInfoResult
type DialogDTMFSender ¶
type DialogDTMFSender interface {
SendDialogDTMF(context.Context, DialogDTMFRequest) (DialogDTMFResult, error)
}
type DialogHoldController ¶
type DialogHoldController interface {
SendDialogHold(context.Context, DialogHoldRequest) (DialogUpdateResult, error)
SendDialogResume(context.Context, DialogResumeRequest) (DialogUpdateResult, error)
}
type DialogHoldRequest ¶
type DialogInfo ¶
type DialogInfoRequest ¶
type DialogInfoRequest struct {
DeviceID string
CallID string
ContentType string
InfoPackage string
Body []byte
Headers map[string]string
}
func BuildDialogDTMFInfoRequest ¶
func BuildDialogDTMFInfoRequest(req DialogDTMFRequest) (DialogInfoRequest, error)
type DialogInfoResult ¶
type DialogInfoSender ¶
type DialogInfoSender interface {
SendDialogInfo(context.Context, DialogInfoRequest) (DialogInfoResult, error)
}
type DialogMessageRequest ¶
type DialogMessageResult ¶
type DialogMessageResult = DialogInfoResult
type DialogMessageSender ¶
type DialogMessageSender interface {
SendDialogMessage(context.Context, DialogMessageRequest) (DialogMessageResult, error)
}
type DialogNotifyRequest ¶
type DialogNotifyResult ¶
type DialogNotifyResult = DialogInfoResult
type DialogNotifySender ¶
type DialogNotifySender interface {
SendDialogNotify(context.Context, DialogNotifyRequest) (DialogNotifyResult, error)
}
type DialogOptionsRequest ¶
type DialogOptionsResult ¶
type DialogOptionsResult = DialogInfoResult
type DialogOptionsSender ¶
type DialogOptionsSender interface {
SendDialogOptions(context.Context, DialogOptionsRequest) (DialogOptionsResult, error)
}
type DialogPrackRequest ¶
type DialogPrackResult ¶
type DialogPrackResult = DialogInfoResult
type DialogPrackSender ¶
type DialogPrackSender interface {
SendDialogPrack(context.Context, DialogPrackRequest) (DialogPrackResult, error)
}
type DialogRTPDTMFRequest ¶
type DialogRTPDTMFResult ¶
type DialogRTPDTMFResult struct {
Accepted bool
StatusCode int
Reason string
RTP RTPRelayDTMFResult
}
type DialogRTPDTMFSender ¶
type DialogRTPDTMFSender interface {
SendDialogRTPDTMF(context.Context, DialogRTPDTMFRequest) (DialogRTPDTMFResult, error)
}
type DialogReferRequest ¶
type DialogReferResult ¶
type DialogReferResult = DialogInfoResult
type DialogReferSender ¶
type DialogReferSender interface {
SendDialogRefer(context.Context, DialogReferRequest) (DialogReferResult, error)
}
type DialogReinviteRequest ¶
type DialogReinviteResult ¶
type DialogReinviter ¶
type DialogReinviter interface {
SendDialogReinvite(context.Context, DialogReinviteRequest) (DialogReinviteResult, error)
}
type DialogResumeRequest ¶
type DialogState ¶
type DialogState string
const ( DialogStateEarly DialogState = "early" DialogStateEstablished DialogState = "established" DialogStateTerminated DialogState = "terminated" )
type DialogSubscribeRequest ¶
type DialogSubscribeResult ¶
type DialogSubscribeResult = DialogInfoResult
type DialogSubscribeSender ¶
type DialogSubscribeSender interface {
SendDialogSubscribe(context.Context, DialogSubscribeRequest) (DialogSubscribeResult, error)
}
type DialogTerminator ¶
type DialogTerminator interface {
EndVoiceCall(context.Context, DialogInfo) error
}
type DialogTerminatorWithResult ¶
type DialogTerminatorWithResult interface {
EndVoiceCallWithResult(context.Context, DialogInfo) (DialogInfoResult, error)
}
type DialogUpdateRequest ¶
type DialogUpdateResult ¶
type DialogUpdater ¶
type DialogUpdater interface {
SendDialogUpdate(context.Context, DialogUpdateRequest) (DialogUpdateResult, error)
}
type Gateway ¶
type Gateway struct {
// contains filtered or unexported fields
}
func NewGateway ¶
func NewGateway() *Gateway
func (*Gateway) DeviceStatus ¶
func (*Gateway) HandleClientAck ¶
func (*Gateway) HandleClientBye ¶
func (*Gateway) HandleClientCancel ¶
func (*Gateway) HandleClientInfo ¶
func (*Gateway) HandleClientInvite ¶
func (*Gateway) HandleClientMessage ¶
func (*Gateway) HandleClientNotify ¶
func (*Gateway) HandleClientOptions ¶
func (*Gateway) HandleClientPrack ¶
func (*Gateway) HandleClientRefer ¶
func (*Gateway) HandleClientSubscribe ¶
func (*Gateway) HandleClientUpdate ¶
func (*Gateway) RegisterAgent ¶
func (*Gateway) SetClientAdapter ¶
func (g *Gateway) SetClientAdapter(a ClientAdapter)
func (*Gateway) SetNotifier ¶
func (*Gateway) SimulateCall ¶
func (g *Gateway) SimulateCall(ctx context.Context, deviceID string, req SimulateCallRequest) (SimulateCallResult, error)
type IMSByeHandler ¶
type IMSByeHandler interface {
HandleIMSBye(context.Context, IMSByeRequest) (IMSByeResult, error)
}
type IMSByeHandlerFunc ¶
type IMSByeHandlerFunc func(context.Context, IMSByeRequest) (IMSByeResult, error)
func (IMSByeHandlerFunc) HandleIMSBye ¶
func (f IMSByeHandlerFunc) HandleIMSBye(ctx context.Context, req IMSByeRequest) (IMSByeResult, error)
type IMSByeRequest ¶
type IMSByeResult ¶
type IMSInboundAgent ¶
type IMSInboundAgent struct {
ClientTransport voiceclient.SIPRequestTransport
Profile voiceclient.IMSProfile
Registration voiceclient.RegistrationBinding
ClientContactURI string
LocalContactURI string
LocalTag string
UserAgent string
MediaRelay *RTPRelayConfig
// contains filtered or unexported fields
}
func (*IMSInboundAgent) AckInboundCall ¶
func (a *IMSInboundAgent) AckInboundCall(ctx context.Context, info DialogInfo) error
func (*IMSInboundAgent) CancelInboundCall ¶
func (a *IMSInboundAgent) CancelInboundCall(ctx context.Context, info DialogInfo) error
func (*IMSInboundAgent) CancelInboundCallWithResult ¶
func (a *IMSInboundAgent) CancelInboundCallWithResult(ctx context.Context, info DialogInfo) (DialogInfoResult, error)
func (*IMSInboundAgent) EndInboundCall ¶
func (a *IMSInboundAgent) EndInboundCall(ctx context.Context, info DialogInfo) error
func (*IMSInboundAgent) EndInboundCallWithResult ¶
func (a *IMSInboundAgent) EndInboundCallWithResult(ctx context.Context, info DialogInfo) (DialogInfoResult, error)
func (*IMSInboundAgent) HandleInboundInfo ¶
func (a *IMSInboundAgent) HandleInboundInfo(ctx context.Context, req IMSInfoRequest) (IMSInfoResult, error)
func (*IMSInboundAgent) HandleInboundInvite ¶
func (a *IMSInboundAgent) HandleInboundInvite(ctx context.Context, req InboundCallRequest) (InboundCallResult, error)
func (*IMSInboundAgent) HandleInboundMessage ¶
func (a *IMSInboundAgent) HandleInboundMessage(ctx context.Context, req IMSMessageRequest) (IMSInfoResult, error)
func (*IMSInboundAgent) HandleInboundNotify ¶
func (a *IMSInboundAgent) HandleInboundNotify(ctx context.Context, req InboundDialogRequest) (IMSInfoResult, error)
func (*IMSInboundAgent) HandleInboundPrack ¶
func (a *IMSInboundAgent) HandleInboundPrack(ctx context.Context, req InboundDialogRequest) (InboundCallResult, error)
func (*IMSInboundAgent) HandleInboundRefer ¶
func (a *IMSInboundAgent) HandleInboundRefer(ctx context.Context, req InboundDialogRequest) (InboundCallResult, error)
func (*IMSInboundAgent) HandleInboundSubscribe ¶
func (a *IMSInboundAgent) HandleInboundSubscribe(ctx context.Context, req InboundDialogRequest) (IMSInfoResult, error)
func (*IMSInboundAgent) HandleInboundUpdate ¶
func (a *IMSInboundAgent) HandleInboundUpdate(ctx context.Context, req InboundDialogRequest) (InboundCallResult, error)
func (*IMSInboundAgent) SendDialogRTPDTMF ¶
func (a *IMSInboundAgent) SendDialogRTPDTMF(ctx context.Context, req DialogRTPDTMFRequest) (DialogRTPDTMFResult, error)
type IMSInboundRequireOptionClassification ¶
type IMSInboundRequireOptionClassification struct {
Required []string
Supported []string
Unsupported []string
}
IMSInboundRequireOptionClassification partitions inbound Require option-tags by local support.
func ClassifyIMSInboundRequireOptions ¶
func ClassifyIMSInboundRequireOptions(headers map[string][]string) IMSInboundRequireOptionClassification
ClassifyIMSInboundRequireOptions classifies Require option-tags against inbound IMS wire support.
func (IMSInboundRequireOptionClassification) UnsupportedHeader ¶
func (c IMSInboundRequireOptionClassification) UnsupportedHeader() string
UnsupportedHeader renders unsupported option-tags for a SIP Unsupported response header.
type IMSInboundWireResponse ¶
type IMSInboundWireServer ¶
type IMSInboundWireServer struct {
Agent *IMSInboundAgent
MessageHandler IMSMessageHandler
InfoHandler IMSInfoHandler
ByeHandler IMSByeHandler
ContactURI string
LocalTag string
UserAgent string
ResponseHeaders map[string]string
ReadTimeout time.Duration
TransactionTTL time.Duration
InviteFinalT1 time.Duration
InviteFinalT2 time.Duration
Reliable1xxT1 time.Duration
Reliable1xxT2 time.Duration
// contains filtered or unexported fields
}
func (*IMSInboundWireServer) CachedTransactionSnapshot ¶
func (s *IMSInboundWireServer) CachedTransactionSnapshot(req voiceclient.SIPIncomingRequest) (IMSInboundWireTransactionSnapshot, bool)
CachedTransactionSnapshot returns a diagnostic view of a cached inbound SIP server transaction keyed by req's Via branch, Call-ID, method, and CSeq.
func (*IMSInboundWireServer) HandleRequest ¶
func (s *IMSInboundWireServer) HandleRequest(ctx context.Context, req voiceclient.SIPIncomingRequest) ([]IMSInboundWireResponse, error)
func (*IMSInboundWireServer) ServeListener ¶
func (*IMSInboundWireServer) ServePacket ¶
func (s *IMSInboundWireServer) ServePacket(ctx context.Context, pc net.PacketConn) error
type IMSInboundWireTransactionSnapshot ¶
type IMSInboundWireTransactionSnapshot struct {
Method string
Invite bool
State voiceclient.SIPServerTransactionState
StatusCodes []int
Provisional bool
Final bool
Pending bool
CleanupAfter time.Duration
TimeoutAfter time.Duration
ExpiresAt time.Time
}
IMSInboundWireTransactionSnapshot describes the cached server transaction state for an inbound SIP request without exposing cached response bodies.
type IMSInfoHandler ¶
type IMSInfoHandler interface {
HandleIMSInfo(context.Context, IMSInfoRequest) (IMSInfoResult, error)
}
type IMSInfoHandlerFunc ¶
type IMSInfoHandlerFunc func(context.Context, IMSInfoRequest) (IMSInfoResult, error)
func (IMSInfoHandlerFunc) HandleIMSInfo ¶
func (f IMSInfoHandlerFunc) HandleIMSInfo(ctx context.Context, req IMSInfoRequest) (IMSInfoResult, error)
type IMSInfoRequest ¶
type IMSInfoResult ¶
type IMSMessageHandler ¶
type IMSMessageHandler interface {
HandleIMSMessage(context.Context, IMSMessageRequest) (IMSMessageResult, error)
}
type IMSMessageHandlerFunc ¶
type IMSMessageHandlerFunc func(context.Context, IMSMessageRequest) (IMSMessageResult, error)
func (IMSMessageHandlerFunc) HandleIMSMessage ¶
func (f IMSMessageHandlerFunc) HandleIMSMessage(ctx context.Context, req IMSMessageRequest) (IMSMessageResult, error)
type IMSMessageRequest ¶
type IMSMessageResult ¶
type IMSOutboundAgent ¶
type IMSOutboundAgent struct {
Transport voiceclient.SIPRequestTransport
Profile voiceclient.IMSProfile
Registration voiceclient.RegistrationBinding
Domain string
UserAgent string
LocalTag string
SessionExpires int
SessionRefresher string
SessionRefreshLead time.Duration
RemoteTargetURI string
MediaRelay *RTPRelayConfig
// contains filtered or unexported fields
}
func (*IMSOutboundAgent) CancelVoiceCall ¶
func (a *IMSOutboundAgent) CancelVoiceCall(ctx context.Context, info DialogInfo) error
func (*IMSOutboundAgent) CancelVoiceCallWithResult ¶
func (a *IMSOutboundAgent) CancelVoiceCallWithResult(ctx context.Context, info DialogInfo) (DialogInfoResult, error)
func (*IMSOutboundAgent) EndVoiceCall ¶
func (a *IMSOutboundAgent) EndVoiceCall(ctx context.Context, info DialogInfo) error
func (*IMSOutboundAgent) EndVoiceCallWithResult ¶
func (a *IMSOutboundAgent) EndVoiceCallWithResult(ctx context.Context, info DialogInfo) (DialogInfoResult, error)
func (*IMSOutboundAgent) SendDialogDTMF ¶
func (a *IMSOutboundAgent) SendDialogDTMF(ctx context.Context, req DialogDTMFRequest) (DialogDTMFResult, error)
func (*IMSOutboundAgent) SendDialogHold ¶
func (a *IMSOutboundAgent) SendDialogHold(ctx context.Context, req DialogHoldRequest) (DialogUpdateResult, error)
func (*IMSOutboundAgent) SendDialogInfo ¶
func (a *IMSOutboundAgent) SendDialogInfo(ctx context.Context, req DialogInfoRequest) (DialogInfoResult, error)
func (*IMSOutboundAgent) SendDialogMessage ¶
func (a *IMSOutboundAgent) SendDialogMessage(ctx context.Context, req DialogMessageRequest) (DialogMessageResult, error)
func (*IMSOutboundAgent) SendDialogNotify ¶
func (a *IMSOutboundAgent) SendDialogNotify(ctx context.Context, req DialogNotifyRequest) (DialogNotifyResult, error)
func (*IMSOutboundAgent) SendDialogOptions ¶
func (a *IMSOutboundAgent) SendDialogOptions(ctx context.Context, req DialogOptionsRequest) (DialogOptionsResult, error)
func (*IMSOutboundAgent) SendDialogPrack ¶
func (a *IMSOutboundAgent) SendDialogPrack(ctx context.Context, req DialogPrackRequest) (DialogPrackResult, error)
func (*IMSOutboundAgent) SendDialogRTPDTMF ¶
func (a *IMSOutboundAgent) SendDialogRTPDTMF(ctx context.Context, req DialogRTPDTMFRequest) (DialogRTPDTMFResult, error)
func (*IMSOutboundAgent) SendDialogRefer ¶
func (a *IMSOutboundAgent) SendDialogRefer(ctx context.Context, req DialogReferRequest) (DialogReferResult, error)
func (*IMSOutboundAgent) SendDialogReinvite ¶
func (a *IMSOutboundAgent) SendDialogReinvite(ctx context.Context, req DialogReinviteRequest) (DialogReinviteResult, error)
func (*IMSOutboundAgent) SendDialogResume ¶
func (a *IMSOutboundAgent) SendDialogResume(ctx context.Context, req DialogResumeRequest) (DialogUpdateResult, error)
func (*IMSOutboundAgent) SendDialogSubscribe ¶
func (a *IMSOutboundAgent) SendDialogSubscribe(ctx context.Context, req DialogSubscribeRequest) (DialogSubscribeResult, error)
func (*IMSOutboundAgent) SendDialogUpdate ¶
func (a *IMSOutboundAgent) SendDialogUpdate(ctx context.Context, req DialogUpdateRequest) (DialogUpdateResult, error)
func (*IMSOutboundAgent) StartOutboundCall ¶
func (a *IMSOutboundAgent) StartOutboundCall(ctx context.Context, req OutboundCallRequest) (OutboundCallResult, error)
func (*IMSOutboundAgent) StopSessionTimers ¶
func (a *IMSOutboundAgent) StopSessionTimers()
func (*IMSOutboundAgent) UpdateIMSRegistration ¶
func (a *IMSOutboundAgent) UpdateIMSRegistration(update IMSRegistrationUpdate)
type IMSRegistrationUpdate ¶
type IMSRegistrationUpdate struct {
Transport voiceclient.SIPRequestTransport
Profile voiceclient.IMSProfile
Registration voiceclient.RegistrationBinding
Domain string
UserAgent string
SessionExpires int
SessionRefresher string
SessionRefreshLead time.Duration
MediaRelay *RTPRelayConfig
}
type IMSRegistrationUpdater ¶
type IMSRegistrationUpdater interface {
UpdateIMSRegistration(IMSRegistrationUpdate)
}
type InboundCallRequest ¶
type InboundCallResult ¶
type InboundDialogRequest ¶
type OutboundCallAgent ¶
type OutboundCallAgent interface {
StartOutboundCall(context.Context, OutboundCallRequest) (OutboundCallResult, error)
}
type OutboundCallRequest ¶
type OutboundCallResult ¶
type RTCPFeedbackDirection ¶
type RTCPFeedbackDirection string
const ( RTCPFeedbackClientToIMS RTCPFeedbackDirection = "client_to_ims" RTCPFeedbackIMSToClient RTCPFeedbackDirection = "ims_to_client" )
type RTCPFeedbackEvent ¶
type RTCPFeedbackEvent struct {
Direction RTCPFeedbackDirection
Kind RTCPFeedbackKind
PacketType string
SenderSSRC uint32
MediaSSRC uint32
SSRC uint32
NTPTime uint64
RTPTime uint32
PacketCount uint32
OctetCount uint32
DestinationSSRCs []uint32
GoodbyeSSRCs []uint32
GoodbyeReason string
ReportCount int
NACKCount int
FIRCount int
SLICount int
REMBBitrate float64
REMBSSRCs []uint32
TransportCCCount int
Reports []RTCPReceptionReport
Packet rtcp.Packet
}
type RTCPFeedbackHandler ¶
type RTCPFeedbackHandler func(RTCPFeedbackEvent)
type RTCPFeedbackKind ¶
type RTCPFeedbackKind string
const ( RTCPFeedbackSenderReport RTCPFeedbackKind = "sender_report" RTCPFeedbackReceiverReport RTCPFeedbackKind = "receiver_report" RTCPFeedbackPictureLossIndication RTCPFeedbackKind = "picture_loss_indication" RTCPFeedbackFullIntraRequest RTCPFeedbackKind = "full_intra_request" RTCPFeedbackRapidResynchronizationRequest RTCPFeedbackKind = "rapid_resynchronization_request" RTCPFeedbackTransportLayerNack RTCPFeedbackKind = "transport_layer_nack" RTCPFeedbackReceiverEstimatedMaximumBitrate RTCPFeedbackKind = "receiver_estimated_maximum_bitrate" RTCPFeedbackTransportLayerCongestionControl RTCPFeedbackKind = "transport_layer_congestion_control" RTCPFeedbackSliceLossIndication RTCPFeedbackKind = "slice_loss_indication" RTCPFeedbackExtendedReport RTCPFeedbackKind = "extended_report" RTCPFeedbackSourceDescription RTCPFeedbackKind = "source_description" RTCPFeedbackGoodbye RTCPFeedbackKind = "goodbye" RTCPFeedbackApplicationDefined RTCPFeedbackKind = "application_defined" RTCPFeedbackUnknown RTCPFeedbackKind = "unknown" )
type RTCPFeedbackSummary ¶
type RTCPFeedbackSummary struct {
Packets uint64
SenderReports uint64
ReceiverReports uint64
PictureLossIndications uint64
FullIntraRequests uint64
RapidResynchronizationRequests uint64
TransportLayerNacks uint64
ReceiverEstimatedMaximumBitrates uint64
TransportLayerCongestionControls uint64
SliceLossIndications uint64
ExtendedReports uint64
SourceDescriptions uint64
Goodbyes uint64
ApplicationDefined uint64
UnknownPackets uint64
}
func InspectRTCPFeedback ¶
func InspectRTCPFeedback(direction RTCPFeedbackDirection, packet []byte, handler RTCPFeedbackHandler) (RTCPFeedbackSummary, error)
type RTCPReceptionReport ¶
type RTCPReportKind ¶
type RTCPReportKind string
const ( RTCPReportKindReceiver RTCPReportKind = "receiver" RTCPReportKindSender RTCPReportKind = "sender" )
type RTCPSenderReportConfig ¶
type RTPDTMFDirection ¶
type RTPDTMFDirection string
const ( RTPDTMFClientToIMS RTPDTMFDirection = "client_to_ims" RTPDTMFIMSToClient RTPDTMFDirection = "ims_to_client" )
type RTPDTMFEvent ¶
type RTPDTMFEvent struct {
Direction RTPDTMFDirection
PayloadType uint8
EventCode uint8
Signal string
End bool
Volume uint8
DurationSamples uint16
DurationMS int
SequenceNumber uint16
Timestamp uint32
SSRC uint32
Marker bool
ClockRate int
Packet []byte
}
func ParseRTPDTMFEvent ¶
func ParseRTPDTMFEvent(direction RTPDTMFDirection, packet []byte, payloadTypes map[uint8]int) (RTPDTMFEvent, bool, error)
type RTPDTMFHandler ¶
type RTPDTMFHandler func(RTPDTMFEvent)
type RTPDTMFPacket ¶
type RTPDTMFSequenceConfig ¶
type RTPDTMFSummary ¶
func InspectRTPDTMF ¶
func InspectRTPDTMF(direction RTPDTMFDirection, packet []byte, payloadTypes map[uint8]int, handler RTPDTMFHandler) (RTPDTMFSummary, error)
type RTPPlaintextEvent ¶
type RTPPlaintextEvent struct {
Direction RTPDTMFDirection
Packet []byte
}
type RTPPlaintextHandler ¶
type RTPPlaintextHandler func(RTPPlaintextEvent)
type RTPRelayConfig ¶
type RTPRelayConfig struct {
ClientListenIP string
ClientAdvertiseIP string
ClientPort int
ClientRTCPPort int
ClientRTPClockRate int
IMSListenIP string
IMSAdvertiseIP string
IMSPort int
IMSRTCPPort int
IMSRTPClockRate int
BufferSize int
Transforms RTPRelayTransforms
SRTP *RTPRelaySRTPConfig
RTCPFeedbackHandler RTCPFeedbackHandler
RTPDTMFHandler RTPDTMFHandler
RTPQualityHandler RTPRelayQualityHandler
RTPQualityConfig RTPRelayQualityConfig
RTCPReportSchedule RTPRelayRTCPReportScheduleConfig
}
type RTPRelayDTMFRequest ¶
type RTPRelayDTMFResult ¶
type RTPRelayDirectionQuality ¶
type RTPRelayDirectionQuality struct {
Direction RTCPFeedbackDirection
RTPPackets uint64
RTPBytes uint64
RTPDrops uint64
RTCPPackets uint64
RTCPBytes uint64
RTCPDrops uint64
RTPReceivedPackets uint64
RTPExpectedPackets uint64
RTPLostPackets uint64
RTPDuplicatePackets uint64
RTPOutOfOrderPackets uint64
RTPSequenceRollovers uint64
RTPTimestampRollovers uint64
RTPFractionLost uint8
RTPMaxJitter uint32
RTPStreams []RTPStreamStats
RTCPReports []RTPRelayRTCPReportQuality
RTCPMaxRoundTripTime time.Duration
}
func (RTPRelayDirectionQuality) DiagnoseRTCPReports ¶
func (q RTPRelayDirectionQuality) DiagnoseRTCPReports(cfg RTPStreamDiagnosisConfig) []RTPRelayRTCPReportDiagnosis
DiagnoseRTCPReports classifies the RTCP reports already present in a quality snapshot.
type RTPRelayQualityAction ¶
type RTPRelayQualityAction string
RTPRelayQualityAction is a recovery hint for media quality degradation.
const ( RTPRelayQualityActionNone RTPRelayQualityAction = "none" RTPRelayQualityActionMonitor RTPRelayQualityAction = "monitor" RTPRelayQualityActionIncreaseJitterBuffer RTPRelayQualityAction = "increase_jitter_buffer" RTPRelayQualityActionReduceBitrate RTPRelayQualityAction = "reduce_bitrate" RTPRelayQualityActionRecoverMediaPath RTPRelayQualityAction = "recover_media_path" )
type RTPRelayQualityConfig ¶
type RTPRelayQualityConfig struct {
ClientToIMS RTPStreamDiagnosisConfig
IMSToClient RTPStreamDiagnosisConfig
EmitInitial bool
}
type RTPRelayQualityEvent ¶
type RTPRelayQualityEvent struct {
Direction RTCPFeedbackDirection
Status RTPStreamDiagnosisStatus
PreviousStatus RTPStreamDiagnosisStatus
Reasons []RTPStreamDiagnosisReason
Quality RTPRelayDirectionQuality
Diagnoses []RTPStreamDiagnosis
ObservedAt time.Time
}
type RTPRelayQualityHandler ¶
type RTPRelayQualityHandler func(RTPRelayQualityEvent)
type RTPRelayQualityStats ¶
type RTPRelayQualityStats struct {
ClientToIMS RTPRelayDirectionQuality
IMSToClient RTPRelayDirectionQuality
RTCPFeedback RTCPFeedbackSummary
RTCPFeedbackParseErrors uint64
}
type RTPRelayRTCPReportDiagnosis ¶
type RTPRelayRTCPReportDiagnosis struct {
Direction RTCPFeedbackDirection
ReporterSSRC uint32
MediaSSRC uint32
Status RTPStreamDiagnosisStatus
Reasons []RTPStreamDiagnosisReason
Action RTPRelayQualityAction
Loss RTPRelayRTCPReportLossDiagnosis
Jitter RTPRelayRTCPReportJitterDiagnosis
RoundTripTime RTPRelayRTCPReportRoundTripTimeDiagnosis
}
RTPRelayRTCPReportDiagnosis classifies one remote RTCP reception report.
func DiagnoseRTPRelayRTCPReports ¶
func DiagnoseRTPRelayRTCPReports(reports []RTPRelayRTCPReportQuality, cfg RTPStreamDiagnosisConfig) []RTPRelayRTCPReportDiagnosis
DiagnoseRTPRelayRTCPReports classifies remote RTCP reception reports and preserves the input order.
type RTPRelayRTCPReportJitterDiagnosis ¶
type RTPRelayRTCPReportJitterDiagnosis struct {
Status RTPStreamDiagnosisStatus
Jitter uint32
Duration time.Duration
}
RTPRelayRTCPReportJitterDiagnosis classifies report-block jitter using the configured clock rate.
type RTPRelayRTCPReportLossDiagnosis ¶
type RTPRelayRTCPReportLossDiagnosis struct {
Status RTPStreamDiagnosisStatus
FractionLost uint8
TotalLost uint32
}
RTPRelayRTCPReportLossDiagnosis classifies the report-block loss fields.
type RTPRelayRTCPReportQuality ¶
type RTPRelayRTCPReportQuality struct {
Direction RTCPFeedbackDirection
ReporterSSRC uint32
MediaSSRC uint32
FractionLost uint8
TotalLost uint32
LastSequenceNumber uint32
Jitter uint32
LastSenderReport uint32
Delay uint32
RoundTripTime time.Duration
}
func (RTPRelayRTCPReportQuality) Diagnose ¶
func (r RTPRelayRTCPReportQuality) Diagnose(cfg RTPStreamDiagnosisConfig) RTPRelayRTCPReportDiagnosis
Diagnose classifies loss, jitter, and RTT for one remote RTCP reception report.
type RTPRelayRTCPReportRoundTripTimeDiagnosis ¶
type RTPRelayRTCPReportRoundTripTimeDiagnosis struct {
Status RTPStreamDiagnosisStatus
RoundTripTime time.Duration
}
RTPRelayRTCPReportRoundTripTimeDiagnosis classifies RTT computed from LSR/DLSR timing.
type RTPRelayRTCPReportScheduleConfig ¶
type RTPRelayRTCPReportScheduleConfig struct {
Enabled bool
Interval time.Duration
ClientToIMS bool
IMSToClient bool
Kind RTCPReportKind
SenderSSRC uint32
ClientToIMSSSRC uint32
IMSToClientSSRC uint32
ClientToIMSCNAME string
IMSToClientCNAME string
ClientToIMSRTPTime uint32
IMSToClientRTPTime uint32
ClientToIMSPackets uint32
IMSToClientPackets uint32
ClientToIMSOctets uint32
IMSToClientOctets uint32
RunImmediately bool
StopOnError bool
}
type RTPRelayRTCPRequest ¶
type RTPRelayRTCPRequest struct {
Direction RTCPFeedbackDirection
Packets []rtcp.Packet
}
type RTPRelayRTCPResult ¶
type RTPRelayRTCPResult struct {
Datagrams int
Bytes int
Feedback RTCPFeedbackSummary
}
type RTPRelayReceiverReportRequest ¶
type RTPRelayReceiverReportRequest struct {
Direction RTCPFeedbackDirection
SenderSSRC uint32
}
type RTPRelaySRTPConfig ¶
type RTPRelaySession ¶
type RTPRelaySession struct {
// contains filtered or unexported fields
}
func NewRTPRelaySession ¶
func NewRTPRelaySession(ctx context.Context, cfg RTPRelayConfig, clientTarget SDPInfo) (*RTPRelaySession, error)
func NewRTPRelaySessionForIMSRemote ¶
func NewRTPRelaySessionForIMSRemote(ctx context.Context, cfg RTPRelayConfig, imsTarget SDPInfo) (*RTPRelaySession, error)
func (*RTPRelaySession) ClientAnswerSDP ¶
func (s *RTPRelaySession) ClientAnswerSDP(imsAnswer SDPInfo) []byte
func (*RTPRelaySession) ClientEndpoint ¶
func (s *RTPRelaySession) ClientEndpoint() SDPInfo
func (*RTPRelaySession) ClientToIMSRTPStreamStats ¶
func (s *RTPRelaySession) ClientToIMSRTPStreamStats() []RTPStreamStats
func (*RTPRelaySession) Close ¶
func (s *RTPRelaySession) Close() error
func (*RTPRelaySession) HasRTCPReportSchedule ¶
func (s *RTPRelaySession) HasRTCPReportSchedule() bool
func (*RTPRelaySession) IMSEndpoint ¶
func (s *RTPRelaySession) IMSEndpoint() SDPInfo
func (*RTPRelaySession) IMSOfferSDP ¶
func (s *RTPRelaySession) IMSOfferSDP(clientOffer SDPInfo) []byte
func (*RTPRelaySession) IMSToClientRTPStreamStats ¶
func (s *RTPRelaySession) IMSToClientRTPStreamStats() []RTPStreamStats
func (*RTPRelaySession) ObserveRTPPlaintext ¶
func (s *RTPRelaySession) ObserveRTPPlaintext(event RTPPlaintextEvent)
func (*RTPRelaySession) Quality ¶
func (s *RTPRelaySession) Quality() RTPRelayQualityStats
func (*RTPRelaySession) RTPPlaintextHandler ¶
func (s *RTPRelaySession) RTPPlaintextHandler() RTPPlaintextHandler
func (*RTPRelaySession) SendRTCP ¶
func (s *RTPRelaySession) SendRTCP(ctx context.Context, req RTPRelayRTCPRequest) (RTPRelayRTCPResult, error)
func (*RTPRelaySession) SendRTCPToClient ¶
func (s *RTPRelaySession) SendRTCPToClient(ctx context.Context, packets ...rtcp.Packet) (RTPRelayRTCPResult, error)
func (*RTPRelaySession) SendRTCPToIMS ¶
func (s *RTPRelaySession) SendRTCPToIMS(ctx context.Context, packets ...rtcp.Packet) (RTPRelayRTCPResult, error)
func (*RTPRelaySession) SendRTPDTMF ¶
func (s *RTPRelaySession) SendRTPDTMF(ctx context.Context, req RTPRelayDTMFRequest) (RTPRelayDTMFResult, error)
func (*RTPRelaySession) SendRTPDTMFToClient ¶
func (s *RTPRelaySession) SendRTPDTMFToClient(ctx context.Context, req RTPRelayDTMFRequest) (RTPRelayDTMFResult, error)
func (*RTPRelaySession) SendRTPDTMFToIMS ¶
func (s *RTPRelaySession) SendRTPDTMFToIMS(ctx context.Context, req RTPRelayDTMFRequest) (RTPRelayDTMFResult, error)
func (*RTPRelaySession) SendReceiverReport ¶
func (s *RTPRelaySession) SendReceiverReport(ctx context.Context, req RTPRelayReceiverReportRequest) (RTPRelayRTCPResult, error)
func (*RTPRelaySession) SendReceiverReportToClient ¶
func (s *RTPRelaySession) SendReceiverReportToClient(ctx context.Context, senderSSRC uint32) (RTPRelayRTCPResult, error)
func (*RTPRelaySession) SendReceiverReportToIMS ¶
func (s *RTPRelaySession) SendReceiverReportToIMS(ctx context.Context, senderSSRC uint32) (RTPRelayRTCPResult, error)
func (*RTPRelaySession) SendSenderReport ¶
func (s *RTPRelaySession) SendSenderReport(ctx context.Context, req RTPRelaySenderReportRequest) (RTPRelayRTCPResult, error)
func (*RTPRelaySession) SendSenderReportToClient ¶
func (s *RTPRelaySession) SendSenderReportToClient(ctx context.Context, req RTPRelaySenderReportRequest) (RTPRelayRTCPResult, error)
func (*RTPRelaySession) SendSenderReportToIMS ¶
func (s *RTPRelaySession) SendSenderReportToIMS(ctx context.Context, req RTPRelaySenderReportRequest) (RTPRelayRTCPResult, error)
func (*RTPRelaySession) SetClientRemote ¶
func (s *RTPRelaySession) SetClientRemote(info SDPInfo) error
func (*RTPRelaySession) SetIMSRemote ¶
func (s *RTPRelaySession) SetIMSRemote(info SDPInfo) error
func (*RTPRelaySession) SetTransforms ¶
func (s *RTPRelaySession) SetTransforms(transforms RTPRelayTransforms) error
func (*RTPRelaySession) StartRTCPReportSchedule ¶
func (s *RTPRelaySession) StartRTCPReportSchedule(ctx context.Context, cfg RTPRelayRTCPReportScheduleConfig) error
func (*RTPRelaySession) Stats ¶
func (s *RTPRelaySession) Stats() RTPRelayStats
func (*RTPRelaySession) StopRTCPReportSchedule ¶
func (s *RTPRelaySession) StopRTCPReportSchedule()
func (*RTPRelaySession) Transforms ¶
func (s *RTPRelaySession) Transforms() RTPRelayTransforms
type RTPRelayStats ¶
type RTPRelayStats struct {
ClientToIMSPackets uint64
IMSToClientPackets uint64
ClientToIMSBytes uint64
IMSToClientBytes uint64
ClientToIMSRTPPackets uint64
IMSToClientRTPPackets uint64
ClientToIMSRTCPPackets uint64
IMSToClientRTCPPackets uint64
ClientToIMSRTPBytes uint64
IMSToClientRTPBytes uint64
ClientToIMSRTCPBytes uint64
IMSToClientRTCPBytes uint64
ClientToIMSRTPDrops uint64
IMSToClientRTPDrops uint64
ClientToIMSRTCPDrops uint64
IMSToClientRTCPDrops uint64
RTCPFeedbackPackets uint64
RTCPFeedbackParseErrors uint64
RTCPSenderReports uint64
RTCPReceiverReports uint64
RTCPPictureLossIndications uint64
RTCPFullIntraRequests uint64
RTCPRapidResynchronizationRequests uint64
RTCPTransportLayerNacks uint64
RTCPReceiverEstimatedMaximumBitrates uint64
RTCPTransportLayerCongestionControls uint64
RTCPSliceLossIndications uint64
RTCPExtendedReports uint64
RTCPSourceDescriptions uint64
RTCPGoodbyes uint64
RTCPApplicationDefined uint64
RTCPUnknownPackets uint64
RTPDTMFEvents uint64
RTPDTMFEndEvents uint64
RTPDTMFClientToIMSEvents uint64
RTPDTMFIMSToClientEvents uint64
RTPDTMFRemappedEvents uint64
RTPDTMFClientToIMSRemappedEvents uint64
RTPDTMFIMSToClientRemappedEvents uint64
RTPDTMFParseErrors uint64
ClientToIMSRTPStreams []RTPStreamStats
IMSToClientRTPStreams []RTPStreamStats
}
type RTPRelayTransform ¶
type RTPRelayTransforms ¶
type RTPRelayTransforms struct {
ClientToIMSRTP RTPRelayTransform
IMSToClientRTP RTPRelayTransform
ClientToIMSRTCP RTPRelayTransform
IMSToClientRTCP RTPRelayTransform
GeneratedToIMSRTP RTPRelayTransform
GeneratedToClientRTP RTPRelayTransform
GeneratedToIMSRTCP RTPRelayTransform
GeneratedToClientRTCP RTPRelayTransform
}
type RTPStreamDiagnosis ¶
type RTPStreamDiagnosis struct {
SSRC uint32
Status RTPStreamDiagnosisStatus
Reasons []RTPStreamDiagnosisReason
Loss RTPStreamLossDiagnosis
Jitter RTPStreamJitterDiagnosis
RTCPKeepalive RTPStreamRTCPKeepaliveDiagnosis
}
func DiagnoseRTPStreamStats ¶
func DiagnoseRTPStreamStats(stats []RTPStreamStats, cfg RTPStreamDiagnosisConfig) []RTPStreamDiagnosis
DiagnoseRTPStreamStats classifies RTP stream snapshots without touching the network or requiring a live relay. The output preserves input order.
type RTPStreamDiagnosisConfig ¶
type RTPStreamDiagnosisConfig struct {
ClockRate int
MinExpectedPackets uint64
LossWarningFraction uint8
LossCriticalFraction uint8
JitterWarning time.Duration
JitterCritical time.Duration
RoundTripWarning time.Duration
RoundTripCritical time.Duration
RTCPKeepaliveInterval time.Duration
RTCPKeepaliveGrace time.Duration
RequireRTCP bool
}
RTPStreamDiagnosisConfig tunes the conservative thresholds used to classify a received RTP stream and remote RTCP reception reports. RTCP keepalive classification is enabled only when RTCPKeepaliveInterval is positive or RequireRTCP is true.
type RTPStreamDiagnosisReason ¶
type RTPStreamDiagnosisReason string
const ( RTPStreamDiagnosisReasonNoRTP RTPStreamDiagnosisReason = "no_rtp" RTPStreamDiagnosisReasonPacketLoss RTPStreamDiagnosisReason = "packet_loss" RTPStreamDiagnosisReasonJitter RTPStreamDiagnosisReason = "jitter" RTPStreamDiagnosisReasonRTCPKeepalive RTPStreamDiagnosisReason = "rtcp_keepalive" RTPStreamDiagnosisReasonRoundTripTime RTPStreamDiagnosisReason = "round_trip_time" )
type RTPStreamDiagnosisStatus ¶
type RTPStreamDiagnosisStatus string
const ( RTPStreamDiagnosisStatusUnknown RTPStreamDiagnosisStatus = "unknown" RTPStreamDiagnosisStatusOK RTPStreamDiagnosisStatus = "ok" RTPStreamDiagnosisStatusWarning RTPStreamDiagnosisStatus = "warning" RTPStreamDiagnosisStatusCritical RTPStreamDiagnosisStatus = "critical" )
type RTPStreamJitterDiagnosis ¶
type RTPStreamJitterDiagnosis struct {
Status RTPStreamDiagnosisStatus
Jitter uint32
Duration time.Duration
}
type RTPStreamLossDiagnosis ¶
type RTPStreamLossDiagnosis struct {
Status RTPStreamDiagnosisStatus
FractionLost uint8
LostPackets uint64
ExpectedPackets uint64
}
type RTPStreamStats ¶
type RTPStreamStats struct {
SSRC uint32
Packets uint64
DuplicatePackets uint64
OutOfOrderPackets uint64
ExpectedPackets uint64
LostPackets uint64
FractionLost uint8
LastSequenceNumber uint32
SequenceRollovers uint32
LastTimestamp uint64
TimestampRollovers uint32
Jitter uint32
LastSenderReport uint32
Delay uint32
}
RTPStreamStats is a reception snapshot for one RTP SSRC.
func (RTPStreamStats) Diagnose ¶
func (s RTPStreamStats) Diagnose(cfg RTPStreamDiagnosisConfig) RTPStreamDiagnosis
Diagnose classifies packet loss, jitter, and RTCP keepalive freshness for one RTP stream snapshot.
type RTPStreamStatsTracker ¶
type RTPStreamStatsTracker struct {
// contains filtered or unexported fields
}
RTPStreamStatsTracker keeps RTP reception statistics split by SSRC.
func NewRTPStreamStatsTracker ¶
func NewRTPStreamStatsTracker() *RTPStreamStatsTracker
NewRTPStreamStatsTracker returns an empty tracker. The zero value is also usable.
func (*RTPStreamStatsTracker) ObserveRTCPPacket ¶
func (t *RTPStreamStatsTracker) ObserveRTCPPacket(packet []byte, arrival time.Time) ([]RTPStreamStats, error)
ObserveRTCPPacket parses one RTCP datagram and records any Sender Reports it contains. Snapshots are returned only for SSRCs whose RTP stream is already being tracked; Sender Reports for future streams are still remembered.
func (*RTPStreamStatsTracker) ObserveRTCPSenderReport ¶
func (t *RTPStreamStatsTracker) ObserveRTCPSenderReport(ssrc uint32, ntpTime uint64, arrival time.Time) (RTPStreamStats, bool)
ObserveRTCPSenderReport records the newest SR timing for an RTP source so future RTCP reception reports can include LSR/DLSR timing fields.
func (*RTPStreamStatsTracker) ObserveRTPPacket ¶
func (t *RTPStreamStatsTracker) ObserveRTPPacket(packet []byte, arrival time.Time, clockRate int) (RTPStreamStats, error)
ObserveRTPPacket parses one RTP packet and updates the matching SSRC stream.
func (*RTPStreamStatsTracker) Stats ¶
func (t *RTPStreamStatsTracker) Stats() []RTPStreamStats
Stats returns deterministic snapshots ordered by SSRC.
func (*RTPStreamStatsTracker) StatsAt ¶
func (t *RTPStreamStatsTracker) StatsAt(now time.Time) []RTPStreamStats
StatsAt returns deterministic snapshots ordered by SSRC with DLSR measured against now for streams that have observed an RTCP sender report.
func (*RTPStreamStatsTracker) StatsForSSRC ¶
func (t *RTPStreamStatsTracker) StatsForSSRC(ssrc uint32) (RTPStreamStats, bool)
StatsForSSRC returns a snapshot for one SSRC when the tracker has observed it.
func (*RTPStreamStatsTracker) StatsForSSRCAt ¶
func (t *RTPStreamStatsTracker) StatsForSSRCAt(ssrc uint32, now time.Time) (RTPStreamStats, bool)
StatsForSSRCAt returns a snapshot for one SSRC with DLSR measured against now.
type SDPAMRFMTPCompatibility ¶
type SDPAMRFMTPCompatibility struct {
Compatible bool
Status SDPAMRFMTPCompatibilityStatus
Parameter string
AnswerFMTP string
}
SDPAMRFMTPCompatibility describes whether offered AMR/AMR-WB fmtp parameters can satisfy a local codec preference and, when compatible, the fmtp to answer.
func ClassifySDPAMRFMTPCompatibility ¶
func ClassifySDPAMRFMTPCompatibility(offered, want string) SDPAMRFMTPCompatibility
ClassifySDPAMRFMTPCompatibility checks whether offered AMR/AMR-WB fmtp parameters can satisfy a local codec preference.
type SDPAMRFMTPCompatibilityStatus ¶
type SDPAMRFMTPCompatibilityStatus string
const ( SDPAMRFMTPCompatible SDPAMRFMTPCompatibilityStatus = "compatible" SDPAMRFMTPIncompatibleParameter SDPAMRFMTPCompatibilityStatus = "incompatible_parameter" SDPAMRFMTPIncompatibleModeSet SDPAMRFMTPCompatibilityStatus = "incompatible_mode_set" )
type SDPAnswerOptions ¶
type SDPCodec ¶
func NewSDPAMRCodec ¶
func NewSDPAMRWBCodec ¶
func NewSDPPCMACodec ¶
func NewSDPPCMACodec() SDPCodec
func NewSDPPCMUCodec ¶
func NewSDPPCMUCodec() SDPCodec
func SelectSDPAnswerCodecs ¶
type SDPCryptoAttribute ¶
func BuildSDPCryptoAttribute ¶
func BuildSDPCryptoAttribute(tag string, profile SRTPProtectionProfile, params SDPCryptoInlineKeyParams, sessionParams string) (SDPCryptoAttribute, error)
func (SDPCryptoAttribute) SDPValue ¶
func (a SDPCryptoAttribute) SDPValue() string
type SDPCryptoInlineKeyParams ¶
type SDPCryptoInlineKeyParams struct {
MasterKey []byte
MasterSalt []byte
Lifetime string
MKIValue string
MKILength int
}
func ParseSDPCryptoInlineKeyParams ¶
func ParseSDPCryptoInlineKeyParams(profile SRTPProtectionProfile, keyParams string) (SDPCryptoInlineKeyParams, error)
type SDPFingerprintAttribute ¶
func (SDPFingerprintAttribute) SDPValue ¶
func (a SDPFingerprintAttribute) SDPValue() string
type SDPInfo ¶
type SDPInfo struct {
ConnectionIP string
MediaPort int
RTCPIP string
RTCPPort int
Payloads []int
TelephoneEventPayloads map[uint8]int
Direction string
PTimeMS int
MaxPTimeMS int
}
func SDPInfoWithCodecs ¶
type SDPMediaDescription ¶
type SDPMediaDescription struct {
Info SDPInfo
RTPProfile string
RTCPMux bool
ExplicitRTCP bool
Codecs []SDPCodec
}
func ParseSDPMediaDescription ¶
func ParseSDPMediaDescription(body []byte) (SDPMediaDescription, error)
type SDPMediaRewriteOptions ¶
type SDPMediaRewriteOptions struct {
RTCPMux bool
}
type SDPRTCPFeedbackAttribute ¶
func ParseSDPRTCPFeedbackAttributes ¶
func ParseSDPRTCPFeedbackAttributes(body []byte) ([]SDPRTCPFeedbackAttribute, error)
func ParseSDPRTCPFeedbackLine ¶
func ParseSDPRTCPFeedbackLine(line string) (SDPRTCPFeedbackAttribute, bool, error)
func SelectSDPRTCPFeedbackAnswer ¶
func SelectSDPRTCPFeedbackAnswer(offer, local []SDPRTCPFeedbackAttribute, payloads []int) []SDPRTCPFeedbackAttribute
func (SDPRTCPFeedbackAttribute) AppliesToPayload ¶
func (a SDPRTCPFeedbackAttribute) AppliesToPayload(payload int) bool
func (SDPRTCPFeedbackAttribute) RTCPFeedbackKind ¶
func (a SDPRTCPFeedbackAttribute) RTCPFeedbackKind() RTCPFeedbackKind
func (SDPRTCPFeedbackAttribute) SDPValue ¶
func (a SDPRTCPFeedbackAttribute) SDPValue() string
type SDPRTCPFeedbackPolicy ¶
type SDPRTCPFeedbackPolicy struct {
Payload int
TransportLayerNack bool
PictureLossIndication bool
FullIntraRequest bool
ReceiverEstimatedMaximumBitrate bool
TransportLayerCongestionControl bool
SliceLossIndication bool
}
func BuildSDPRTCPFeedbackPolicy ¶
func BuildSDPRTCPFeedbackPolicy(attrs []SDPRTCPFeedbackAttribute, payload int) SDPRTCPFeedbackPolicy
func (SDPRTCPFeedbackPolicy) Allows ¶
func (p SDPRTCPFeedbackPolicy) Allows(kind RTCPFeedbackKind) bool
type SDPSecurityAnswerOptions ¶
type SDPSecurityAnswerOptions struct {
RTPProfiles []string
Crypto []SDPCryptoAttribute
Fingerprints []SDPFingerprintAttribute
Setup string
PreferCrypto bool
}
type SDPSecurityInfo ¶
type SDPSecurityInfo struct {
RTPProfile string
Crypto []SDPCryptoAttribute
Fingerprints []SDPFingerprintAttribute
Setup string
RTCPMux bool
RTCPMuxOnly bool
RTCPReducedSize bool
RTCPFeedback []SDPRTCPFeedbackAttribute
UnknownAttributes []string
}
func ParseSDPSecurity ¶
func ParseSDPSecurity(body []byte) (SDPSecurityInfo, error)
func SelectSDPSecurityAnswer ¶
func SelectSDPSecurityAnswer(offer SDPSecurityInfo, options SDPSecurityAnswerOptions) (SDPSecurityInfo, error)
func (SDPSecurityInfo) HasSecurityAttributes ¶
func (s SDPSecurityInfo) HasSecurityAttributes() bool
func (SDPSecurityInfo) IsZero ¶
func (s SDPSecurityInfo) IsZero() bool
type SRTPKeys ¶
func GenerateSRTPKeys ¶
func GenerateSRTPKeys(profile SRTPProtectionProfile, random io.Reader) (SRTPKeys, error)
type SRTPMediaConfig ¶
type SRTPMediaConfig struct {
Profile SRTPProtectionProfile
ClientKeys SRTPKeys
IMSKeys SRTPKeys
ClientProtectKeys SRTPKeys
ClientUnprotectKeys SRTPKeys
IMSProtectKeys SRTPKeys
IMSUnprotectKeys SRTPKeys
ReplayWindowSize uint
RTCPFeedbackHandler RTCPFeedbackHandler
RTPDTMFHandler RTPDTMFHandler
RTPPlaintextHandler RTPPlaintextHandler
ClientRTPDTMFPayloads map[uint8]int
IMSRTPDTMFPayloads map[uint8]int
}
type SRTPMediaSession ¶
type SRTPMediaSession struct {
// contains filtered or unexported fields
}
func NewSRTPMediaSession ¶
func NewSRTPMediaSession(cfg SRTPMediaConfig) (*SRTPMediaSession, error)
func (*SRTPMediaSession) ClientToIMSRTCP ¶
func (s *SRTPMediaSession) ClientToIMSRTCP(packet []byte) ([]byte, error)
func (*SRTPMediaSession) ClientToIMSRTP ¶
func (s *SRTPMediaSession) ClientToIMSRTP(packet []byte) ([]byte, error)
func (*SRTPMediaSession) IMSToClientRTCP ¶
func (s *SRTPMediaSession) IMSToClientRTCP(packet []byte) ([]byte, error)
func (*SRTPMediaSession) IMSToClientRTP ¶
func (s *SRTPMediaSession) IMSToClientRTP(packet []byte) ([]byte, error)
func (*SRTPMediaSession) ProtectClientRTCP ¶
func (s *SRTPMediaSession) ProtectClientRTCP(packet []byte) ([]byte, error)
func (*SRTPMediaSession) ProtectClientRTP ¶
func (s *SRTPMediaSession) ProtectClientRTP(packet []byte) ([]byte, error)
func (*SRTPMediaSession) ProtectIMSRTCP ¶
func (s *SRTPMediaSession) ProtectIMSRTCP(packet []byte) ([]byte, error)
func (*SRTPMediaSession) ProtectIMSRTP ¶
func (s *SRTPMediaSession) ProtectIMSRTP(packet []byte) ([]byte, error)
func (*SRTPMediaSession) RelayTransforms ¶
func (s *SRTPMediaSession) RelayTransforms() RTPRelayTransforms
func (*SRTPMediaSession) RelayTransformsWithMediaEvents ¶
func (s *SRTPMediaSession) RelayTransformsWithMediaEvents(rtcpHandler RTCPFeedbackHandler, dtmfHandler RTPDTMFHandler, clientRTPDTMFPayloads, imsRTPDTMFPayloads map[uint8]int) RTPRelayTransforms
func (*SRTPMediaSession) RelayTransformsWithMediaObservers ¶
func (s *SRTPMediaSession) RelayTransformsWithMediaObservers(rtcpHandler RTCPFeedbackHandler, dtmfHandler RTPDTMFHandler, rtpHandler RTPPlaintextHandler, clientRTPDTMFPayloads, imsRTPDTMFPayloads map[uint8]int) RTPRelayTransforms
func (*SRTPMediaSession) RelayTransformsWithRTCPFeedback ¶
func (s *SRTPMediaSession) RelayTransformsWithRTCPFeedback(handler RTCPFeedbackHandler) RTPRelayTransforms
func (*SRTPMediaSession) UnprotectClientRTCP ¶
func (s *SRTPMediaSession) UnprotectClientRTCP(packet []byte) ([]byte, error)
func (*SRTPMediaSession) UnprotectClientRTP ¶
func (s *SRTPMediaSession) UnprotectClientRTP(packet []byte) ([]byte, error)
func (*SRTPMediaSession) UnprotectIMSRTCP ¶
func (s *SRTPMediaSession) UnprotectIMSRTCP(packet []byte) ([]byte, error)
func (*SRTPMediaSession) UnprotectIMSRTP ¶
func (s *SRTPMediaSession) UnprotectIMSRTP(packet []byte) ([]byte, error)
type SRTPProtectionProfile ¶
type SRTPProtectionProfile string
const ( SRTPProfileAes128CmHmacSha1_80 SRTPProtectionProfile = "AES_CM_128_HMAC_SHA1_80" SRTPProfileAes128CmHmacSha1_32 SRTPProtectionProfile = "AES_CM_128_HMAC_SHA1_32" SRTPProfileAes256CmHmacSha1_80 SRTPProtectionProfile = "AES_CM_256_HMAC_SHA1_80" SRTPProfileAes256CmHmacSha1_32 SRTPProtectionProfile = "AES_CM_256_HMAC_SHA1_32" SRTPProfileAeadAes128Gcm SRTPProtectionProfile = "AEAD_AES_128_GCM" SRTPProfileAeadAes256Gcm SRTPProtectionProfile = "AEAD_AES_256_GCM" )
func SRTPProtectionProfileFromSDPCryptoSuite ¶
func SRTPProtectionProfileFromSDPCryptoSuite(suite string) (SRTPProtectionProfile, error)
func (SRTPProtectionProfile) SDPCryptoSuite ¶
func (p SRTPProtectionProfile) SDPCryptoSuite() string