public function doConfigPageInit($page)
 {
     $request = $_REQUEST;
     if ($page == "callrecording") {
         $type = isset($request['type']) ? $request['type'] : 'setup';
         $view = isset($request['view']) ? $request['view'] : 'form';
         $action = isset($request['action']) ? $request['action'] : '';
         if (isset($request['delete'])) {
             $action = 'delete';
         }
         $callrecording_id = isset($request['callrecording_id']) ? $request['callrecording_id'] : false;
         $description = isset($request['description']) ? $request['description'] : '';
         $callrecording_mode = isset($request['callrecording_mode']) ? $request['callrecording_mode'] : '';
         $dest = isset($request['dest']) ? $request['dest'] : '';
         if (isset($request['goto0']) && $request['goto0']) {
             $dest = $request[$request['goto0'] . '0'];
         }
         switch ($action) {
             case 'add':
                 $request['extdisplay'] = callrecording_add($description, $callrecording_mode, $dest);
                 needreload();
                 //redirect_standard('extdisplay', 'view');
                 break;
             case 'edit':
                 callrecording_edit($callrecording_id, $description, $callrecording_mode, $dest);
                 needreload();
                 //redirect_standard('extdisplay', 'view');
                 break;
             case 'delete':
                 callrecording_delete($callrecording_id);
                 needreload();
                 //redirect_standard();
                 break;
         }
     }
     if ($page == "routing") {
         $viewing_itemid = isset($request['id']) ? $request['id'] : '';
         $action = isset($request['action']) ? $request['action'] : null;
         $route_id = $viewing_itemid;
         //dbug("got request for callrecording process for route: $route_id action: $action");
         if (isset($request['Submit'])) {
             $action = isset($action) ? $action : 'editroute';
         }
         // $action won't be set on the redirect but callrecordingAddRoute will be in the session
         //
         if (!$action && !empty($_SESSION['callrecordingAddRoute'])) {
             callrecording_adjustroute($route_id, 'delayed_insert_route', $_SESSION['callrecordingAddRoute']);
             unset($_SESSION['callrecordingAddRoute']);
         } elseif ($action) {
             callrecording_adjustroute($route_id, $action, $request['callrecording']);
         }
     }
 }
}
$callrecording_id = isset($_REQUEST['callrecording_id']) ? $_REQUEST['callrecording_id'] : false;
$description = isset($_REQUEST['description']) ? $_REQUEST['description'] : '';
$callrecording_mode = isset($_REQUEST['callrecording_mode']) ? $_REQUEST['callrecording_mode'] : '';
$dest = isset($_REQUEST['dest']) ? $_REQUEST['dest'] : '';
if (isset($_REQUEST['goto0']) && $_REQUEST['goto0']) {
    $dest = $_REQUEST[$_REQUEST['goto0'] . '0'];
}
switch ($action) {
    case 'add':
        $_REQUEST['extdisplay'] = callrecording_add($description, $callrecording_mode, $dest);
        needreload();
        redirect_standard('extdisplay');
        break;
    case 'edit':
        callrecording_edit($callrecording_id, $description, $callrecording_mode, $dest);
        needreload();
        redirect_standard('extdisplay');
        break;
    case 'delete':
        callrecording_delete($callrecording_id);
        needreload();
        redirect_standard();
        break;
}
?>

<div class="rnav"><ul>
<?php 
echo '<li><a href="config.php?display=callrecording&amp;type=' . $type . '">' . _('Add Call Recording') . '</a></li>';
foreach (callrecording_list() as $row) {