IF "Voicemail" detected THEN
Play recorded message xxx.wav
IF "Voicemail" NOT detected THEN
Play a different message yyy.wav which will be followed by Menus/Choices (which will be also a recorded message) to choose and record User Input.
Here is the code for review, only issue we think is it doesnot know when to terminate the call, even the Voicemail detected it plays the correct wav file but goes to menu option as well.
Code: Select all
<form id="mainmsg">
<var name="callee_type" expr="'@callee_type'" />
<record cond="callee_type=='answeringmachine'" finalsilence="2000ms"/>
<block>
<prompt cond="callee_type=='answeringmachine'">
<audio src="http://myservername.com/Scripts/sample2.wav">
This message is for Answering Machine.
</audio>
</prompt>
<prompt cond="callee_type!='answeringmachine'">
<audio src="http://myservername.com/Scripts/sample3.wav">
This message is for Regular Call.
</audio>
</prompt>
<goto next="#menuoptions" />
</block>
</form>
<menu id="menuoptions" dtmf="true">
<property name="inputmodes" value="dtmf"/>
<prompt bargein="true" timeout="5s">
<audio src="http://myservername.com/Scripts/menuoptionsforagnwithtransfer.wav">
<voice name="Mike">
To repeat this message, Press 1.
To transfer this call to our office, Press 2.
To put yourself on Do Not Call List, Press 9.
To disconnect this call simply hang up.
</voice>
</audio>
</prompt>
<nomatch count="1">
<prompt>
<audio src="http://myservername.com/Scripts/nomatchcount12.wav">
<voice name="Mike">
Your input was not valid. Please Try again.
</voice>
</audio>
</prompt>
<reprompt/>
</nomatch>
<nomatch count="2">
<prompt>
<audio src="http://myservername.com/Scripts/noinputcount3.wav">
<voice name="Mike">
Thank You, Good Bye!
</voice>
</audio>
</prompt>
<exit/>
</nomatch>
<noinput count="1">
<prompt>
<audio src="http://myservername.com/Scripts/noinputcount12.wav">
<voice name="Mike">
You did not enter anything. Please try again.
</voice>
</audio>
</prompt>
<reprompt/>
</noinput>
<noinput count="2">
<prompt>
<audio src="http://myservername.com/Scripts/noinputcount3.wav">
<voice name="Mike">
Thank You, Good Bye!
</voice>
</audio>
</prompt>
<exit/>
</noinput>
<choice dtmf="1" next="#repeat">Repeat</choice>
<choice dtmf="2" next="#transfer">Transfer</choice>
<choice dtmf="9" next="#optout">Opt Out</choice>
</menu>
<form id="repeat">
<block>
<prompt bargein="true">
<audio src="http://myservername.com/Scripts/timesheetreminder.wav">
<voice name="Mike">
This call is from xxx, to remind that your timesheet is due today, Please email us your approved timesheet at ts@xxx.com.
Failure to submit your timesheet may result in not being paid or loss of accured leave.
If you have any questions or need assistance regarding your timesheet, we can be reached during normal business hours at 1234567890
</voice>
</audio>
</prompt>
<goto next="#menuoptions" />
</block>
</form>
<form id="transfer">
<block>
<assign name="CALL_RESULT" expr="'2'" />
<data src="http://myservername.com/callresults.aspx" namelist="CALL_RESULT" method="post" />
</block>
<transfer dest="tel:+11234567890">
<prompt bargein="false">
<audio src="http://myservername.com/Scripts/reschedulewithtransfer.wav">
<voice name="Mike">
Please wait while we connect your call to our office.
</voice>
</audio>
</prompt>
</transfer>
</form>
<form id="optout">
<block>
<prompt bargein="true">
<audio src="http://myservername.com/Scripts/optout.wav">
<voice name="Mike">
Sorry for the inconvenience; We will take you out from our calling list, please give us 24 hours time for the same.
</voice>
</audio>
</prompt>
<assign name="CALL_RESULT" expr="'9'" />
<data src="http://myservername.com/callresults.aspx" namelist="CALL_RESULT" method="post" />
<goto next="#finish" />
</block>
</form>
<form id="finish">
<block>
<prompt bargein="true">
<audio src="http://myservername.com/Scripts/goodbye.wav">
<voice name="Mike">
Thank you. Goodbye!
</voice>
</audio>
</prompt>
</block>
</form>
</vxml>