[pjsip] Handling DTMF packets with jitter buffer

Vitaly Lokhmatov lokhmatov at gmail.com
Wed Nov 21 15:28:35 EST 2007

Hi Benny,

I'm working on the project that uses RTP stack from pjmedia library. There
is a need to handle incoming DTMF events differently than it is currently
done by pjmedia. Actually, what we need is jitter buffer that is able to
handle DTMF packets. In stream.c, DTMF packets are handled straight away
they are received from the transport layer, omitting jitter buffer. This is
enough for reporting the sequence of incoming DTMF events (as supported by
pjmedia stream API), but not enough to maintain synchronization with audio
data. PJMEDIA doesn't bind DTMF events to any time frame. However, RTP and
RFC2833 do. In order to support this, DTMF packets should pass through
jitter buffer and be in sync with audio data. Could you advice, how it is
possible to achieve? I suggest the following:

1. Adding PJ_DECL(void) pjmedia_jbuf_put_dtmf_event( pjmedia_jbuf *jb, const
pjmedia_rtp_dtmf_event* event, int frame_seq). 
2. Adding PJMEDIA_JB_DTMF_FRAME item to pjmedia_jb_frame_type enum.
pjmedia_jbuf_get_frame function would return this constant as *p_frm_type
value. In such case, frame parameter value should be interpreted as

Do you think such changes to jitter buffer source code are reasonable? Do
you have any other suggestions?

Thank you,
	Vitaly Lokhmatov

More information about the pjsip mailing list