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

How can I make logging <property> configurable?

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
vikas
Posts: 53
Joined: Wed May 13, 2015 7:46 pm

How can I make logging <property> configurable?

Post by vikas »

How can I make logging configurable?

In production we need the value for logging to be "private" but when debugging in production we would like to change the value to "enable" without editing code.

Is there a way to make this property configurable so that I can change it at runtime without editing coding?

<property name="logging" value="private"/>

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

Re: How can I make logging <property> configurable?

Post by support »

Hi Vikas,

We have not been able to think of a way to implement the requested behavior within only VXML. If you used a dynamic language like PHP, it would be possible. Here's an example that whenever the DNIS of the application is 800-555-1234 then the application logging would be set to "enable". Any other DNIS would set the logging to "private".

root.php:

Code: Select all

<?php
header("Content-type: text/xml");
session_start();
echo("<?xml version=\"1.0\"?>\n");
?>
<vxml version="2.1">
  <property name="logging" value="<?= $_SESSION['DEBUG'] ? 'enable' : 'private' ?>"/>
  ...
  <var name="development_dnis" expr="'8005551234'"/>
  ...
</vxml>
start.php:

Code: Select all

<?php
header("Content-type: text/xml");
session_start();
$_SESSION['DEBUG'] = false; // assume production until proven otherwise
echo("<?xml version=\"1.0\"?>\n");
?>
<vxml application="root.php" version="2.1">
  <var name="dnis" expr="session.telephone.dnis"/>
  <form>
    <block>
      <submit next="main_menu.php" namelist="dnis development_dnis" method="get"/>
    </block>
  </form>
</vxml>
main_menu.php:

Code: Select all

<?php
header("Content-type: text/xml");
session_start();
$_SESSION['DEBUG'] = ($_GET['dnis'] == $_GET['development_dnis']) ? true : false; // set debug to true if dnis matches development_dnis
echo("<?xml version=\"1.0\"?>\n");
?>
<vxml application="root.php" version="2.1">
  <!-- logging is set to private if in production at this point, otherwise it is enable -->
  ...
</vxml>
Regards,
Plum Support

Post Reply