Summary:ASTERISK-10455: 2 features, ring expiry and periodic announce firstplay
Reporter:Paul W (kwakwaversal)Labels:
Date Opened:2007-10-05 09:05:49Date Closed:2011-06-07 14:03:26
Versions:Frequency of
Environment:Attachments:( 0) app_queue_firstplay.patch
( 1) app_queue_ringexpiry.patch
Description:Posted both these together because they work hand in hand (but will also work separately).

1st feature; ringexpiry

; When the 'r' option is passed to the Queue() you can expire the ringing
; then start music on hold.  If you use this with periodic-announce-frequency
; and set it to the same value, when the ring expires it will play the
; periodic announce then start the music on hold.
; ringexpiry = 10

2nd feature; periodic-announce-firstplay

; When to play the first periodic announcement.  This allows you to
; play the first announcement at the beginning of the call then revert
; back to a much higher frequency (0=off)


I combine these features together and using the queue config below the call flow is as follows:-

Enter queue-basic -> ring 10 secs -> play announcement, start on hold music -> hold music for 20 secs -> play announcement (loop)

exten   => _XXXXX.,n,Queue(queue-basic,r,,,)

strategy                = rrmemory
joinempty               = strict
servicelevel            = 10
ringinuse               = no
ringexpiry              = 10
autopause               = no
periodic-announce       = please-hold-the-line
periodic-announce-firstplay = 10
periodic-announce-frequency = 20
announce-frequency      = 0
announce-holdtime       = no
reportholdtime          = no
autofill                = yes
eventwhencalled         = vars
timeout                 = 10
retry                   = 1
Comments:By: Paul W (kwakwaversal) 2007-10-05 09:12:34

Apologies putnopvut for setting the Asterisk Version to 1.4.11 on my last submission, u were quite right, I did put the wrong version in my description :)

By: Mark Michelson (mmichelson) 2007-10-05 14:44:35

Wouldn't this do the same thing:

;Higher priorities...
exten => _XXXXX,n,Playtones(ring)
exten => _XXXXX,n,Wait(10)
exten => _XXXXX,n,StopPlayTones()
exten => _XXXXX,n,Playback(periodic-announce-file)
exten => _XXXXX,n,Queue(queue-basic)    ;note: no r option
;Lower priorities...

By: Paul W (kwakwaversal) 2007-10-05 18:57:13

Yes it would but this patch does it inside the Queue() so the call can still be answered by an agent the mean time.  Your dialplan example doesn't allow the call to be answered until Queue() adding an unnecessary 10 second wait time to the beginning of each call.

The purpose of this patch isn't to simulate a ring then announce then hold music.  It is to add the option for the asterisk user to queue a call initially with ringing BUT expire the ringing if it isn't answered within a certain number of seconds without the need for separate dialplan logic (queue timeout then queue reentry.)

I did this because the call centre I work for has an SLA of 10 seconds but if it's outside the SLA they wanted to inform the caller that their call would be answered soon.  Initially I expired the Queue(), played a .wav and then re-entered the queue with a higher queue priority (because it had left the original queue and its position inside it) but that seemed too cumbersome and made it harder to use queue priorities.  Thus this patch was born :)

By: Mark Michelson (mmichelson) 2007-10-31 11:04:13

Sorry it's been so long since I commented on this, but I had been assigned some higher-priority issues.

I see where you're coming from here, so my dialplan suggestion is not good for your case. I think, though, that your patch is actually overly complicated.

What if, instead of the two options you suggest, we implement a different option, something like "ringfirst" or something, which on the first iteration of attempting to reach queue members would ring, but on subsequent iterations would play hold music. This would mean a simpler configuration, would be easier to explain, and I'm pretty sure it would be easier to code, too. I realize this would remove some flexibility that you provide, but I can't really see anyone using the ringexpiry and periodic-announce-firstplay for any other purpose than the scenario you provided.

From what I understand, an option like this would also work in your environment. Do you have any arguments against what I have suggested?

By: Paul W (kwakwaversal) 2007-11-07 09:22:03.000-0600

Yeah, that does makes sense.  

It does remove quite a bit of the flexibility though but you have a lot more experience with the mindset of the general asterisk user.  I know its very limited of me but I can only see the two separate options with their flexibility to cover all possible requirements.

I'm happy with what you've suggested, but would another option be needed if you want the periodic-announcement to play when the "ringfirst" expires?

The periodic-announcement-firstplay might also be good for people who don't even use the ring but jump straight into the hold music.  If the normal announcement is 60 seconds they may still want to play the announcement on entering or 10s into the hold music?  Just a thought.

By: Tilghman Lesher (tilghman) 2007-12-07 14:48:00.000-0600

I wonder if the firstplay option would be better served as a second argument to the periodic-announce-freqency, something like:


where the first number is optional (in other words, parsed right-to-left).  That would eliminate the extra option, while making it more clear as to what the option is referring to.

Second, in terms of the ringexpiry, I would prefer if you would use the optional argument to the r option directly in the Queue arguments, to specify a ring timeout.  That is:  "r" or "r(10)" (where the default is of course 0, to indicate no timeout).

By: Tilghman Lesher (tilghman) 2007-12-28 12:17:07.000-0600

kwakwaversal:  I need some feedback that you're going to address these issues.

By: Tilghman Lesher (tilghman) 2008-02-04 11:45:20.000-0600

No response from reporter