Bug report:Tonegen clears tone count only once all tones played out

SK
Steve King
Tue, Feb 15, 2011 10:26 PM

Hi Developers,

Using PJSIP v1.7, I found that the current PJMEDIA tonegen only clears
the count of tones once all queued tones have been played out.
Therefore, the tone queue can fill up quickly, once full it prevents
further tones being queued for playout, even though there are less than
the maximum tones allowed that are remaining to be played out,
effectively blocking tone generation for PJMEDIA_TONEGEN_MAX_DIGITS (e.g
32) tones worth of time.

Fix:

  • Tone queue is now circular. Added "next" field to use as the
    insert index.
  • cur_digit is used as playout index.
    No more tones to play once cur_digit == next.
  • tonegen->count now stores the actual count of tones in the queue.
  • Added function to query number of tones queued.

See attach diff files. Please excuse the formatting change in c file.

--
BRgds,
Steve King

Design Engineer
Zetron Australasia

Hi Developers, Using PJSIP v1.7, I found that the current PJMEDIA tonegen only clears the count of tones once *all* queued tones have been played out. Therefore, the tone queue can fill up quickly, once full it prevents further tones being queued for playout, even though there are less than the maximum tones allowed that are remaining to be played out, effectively blocking tone generation for PJMEDIA_TONEGEN_MAX_DIGITS (e.g 32) tones worth of time. Fix: - Tone queue is now circular. Added "next" field to use as the insert index. - cur_digit is used as playout index. No more tones to play once cur_digit == next. - tonegen->count now stores the actual count of tones in the queue. - Added function to query number of tones queued. See attach diff files. Please excuse the formatting change in c file. -- BRgds, Steve King Design Engineer Zetron Australasia
SK
Steve King
Thu, Feb 17, 2011 3:38 AM

Hi again,

Sorry, found bug in previous fix, please ignore previous post.

tonegen.c diff attached.

Cheers,

Steve

On Wed, 2011-02-16 at 08:26 +1000, Steve King wrote:

Hi Developers,

Using PJSIP v1.7, I found that the current PJMEDIA tonegen only clears
the count of tones once all queued tones have been played out.
Therefore, the tone queue can fill up quickly, once full it prevents
further tones being queued for playout, even though there are less than
the maximum tones allowed that are remaining to be played out,
effectively blocking tone generation for PJMEDIA_TONEGEN_MAX_DIGITS (e.g
32) tones worth of time.

Fix:

  • Tone queue is now circular. Added "next" field to use as the
    insert index.
  • cur_digit is used as playout index.
    No more tones to play once cur_digit == next.
  • tonegen->count now stores the actual count of tones in the queue.
  • Added function to query number of tones queued.

See attach diff files. Please excuse the formatting change in c file.


Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

--
BRgds,
Steve King

Design Engineer
Zetron Australasia

Hi again, Sorry, found bug in previous fix, please ignore previous post. tonegen.c diff attached. Cheers, Steve On Wed, 2011-02-16 at 08:26 +1000, Steve King wrote: > Hi Developers, > > Using PJSIP v1.7, I found that the current PJMEDIA tonegen only clears > the count of tones once *all* queued tones have been played out. > Therefore, the tone queue can fill up quickly, once full it prevents > further tones being queued for playout, even though there are less than > the maximum tones allowed that are remaining to be played out, > effectively blocking tone generation for PJMEDIA_TONEGEN_MAX_DIGITS (e.g > 32) tones worth of time. > > Fix: > - Tone queue is now circular. Added "next" field to use as the > insert index. > - cur_digit is used as playout index. > No more tones to play once cur_digit == next. > - tonegen->count now stores the actual count of tones in the queue. > - Added function to query number of tones queued. > > See attach diff files. Please excuse the formatting change in c file. > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org -- BRgds, Steve King Design Engineer Zetron Australasia