当前位置: 首页>>代码示例>>PHP>>正文


PHP FreePBX::Recordings方法代码示例

本文整理汇总了PHP中FreePBX::Recordings方法的典型用法代码示例。如果您正苦于以下问题:PHP FreePBX::Recordings方法的具体用法?PHP FreePBX::Recordings怎么用?PHP FreePBX::Recordings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FreePBX的用法示例。


在下文中一共展示了FreePBX::Recordings方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: die

<?php

if (!defined('FREEPBX_IS_AUTH')) {
    die('No direct script access allowed');
}
echo FreePBX::Recordings()->showPage();
开发者ID:ringfreejohn,项目名称:pbxframework,代码行数:6,代码来源:page.recordings.php

示例2: ivr_configprocess

function ivr_configprocess()
{
    if (isset($_REQUEST['display']) && $_REQUEST['display'] == 'ivr') {
        global $db;
        //get variables
        $get_var = array('id', 'name', 'alertinfo', 'description', 'announcement', 'directdial', 'invalid_loops', 'invalid_retry_recording', 'invalid_destination', 'invalid_recording', 'retvm', 'timeout_time', 'timeout_recording', 'timeout_retry_recording', 'timeout_destination', 'timeout_loops', 'timeout_append_announce', 'invalid_append_announce', 'timeout_ivr_ret', 'invalid_ivr_ret');
        foreach ($get_var as $var) {
            $vars[$var] = isset($_REQUEST[$var]) ? $_REQUEST[$var] : '';
        }
        $vars['timeout_append_announce'] = empty($vars['timeout_append_announce']) ? '0' : '1';
        $vars['invalid_append_announce'] = empty($vars['invalid_append_announce']) ? '0' : '1';
        $vars['timeout_ivr_ret'] = empty($vars['timeout_ivr_ret']) ? '0' : '1';
        $vars['invalid_ivr_ret'] = empty($vars['invalid_ivr_ret']) ? '0' : '1';
        $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : '';
        $entries = isset($_REQUEST['entries']) ? $_REQUEST['entries'] : '';
        switch ($action) {
            case 'save':
                if (isset($_REQUEST['announcementrecording'])) {
                    $filepath = FreePBX::Config()->get("ASTSPOOLDIR") . "/tmp/" . $_REQUEST['announcementrecording'];
                    $soundspath = FreePBX::Config()->get("ASTVARLIBDIR") . "/sounds";
                    $codec = "wav";
                    if (file_exists($filepath)) {
                        FreePBX::Media()->load($filepath);
                        $filename = "ivr-" . $vars['name'] . "-recording-" . time();
                        FreePBX::Media()->convert($soundspath . "/en/custom/" . $filename . "." . $codec);
                        $id = FreePBX::Recordings()->addRecording("ivr-" . $vars['name'] . "-recording-" . time(), sprintf(_("Recording created for IVR named '%s'"), $vars['name']), "custom/" . $filename);
                        $vars['announcement'] = $id;
                    } else {
                        $vars['announcement'] = '';
                    }
                }
                //get real dest
                $vars['id'] = ivr_save_details($vars);
                ivr_save_entries($vars['id'], $entries);
                needreload();
                $this_dest = ivr_getdest($vars['id']);
                fwmsg::set_dest($this_dest[0]);
                break;
            case 'delete':
                ivr_delete($vars['id']);
                isset($_REQUEST['id']) ? $_REQUEST['id'] = null : '';
                isset($_REQUEST['action']) ? $_REQUEST['action'] = null : '';
                needreload();
                break;
        }
    }
}
开发者ID:ringfreejohn,项目名称:pbxframework,代码行数:47,代码来源:functions.inc.php

示例3: foreach

    foreach ($files as $file) {
        //move all custom files to the default language first
        if (preg_match("/^custom\\/(.*)/", $file, $matches)) {
            foreach (glob($dir . "/custom/" . $matches[1] . ".*") as $f) {
                $ff = basename($f);
                rename($f, $dir . "/" . $default . "/custom/" . $ff);
            }
            $filenames[] = $file;
            //if any files are using languages then remove the language since Asterisk does this for us
        } elseif (preg_match("/^(?:\\w{2}\\_\\w{2}|\\w{2}\\/)/", $file)) {
            $filenames[] = preg_replace("/^(?:\\w{2}\\_\\w{2}|\\w{2}\\/)/", "", $file);
            //Else just use the file as is
        } else {
            $filenames[] = $file;
        }
    }
    $sql = "UPDATE recordings SET filename = ? WHERE id = ?";
    $sth = FreePBX::Database()->prepare($sql);
    $sth->execute(array(implode('&', $filenames), $recording['id']));
}
if (file_exists($dir . "/custom")) {
    $files = glob($dir . "/custom/*");
    foreach ($files as $file) {
        $parts = pathinfo($file);
        FreePBX::Recordings()->addRecording($parts['filename'], "Migrated file", $file);
    }
    $files = glob($dir . "/custom/*");
    if (empty($files)) {
        rmdir($dir . "/custom");
    }
}
开发者ID:ringfreejohn,项目名称:pbxframework,代码行数:31,代码来源:install.php

示例4: recordings_get

function recordings_get($id)
{
    return FreePBX::Recordings()->getRecordingsById($id);
}
开发者ID:ringfreejohn,项目名称:pbxframework,代码行数:4,代码来源:functions.inc.php


注:本文中的FreePBX::Recordings方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。