We've Moved! Please visit our new and improved forum over at our new portal: https://portal.plumvoice.com/hc/en-us/community/topics

Rule for playing announcements

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
Polad
Posts: 21
Joined: Wed Dec 15, 2010 3:50 am

Rule for playing announcements

Post by Polad »

Dear support team,

I'm implementing IVR application where customer can call and listen info about debt. I have integration with PHP and according to return value I receive digits (for example: "125"). These digits are the debt. I also have announcement files in following format: "one hundred", "two hundreds", etc - "ten", "twenty", etc - "one", "two", etc. So, my question is: Is it possible to implement some rules which allow to play correct announcement regarding received value? I mean if IVR receive "164" we need to choose and play: "one hundred" "sixty" "four" (3 announcements) consequentially.

Thanks beforehand.

support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

Re: Rule for playing announcements

Post by support »

Yes, it's possible. You'll have to implement rules to generate a proper list of audio files to play. Once you have this list, you can loop through to play each audio file like so:

Code: Select all

<?php
header('Content-type: text/xml');
echo "<?xml version=\"1.0\"?>\n";

$debt_prompts = array("one hundred" => "one-hundred.wav", 
		      "sixty" => "sixty.wav", 
		      "four" => "four.wav");
?>

<vxml version="2.0">
  <form>
    <block>
      <prompt>
	Your debt is 
<?php
  foreach ($debt_prompts as $prompt => $audio_file) {
    echo "<audio src=\"$audio_file\">$prompt</audio>\n";
  }
?>
      </prompt>
    </block>
  </form>
</vxml>

Post Reply