<play>

Role: <play> This verb plays the audio file back to the call.

Use: Announcement: Playing an announcement.

  • Play can be used by itself or it can be nested in gather keyword.

  • Here is an example of an announcement that can be played to prompt the user to press keys:-

    • Press 1 for Support

    • Press 2 for Sales

    • Press 3 if your know your parties extension

Attributes

Simple play example.

<?xml version="1.0" encoding="UTF-8"?> 
<Response>    
         <play>http://www.example.com/welcomemessage.mp3.</play>
 </Response>

Here is an example of how <play> can be nested with <gather> within code.

<?xml version="1.0" encoding="UTF-8"?> 
<Response>
     <Gather timeout="10" finishOnKey="*" action=”handle-key.xml>
         <play>http://www.example.com/welcomemessage.mp3.</play>
     </Gather>
 </Response>

Once the user enters the response. It will call http://yourserver/handle-key.php

<?php
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"; 
echo "<Response><Say>You entered ".$_REQUEST['Digits']. "</Say></Response>"; ?>

Last updated