ffeat: Implement custom RFC 4733 DTMF decoding with End-bit detection#585
ffeat: Implement custom RFC 4733 DTMF decoding with End-bit detection#585usluio wants to merge 1 commit intolivekit:mainfrom
Conversation
|
root seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
pkg/sip/media_port.go
Outdated
|
|
||
| // Custom decode: ignore Marker bit requirement from media-sdk | ||
| // Only emit event when End bit is set to prevent duplicates | ||
| if len(payload) < 4 { |
There was a problem hiding this comment.
Please file a PR to the media-sdk and add it as an alternative decoding mode (parameter or a new function) instead.
98e7e21 to
aa17506
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #585 +/- ##
==========================================
- Coverage 65.25% 64.63% -0.62%
==========================================
Files 51 34 -17
Lines 6588 6527 -61
==========================================
- Hits 4299 4219 -80
+ Misses 1915 1888 -27
- Partials 374 420 +46 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
usluio
left a comment
There was a problem hiding this comment.
We just needed to these logs for the point issue. When decode has an occured we can' t understand or see from logs. Needs that!
pkg/sip/media_port.go
Outdated
|
|
||
| // Custom decode: ignore Marker bit requirement from media-sdk | ||
| // Only emit event when End bit is set to prevent duplicates | ||
| if len(payload) < 4 { |
Summary
This PR implements custom DTMF RTP packet decoding that bypasses the Marker bit requirement
from
media-sdk, fixing an issue where DTMF events were silently dropped when SIP providersdo not set the RTP Marker bit on DTMF packets.
Problem
The existing
dtmf.DecodeRTP()frommedia-sdkrequires the RTP Marker bit to be seton incoming DTMF packets as specified in RFC 4733.
However, many SIP providers/gateways do not consistently set the Marker bit, causing DTMF
events to be completely ignored. This results in:
Solution
Custom DTMF Decoding (
media_port.go)dtmf.DecodeRTP()with a custom decoder that directly parses theRFC 4733 §2.3 payload format
event is complete, preventing duplicate events
0-9,*,#,a-d)as defined in RFC 4733 §7 (Event Code Registry)
Improved DTMF Forwarding (
inbound.go)SendData()— previously errors were silently discarded with_ =and buffer full conditions
Changes
pkg/sip/media_port.go— Custom RFC 4733 DTMF payload decodingpkg/sip/inbound.go— Enhanced DTMF forwarding with error handling and loggingReferences
Testing