Documentation
¶
Index ¶
Constants ¶
View Source
const SDPName = "telephone-event/8000"
View Source
const SampleRate = 8000
Variables ¶
This section is empty.
Functions ¶
func Write ¶
func Write(ctx context.Context, audio media.Writer[media.PCM16Sample], events *rtp.Stream, startTs uint32, digits string) error
Write in-band (analog) and off-band (digital) DTMF tones to audio and RTP streams respectively.
Digits may contain a special character 'w' which adds a 0.5 sec delay.
Types ¶
type Event ¶
type Event struct {
Code byte
Digit byte
Volume byte // in dBm0 (without sign)
Dur uint16 // in timestamp units
End bool
}
func DecodeRTPWithEnd ¶
DecodeRTPWithEnd decodes a DTMF event from an RTP packet using both the Marker bit and the End bit to determine event completion. This is useful for SIP providers that may or may not set the Marker bit. See RFC 4733 §2.3.1.
Click to show internal directories.
Click to hide internal directories.