session.callrecording

Shadow variable that stores your call recording when using the recordcall property.


Example

recordcallexample.php
<?php
echo "<?xml version=\"1.0\" encoding=\"latin-1\"?>";
?>
<vxml version="2.0">
  <property name="recordcall" value="true"/>
  <form id="recordform">
    <transfer dest="1234567890">
      <prompt>
        Please hold while you are transferred.
      </prompt>
    </transfer>
    <block>
      <submit next="savecallrecording.php" namelist="callrecording" method="post"/>
    </block>
    <catch event="connection.disconnect.hangup">
      <submit next="savecallrecording.php" namelist="callrecording" method="post"/>
    </catch>
  </form>
</vxml>
savecallrecording.php
<?php
echo "<?xml version=\"1.0\" encoding=\"latin-1\"?>";
?>
<vxml version="2.0">
    <form id="greeting">
        <block>
<?php
  if (isset($_FILES['callrecording']) && is_uploaded_file($_FILES['callrecording']['tmp_name'])) {
    move_uploaded_file($_FILES['callrecording']['tmp_name'],"temp.ul");
    $timestamp = time();
    $cmdline = `/usr/local/bin/sox -t ul -r 8000 temp.ul $timestamp.wav`;
    unlink("temp.ul");
    echo "<exit/>\n";
  } else {
    echo "<exit/>\n";
  }
?>
        </block>
    </form>
</vxml>

Explanation

From this example, the callee is transferred to 1234567890 and the callee and the party that gets transferred to have a conversation. From here, depending on which end decides to hang up first, the application submits the shadow variable, session.callrecording, through "callrecording" and the recording of the call gets stored.


Notes

None