diff options
author | Benny Prijono <bennylp@teluu.com> | 2007-08-02 15:41:46 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2007-08-02 15:41:46 +0000 |
commit | c1f3104509fd71965b901afada0694ee544ad9b1 (patch) | |
tree | 89fcb009b67acd9f4988d72e063e71c8d12cdb44 | |
parent | 836c17eb96db315c9be2ab3ece9ba934d1fe2caf (diff) |
Fixed ticket #361: Extraneous RTP packet with RFC 2833 DTMF events (thanks Pedro Sanchez)
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1413 74dad513-b988-da41-8d7b-12977e46ad98
-rw-r--r-- | pjmedia/src/pjmedia/stream.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/pjmedia/src/pjmedia/stream.c b/pjmedia/src/pjmedia/stream.c index fec74e9a..924d4573 100644 --- a/pjmedia/src/pjmedia/stream.c +++ b/pjmedia/src/pjmedia/stream.c @@ -386,6 +386,13 @@ static void create_dtmf_payload(pjmedia_stream *stream, cur_ts = pj_ntohl(stream->enc->rtp.out_hdr.ts); duration = cur_ts - digit->start_ts; + if (duration == 0) { + PJ_LOG(5,(stream->port.info.name.ptr, "Sending DTMF digit id %c", + digitmap[digit->event])); + duration = stream->port.info.samples_per_frame; + digit->start_ts = cur_ts - duration; + } + event->event = (pj_uint8_t)digit->event; event->e_vol = 10; event->duration = pj_htons((pj_uint16_t)duration); @@ -408,9 +415,6 @@ static void create_dtmf_payload(pjmedia_stream *stream, digitmap[stream->tx_dtmf_buf[0].event])); } - } else if (duration == 0) { - PJ_LOG(5,(stream->port.info.name.ptr, "Sending DTMF digit id %c", - digitmap[digit->event])); } @@ -1646,8 +1650,7 @@ PJ_DEF(pj_status_t) pjmedia_stream_get_dtmf( pjmedia_stream *stream, /* * Set callback to be called upon receiving DTMF digits. */ -PJ_DEF(pj_status_t) -pjmedia_stream_set_dtmf_callback(pjmedia_stream *stream, +PJ_DEF(pj_status_t) pjmedia_stream_set_dtmf_callback(pjmedia_stream *stream, void (*cb)(pjmedia_stream*, void *user_data, int digit), |