Here goes...
Obviously, you'll need to put the usual checks etc in as well...
The skillset is ServiceDesk
cv_ewt is a call variable of type SECONDS (default value 0)
cv_ewt_old is a call variable of type SECONDS (default value 1)
cv_ewt_minutes is a call variable of type INTEGER (I think)
cv_ewt_seconds is a call variable of type INTEGER (I think)
.
.
.
.
IF NOT OUT OF SERVICE ServiceDesk THEN
QUEUE TO SKILLSET ServiceDesk
WAIT 2
ELSE
EXECUTE closed_section
END IF
WAIT 8
SECTION loop_section
/* First time through, cv_ewt < cv_ewt_old, so if calls are queueing, then it will execute the special_message_section.
This check is primarily here to make sure that the EWT message isn't played to customers if EWT has increased since the last loop! */
IF QUEUED CALL COUNT ServiceDesk > 0 AND
cv_ewt < cv_ewt_old THEN
EXECUTE special_message_section
END IF
WAIT 20
OPEN VOICE SESSION
PLAY PROMPT
VOICE SEGMENT vs_hdeskmsg2
END VOICE SESSION
GIVE MUSIC 50
/* command so that callers who have heard the normal
loop messages do not hear the EWT messages */
EXECUTE loop_section_checks
SECTION special_message_section
ASSIGN EXPECTED WAIT TIME ServiceDesk TO cv_ewt
/* Copy EWT call variable to a new variable. This is used
above to compare current and previous values of EWT */
ASSIGN cv_ewt TO cv_ewt_old
/* Calculate the number of whole minutes in the EWT.
Copy this value to a new call variable: cv_ewt_minutes */
ASSIGN (cv_ewt/60) TO cv_ewt_minutes
/* Calculate the number of remaining seconds in the EWT.
Copy this value to a new call variable: cv_ewt_seconds */
ASSIGN (cv_ewt-(cv_ewt_minutes*60)) TO cv_ewt_seconds
/* Play the message, stringing together several voice segments */
OPEN VOICE SESSION
PLAY PROMPT
VOICE SEGMENT vs_ewt_is
NUMBER cv_ewt_minutes
VOICE SEGMENT vs_minutes_and
NUMBER cv_ewt_seconds
VOICE SEGMENT vs_seconds
END VOICE SESSION
GIVE MUSIC 50
/* All calls reach this point for basic loop checks */
SECTION loop_section_checks
IF AGE OF CALL > 3600 THEN
DISCONNECT
END IF
/* Script checks that an emergency hasn't been invoked since the caller entered the 'loop' section */
IF NOT LOGGED OUT AGENT 911911 THEN
EXECUTE emergency_section
END IF
/* Script checks that agents haven't logged out of ServiceDesk skillset since the caller entered the 'loop' section. If they have, the call is requeued */
IF NOT QUEUED THEN
IF NOT OUT OF SERVICE ServiceDesk THEN
QUEUE TO SKILLSET ServiceDesk
WAIT 2
ELSE
EXECUTE closed_section
END IF
END IF
/* reset value for cv_ewt so that it can be compared with the old value to see if message should be played i.e. only play if EWT is decreasing! */
ASSIGN EXPECTED WAIT TIME ServiceDesk TO cv_ewt
EXECUTE loop_section
SECTION closed_section
etc. etc
SECTION emergency_section
etc. etc