Hi folks, below is a script i recently wrote to play a different message based on expected queue time. Am i effcient in what i write ? is there a better way ? I have been writing script for a while now but first time i have used such a check.
/*Check Opening Hours*/
IF (DATE = gv_if_service_bank_hol_dates) THEN
OPEN VOICE SESSION
PLAY PROMPT VOICE SEGMENT vs_bank_hol_closed
END VOICE SESSION
DISCONNECT
END IF
IF (DAY OF WEEK = gv_if_service_weekday) AND (TIME OF DAY <> gv_if_service_hrs_weekday) OR
(DAY OF WEEK = SATURDAY) AND (TIME OF DAY <> gv_if_service_hrs_sat) OR
(DAY OF WEEK = SUNDAY) AND (TIME OF DAY <> gv_if_service_hrs_sun) THEN
EXECUTE Route_Off_Site
END IF
IF NOT LOGGED OUT AGENT gv_emergency_agent THEN
OPEN VOICE SESSION
PLAY PROMPT VOICE SEGMENT vs_emergency_mge
END VOICE SESSION
DISCONNECT
END IF
IF NOT OUT OF SERVICE IF_CS_816 THEN
QUEUE TO SKILLSET IF_CS_816 WITH PRIORITY gv_call_priority
WAIT 2
END IF
ASSIGN EXPECTED WAIT TIME IF_CS_816 TO expect_wait_cv
IF expect_wait_cv > gv_queue_1_min AND expect_wait_cv < gv_queue_1_max THEN
OPEN VOICE SESSION
PLAY PROMPT VOICE SEGMENT vs_queue_1
END VOICE SESSION
ELSE
IF expect_wait_cv > gv_queue_2 THEN
OPEN VOICE SESSION
PLAY PROMPT VOICE SEGMENT vs_queue_2
END VOICE SESSION
END IF
END IF
SECTION loop
GIVE MUSIC 50
WAIT gv_delay_queue_3
OPEN VOICE SESSION
PLAY PROMPT VOICE SEGMENT vs_queue_3
END VOICE SESSION
IF NOT QUEUED THEN
IF NOT OUT OF SERVICE IF_CS_816 THEN
WAIT 2
END IF
END IF
IF NOT LOGGED OUT AGENT gv_emergency_agent THEN
OPEN VOICE SESSION
PLAY PROMPT VOICE SEGMENT vs_emergency_mge
END VOICE SESSION
DISCONNECT
END IF
EXECUTE loop
SECTION Route_Off_Site
ROUTE CALL 37212
/*Check Opening Hours*/
IF (DATE = gv_if_service_bank_hol_dates) THEN
OPEN VOICE SESSION
PLAY PROMPT VOICE SEGMENT vs_bank_hol_closed
END VOICE SESSION
DISCONNECT
END IF
IF (DAY OF WEEK = gv_if_service_weekday) AND (TIME OF DAY <> gv_if_service_hrs_weekday) OR
(DAY OF WEEK = SATURDAY) AND (TIME OF DAY <> gv_if_service_hrs_sat) OR
(DAY OF WEEK = SUNDAY) AND (TIME OF DAY <> gv_if_service_hrs_sun) THEN
EXECUTE Route_Off_Site
END IF
IF NOT LOGGED OUT AGENT gv_emergency_agent THEN
OPEN VOICE SESSION
PLAY PROMPT VOICE SEGMENT vs_emergency_mge
END VOICE SESSION
DISCONNECT
END IF
IF NOT OUT OF SERVICE IF_CS_816 THEN
QUEUE TO SKILLSET IF_CS_816 WITH PRIORITY gv_call_priority
WAIT 2
END IF
ASSIGN EXPECTED WAIT TIME IF_CS_816 TO expect_wait_cv
IF expect_wait_cv > gv_queue_1_min AND expect_wait_cv < gv_queue_1_max THEN
OPEN VOICE SESSION
PLAY PROMPT VOICE SEGMENT vs_queue_1
END VOICE SESSION
ELSE
IF expect_wait_cv > gv_queue_2 THEN
OPEN VOICE SESSION
PLAY PROMPT VOICE SEGMENT vs_queue_2
END VOICE SESSION
END IF
END IF
SECTION loop
GIVE MUSIC 50
WAIT gv_delay_queue_3
OPEN VOICE SESSION
PLAY PROMPT VOICE SEGMENT vs_queue_3
END VOICE SESSION
IF NOT QUEUED THEN
IF NOT OUT OF SERVICE IF_CS_816 THEN
WAIT 2
END IF
END IF
IF NOT LOGGED OUT AGENT gv_emergency_agent THEN
OPEN VOICE SESSION
PLAY PROMPT VOICE SEGMENT vs_emergency_mge
END VOICE SESSION
DISCONNECT
END IF
EXECUTE loop
SECTION Route_Off_Site
ROUTE CALL 37212