Is possible to have callers leave the queue based on time/date criteria?
I know there is no leavewhenempty option as “time/date” on queues.conf , but this is precisely
what I am looking for : to force callers leave the queue after business hours, regardless of agents availability
Any suggestion? One approach I think is to have callers leave the call an check time/date on diaplan but does nor seem neat at all.
the simplest way is just before you put the caller in the queue you calculate how many seconds there is to end time and then set the timeout parameter
timeout Will cause the queue to fail out after a specified number of seconds
same => n,Set(RingTime=3600) ;Max Wait Time, 1h before we continue
same => n,Set(EndTime=10:00) ;HH:MM 24h
same => n,Set(EndSec=${STRPTIME(${STRFTIME(${EPOCH},CET,%C%y%m%d)}${EndTime},CET,%C%y%m%d%H:%M)});
same => n,Set(EndDuration=$[${EndSec} - ${EPOCH}]);
same => n,ExecIf($[${EndDuration} <= 0]?Set(EndDuration=$[${EndDuration}+86499]) ;Add 24h, note this can cause problems when switching between summer/winter time
same => n,ExecIf($[${EndDuration} < ${RingTime}]?Set(RingTime=${EndDuration})) ;Use the shortest
same => n,Queue(DoctorNoGood,,,,${RingTime})