Go to survey after call or voicemail

Hello,

I’d like to create a survey after call or route callers to a voicemail if there’s no agents availaible.
Here’s scenario:

  • Incoming call and close planning => Go to voicemail (OK)
  • Incoming call and open planning :
    • If the agent processes the call, after call, the caller type a satisfaction note et the note is inserted into database
    • If there’s no agents availaible and if caller wait 5 minutes, the caller go to voicemail

The survey.php script works.
But I don’t know how to redirect caller to voicemail or survey according to the scenario.

Here’s the dialplan :

exten => 7000,1,Answer()
same => n,Set(MONITOR_FILENAME=${UNIQUEID}-7-${CALLERID(num)}-${STRFTIME(${EPOCH},%d%m%Y-%H%M%S)}-IN)
same => n,GotoIfTime(,,1,jan?closed)
same => n,GotoIfTime(,,1,may?closed)
same => n,GotoIfTime(,,8,may?closed)
same => n,GotoIfTime(,,14,jul?closed)
same => n,GotoIfTime(,,15,aug?closed)
same => n,GotoIfTime(,,11,nov?closed)
same => n,GotoIfTime(,,25,dec?closed)
same => n,GotoIfTime(08:00-19:00,mon-fri,,?open)
same => n(closed),Set(CDR(userfield)=Q130|HORS-PLANNING)
same => n(closed),Wait(1)
same => n(closed),VoiceMail(7000@internal)
same => n(closed),Hangup()
same => n(open),Wait(1)
same => n(open),Playback(support-accueil)
same => n(open),Queue(Q130,c,300)
same => n(open),Read(score,accueil,1,s,3,5)
same => n(open),AGI(survey.php,“survey”,“${CALLERID(num)}”,“Q130”,“${score}”,“${UNIQUEID}”)
same => n(open),VoiceMail(7000@internal)
same => n(open),Hangup()

Thanks a lot.
J

For the voicemail, use leavewhenempty and or joinwhenempty.

For the survey, use “c”.

Use ${QUEUESTATUS} to determine which case applies.