Documentation
¶
Overview ¶
Package dtmf decodes SIP RTP out-of-band DTMF (RFC 2833 / RFC 4733 telephone-event).
Requirements:
- The remote SDP must offer a=rtpmap:PT telephone-event/8000 (or /48000); pkg/sip/session passes that payload type to the RTP input transport.
- Key-up events are detected via the E (end) bit; in-band DTMF (audio tones) is not implemented.
SIP INFO: many clients (e.g. Linphone) send DTMF via INFO + application/dtmf-relay; use dtmf.DigitFromSIPINFO — handled in pkg/sip/server handleInfo → conversation.HandleSIPINFODTMF.
Env: SIP_TRANSFER_* for agent URI, SetTransferDialer in cmd/sip.
Package dtmf handles SIP RTP DTMF as telephone-event (RFC 2833 / RFC 4733).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AttachLogger ¶
func AttachLogger(ms *media.MediaSession)
AttachLogger registers a processor that logs DTMF digits at info level.
func AttachProcessor ¶
func AttachProcessor(ms *media.MediaSession, name string, h Handler)
AttachProcessor registers a high-priority processor that receives *media.DTMFPacket from the media session.
func DigitFromSIPINFO ¶
DigitFromSIPINFO extracts a DTMF digit from SIP INFO body (Linphone / many UAs use this instead of RTP). Supports:
- application/dtmf-relay: "Signal=X\r\n" where X is 0-9, *, #
- application/dtmf: "Signal=X"
If the body contains Signal=, it is parsed even when Content-Type is missing or non-dtmf.