[asterisk-users] GoSub & Queue

Shaun R. mailinglists at unix-scripts.com
Fri Mar 6 12:26:18 CST 2009


I have a caller screen queue setup.  Basically a caller calls in, goes 
through a IVR, and before that caller is put into the queue, they get a sub 
ran on them first asking for them to say there name.  That gets saved and 
they are entered into the queue using Queue(mainqueue,,,,300).

In the queues.conf i have a list of members these are 
local/extension at external-default, there are two weights/prioritys 10 and 20.

The external-default context has a dial that uses a GoSub to play the 
recording of the caller to the member, it them gives the member a list of 
options like Connect, Voicemail, Hangup.

The problem i'm having right now is that if a member pics up, all the phones 
of the other members continue to ring (ringall in queues.conf) while the 
member who answered the phone listens to the announce.  Once he chooses a 
option they stop.  If he doesnt choose a option and lets those phones dial 
time out then they stop ringing but whats weird is that queue doesnt go and 
ring the next priority.  I dont want it to ring the next priority but i find 
it weird that the queue knows that sombody has the call, but doesnt stop 
rining those other extensions.


Now here's another way i found to do this, rather than using dial with a 
gosub i found that i can put the gosub as part of the queue() command.  [ 
example: Queue(mainqueue,,,,300,,,screencallee) ].  This will run that gosub 
when the member pics up and it DOES stop ringing all the other phones when 
they pickup which is great!  problem is that now my options like Voicemail 
or if the member hangs up with out choosing a option the call is dumped from 
teh queue and the GOSUB_RESULT doesnt look to be checked or listened too.

Here's a snip of my screen subs



[screencaller]
exten => s,1,Set(__SCREEN_FILE=/tmp/screens-${UNIQUEID})
exten => s,n,Playback(screen-say-name)
exten => s,n,Wait(1)
exten => s,n,Record(${SCREEN_FILE}.gsm,3,6)
exten => s,n,Playback(screen-please-hold)
exten => s,n,Return

[screencallee]
exten => s,1,answer
exten => s,2,Set(GOSUB_RESULT=CONTINUE); set default to continue so that if 
something funky happens the call is returned to the queue
exten => 
s,3,background(screen-call-for&${SCREEN_CALL_TO}&from&${SCREEN_FILE}&screen-press-1-connect&screen-press-2-hold&screen-press-3-voicemail&/screen-press-4-hangup)
exten => s,4,WaitExten(20)
;; Connect the caller
exten => 1,1,Set(GOSUB_RESULT="")
exten => 1,2,Return
;; Put Caller on Hold
exten => 2,1,Set(HOLD_LOOPCOUNT=0)
exten => 2,2,read(HOLD_OPT,screen-on-hold,1,,1,5)
exten => 2,3,GotoIf($["${HOLD_OPT}" != "" ]?s,1)
exten => 2,4,GotoIf($[${HOLD_LOOPCOUNT} > 10]?h,1)
exten => 2,5,Set(HOLD_LOOPCOUNT=$[${HOLD_LOOPCOUNT}] + 1])
exten => 2,6,Goto(2,2)
;; Send the caller to voicemail
exten => 3,1,Set(GOSUB_RESULT=GOTO:voicemail^${SCREEN_VM_EXT}^1)
exten => 3,2,Return
;; Hangup on the caller
exten => 4,1,Set(GOSUB_RESULT=GOTO:hangup^s^1)
exten => 4,2,Return
;; Return Caller to queue
exten => 5,1,Set(GOSUB_RESULT=CONTINUE);
exten => 5,2,Return
;; Reidentify the caller
exten => 6,1,Goto(s,1)
;; Invalid Option
exten => i,1,Playback(invalidoption)
exten => i,2,Goto(s,1)
;; Timeout Reached :: Hangup Called Party, Return Callee to Queue
exten => t,1,Set(GOSUB_RESULT=CONTINUE)
exten => t,2,Noop(GOSUB: screencallee timed out)
exten => t,3,Return
;; Hangup :: Hangup Called Party, Return Callee to Queue
exten => h,1,Set(GOSUB_RESULT=CONTINUE)
exten => h,2,Noop(GOSUB: screencallee hangup)
exten => h,3,Return

Any help?

~Shaun 





More information about the asterisk-users mailing list