[Asterisk-Users] app_queue input needed...

David C. Troy dave at toad.net
Sun Sep 7 08:05:25 MST 2003


Brian,

I just finished doing both of these mods myself.  The patch is available 
here:

http://asterisk.toad.net/app_queue.c-pos+holdtimepatch

You might take a look and see if it helps you at all.  I make no claims 
that mine is a definitive version;  I just did it to suit my own needs.

A couple of things you might want to watch out for with your own coding:

 - someone had posted a similar patch in June (from pbx.usedontmiss.com) 
from which I borrowed some ideas, however, this version made the mistake 
of announcing queue position from inside a thread-locked code section, 
which will interrupt music-on-hold for all callers while their positions 
are announced.  My version does the announcements outside of the 
thread-lock.  See end of leave_queue.

 - If you are caller #4 and callers #3 and #2 leave in rapid succession, 
you'll be trying to announce position to caller #4 twice, quickly, 
possibly interleaving your announcements.  To solve this problem, no 
announcement is made if a position announcement was last made within the 
last 15 seconds.  See the first couple of lines of say_position.

My version operates along these lines:

 - To turn on position/holdtime announcements, just define 
'announcetimeout' in queues.conf; position/holdtime announcements will be 
made at that interval.

 - The guts of the operation is in say_position and get_avg_holdtime; 
changes to the rest of the code have been minimized.

 - No position/holdtime announcement is made if the caller is the only 
caller in the queue when they enter the queue.

 - A special 'you're next' announcement is played when position == 1

 - Holdtime is only announced if it is 4 minutes or greater; this is 
arbitrary and could be rolled into a configurable queues.conf setting.

 - You need to add the following files to /var/lib/asterisk/sounds:

   YouAreNext	"You are now first in line; your call will be next"
   ThereAre	"There are currently..."
   CallsWaiting "Calls Waiting"
   AvgHoldTime  "The approximate average hold time is currently..."
   Minutes	"Minutes"
   ThankYou	"Thank you for your patience"

It would be cool if we could get Mark to have Allison record these files 
for distribution with the package, once this family of features is 
committed to app_queue.

I like the idea of rounding up to "under 5, under 10, under 15" 
announcements as well, as it would sound less cheesy and be better at 
setting realistic, but not exact, holdtime expectations.

I also want to see the ability to fail out of a queue (perhaps defined in 
terms of X number of retry/timeout cycles) and will be working on this 
today some.

Seems like there are several people working on this family of problems 
(pos/holdtime/fail out) and it might make sense for us to work together 
some and standardize our approach.  Otherwise we're going to end up with 5 
versions of app_queue.

Dave

=====================================================================
David C. Troy   [dave at toad.net]                   410-384-2500 Sales
ToadNet - Want to go fast?                        410-544-1329 FAX
570 Ritchie Highway, Severna Park, MD 21146-2925  www.toad.net

On Fri, 5 Sep 2003, Brian West wrote:

> A friend and I have recently added the ability to announce the callers
> position in the call queue every x seconds.. or even just inject an
> anouncement every x seconds.  All setup in queues.conf and can be setup
> per queue.
> 
> My next project is to add the ability to announce the callers estimated
> wait time.  I want some feedback to see whats the best method to calculate
> that?  What do you want just minutes? or minutes and seconds?  Or the
> option to use one or the other?
> 
> I'm thinking (totaltime / totalcalls) - (now - qe->start) = current
> estimated wait time.  Which would update after each call is hungup.
> 
> http://bugs.digium.com/bug_view_page.php?bug_id=0000214
> 
> 
> Please let me know what you would like to see!?!?!
> 
> Thanks,
> bkw
> _______________________________________________
> Asterisk-Users mailing list
> Asterisk-Users at lists.digium.com
> http://lists.digium.com/mailman/listinfo/asterisk-users
> 




More information about the asterisk-users mailing list