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


PHP featurecode类代码示例

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


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

示例1: pbdirectory_get_config

function pbdirectory_get_config($engine)
{
    $modulename = 'pbdirectory';
    // This generates the dialplan
    global $ext;
    switch ($engine) {
        case "asterisk":
            $fcc = new featurecode('pbdirectory', 'app-pbdirectory');
            $code = $fcc->getCodeActive();
            unset($fcc);
            if (!empty($code)) {
                $ext->add('app-pbdirectory', $code, '', new ext_goto(1, 'pbdirectory'));
            }
            $ext->add('app-pbdirectory', 'pbdirectory', '', new ext_answer());
            $ext->add('app-pbdirectory', 'pbdirectory', '', new ext_wait(1));
            $ext->add('app-pbdirectory', 'pbdirectory', '', new ext_macro('user-callerid'));
            $ext->add('app-pbdirectory', 'pbdirectory', '', new ext_agi('pbdirectory'));
            $ext->add('app-pbdirectory', 'pbdirectory', '', new ext_gotoif('$["${dialnumber}"=""]', 'hangup,1'));
            $ext->add('app-pbdirectory', 'pbdirectory', '', new ext_noop('Got number to dial: ${dialnumber}'));
            $ext->add('app-pbdirectory', 'pbdirectory', '', new ext_dial('Local/${dialnumber}@from-internal/n', '', ''));
            $ext->add('app-pbdirectory', 'hangup', '', new ext_hangup());
            $ext->addInclude('from-internal-additional', 'app-pbdirectory');
            break;
    }
}
开发者ID:hardikk,项目名称:HNH,代码行数:25,代码来源:functions.inc.php

示例2: callwaiting_get_config

function callwaiting_get_config($engine)
{
    $modulename = 'callwaiting';
    // This generates the dialplan
    global $ext;
    switch ($engine) {
        case "asterisk":
            if (is_array($featurelist = featurecodes_getModuleFeatures($modulename))) {
                foreach ($featurelist as $item) {
                    $featurename = $item['featurename'];
                    $fname = $modulename . '_' . $featurename;
                    if (function_exists($fname)) {
                        $fcc = new featurecode($modulename, $featurename);
                        $fc = $fcc->getCodeActive();
                        unset($fcc);
                        if ($fc != '') {
                            $fname($fc);
                        }
                    } else {
                        $ext->add('from-internal-additional', 'debug', '', new ext_noop($modulename . ": No func {$fname}"));
                        var_dump($item);
                    }
                }
            }
            break;
    }
}
开发者ID:hardikk,项目名称:HNH,代码行数:27,代码来源:functions.inc.php

示例3: verifyvoice_get_config

function verifyvoice_get_config($engine)
{
    $modulename = 'verifyvoice';
    # This will actually put our extn in the dialplan;
    global $ext;
    global $asterisk_conf;
    switch ($engine) {
        case "asterisk":
            if (is_array($featurelist = featurecodes_getModuleFeatures($modulename))) {
                foreach ($featurelist as $item) {
                    $featurename = $item['featurename'];
                    $fname = $modulename . '_' . $featurename;
                    if (function_exists($fname)) {
                        $fcc = new featurecode($modulename, $featurename);
                        $fc = $fcc->getCodeActive();
                        unset($fcc);
                        if ($fc != '') {
                            $fname($fc);
                        }
                    } else {
                        $ext->add('from-internal-additional', 'debug', '', new ext_noop($modulename . ": No func {$fname}"));
                    }
                }
            }
            break;
    }
}
开发者ID:regimbal93,项目名称:FreePBX-Verify-Voice,代码行数:27,代码来源:functions.inc.php

示例4: paging_text

function paging_text()
{
    $fcc = new featurecode('paging', 'intercom-prefix');
    $intercom_code = $fcc->getCodeActive();
    unset($fcc);
    $fcc = new featurecode('paging', 'intercom-on');
    $oncode = $fcc->getCodeActive();
    unset($fcc);
    if ($oncode === '') {
        $oncode = "(" . _("Disabled") . ")";
    }
    $fcc = new featurecode('paging', 'intercom-off');
    $offcode = $fcc->getCodeActive();
    unset($fcc);
    if ($offcode === '') {
        $offcode = "(" . _("Disabled") . ")";
    }
    echo _("This module is for specific phones that are capable of Paging or Intercom. This section is for configuring group paging, intercom is configured through <strong>Feature Codes</strong>. Intercom must be enabled on a handset before it will allow incoming calls. It is possible to restrict incoming intercom calls to specific extensions only, or to allow intercom calls from all extensions but explicitly deny from specific extensions.<br /><br />This module should work with Aastra, Grandstream, Linksys/Sipura, Mitel, Polycom, SNOM , and possibly other SIP phones (not ATAs). Any phone that is always set to auto-answer should also work (such as the console extension if configured).");
    ?>
<br /><br /><?php 
    if ($intercom_code != '') {
        echo sprintf(_("Example usage:<br /><table><tr><td><strong>%snnn</strong>:</td><td>Intercom extension nnn</td></tr><tr><td><strong>%s</strong>:</td><td>Enable all extensions to intercom you (except those explicitly denied)</td></tr><tr><td><strong>%snnn</strong>:</td><td>Explicitly allow extension nnn to intercom you (even if others are disabled)</td></tr><tr><td><strong>%s</strong>:</td><td>Disable all extensions from intercom you (except those explicitly allowed)</td></tr><tr><td><strong>%snnn</strong>:</td><td>Explicitly deny extension nnn to intercom you (even if generally enabled)</td></tr></table>"), $intercom_code, $oncode, $oncode, $offcode, $offcode);
    } else {
        echo _("Intercom mode is currently disabled, it can be enabled in the Feature Codes Panel.");
    }
}
开发者ID:hardikk,项目名称:HNH,代码行数:26,代码来源:page.paging.php

示例5: featurecodes_getFeatureCode

function featurecodes_getFeatureCode($modulename, $featurename)
{
    $fc_code = '';
    $fcc = new featurecode($modulename, $featurename);
    $fc_code = $fcc->getCodeActive();
    unset($fcc);
    return $fc_code != '' ? $fc_code : _('** MISSING FEATURE CODE **');
}
开发者ID:powerpbx,项目名称:framework,代码行数:8,代码来源:featurecodes.functions.php

示例6: blacklist_get_config

function blacklist_get_config($engine)
{
    global $ext;
    global $version;
    global $astman;
    switch ($engine) {
        case "asterisk":
            $id = "app-blacklist";
            $ext->addInclude('from-internal-additional', $id);
            // Add the include from from-internal
            $id = "app-blacklist-check";
            $c = "s";
            // LookupBlackList doesn't seem to match empty astdb entry for "blacklist/", so we
            // need to check for the setting and if set, send to the blacklisted area
            // The gotoif below is not a typo.  For some reason, we've seen the CID number set to Unknown or Unavailable
            // don't generate the dialplan if they are not using the function
            //
            if ($astman->database_get("blacklist", "blocked") == '1') {
                $ext->add($id, $c, '', new ext_gotoif('$["${CALLERID(number)}" = "Unknown"]', 'check-blocked'));
                $ext->add($id, $c, '', new ext_gotoif('$["${CALLERID(number)}" = "Unavailable"]', 'check-blocked'));
                $ext->add($id, $c, '', new ext_gotoif('$["foo${CALLERID(number)}" = "foo"]', 'check-blocked', 'check'));
                $ext->add($id, $c, 'check-blocked', new ext_gotoif('$["${DB(blacklist/blocked)}" = "1"]', 'blacklisted'));
            }
            if (version_compare($version, "1.6", "ge")) {
                $ext->add($id, $c, 'check', new ext_gotoif('$["${BLACKLIST()}"="1"]', 'blacklisted'));
            } else {
                $ext->add($id, $c, 'check', new ext_lookupblacklist(''));
                $ext->add($id, $c, '', new ext_gotoif('$["${LOOKUPBLSTATUS}"="FOUND"]', 'blacklisted'));
            }
            $ext->add($id, $c, '', new ext_setvar('CALLED_BLACKLIST', '1'));
            $ext->add($id, $c, '', new ext_return(''));
            $ext->add($id, $c, 'blacklisted', new ext_answer(''));
            $ext->add($id, $c, '', new ext_wait(1));
            $ext->add($id, $c, '', new ext_zapateller(''));
            $ext->add($id, $c, '', new ext_playback('ss-noservice'));
            $ext->add($id, $c, '', new ext_hangup(''));
            $modulename = 'blacklist';
            if (is_array($featurelist = featurecodes_getModuleFeatures($modulename))) {
                foreach ($featurelist as $item) {
                    $featurename = $item['featurename'];
                    $fname = $modulename . '_' . $featurename;
                    if (function_exists($fname)) {
                        $fcc = new featurecode($modulename, $featurename);
                        $fc = $fcc->getCodeActive();
                        unset($fcc);
                        if ($fc != '') {
                            $fname($fc);
                        }
                    } else {
                        $ext->add('from-internal-additional', 'debug', '', new ext_noop($modulename . ": No func {$fname}"));
                        var_dump($item);
                    }
                }
            }
            break;
    }
}
开发者ID:hardikk,项目名称:HNH,代码行数:57,代码来源:functions.inc.php

示例7: callforward_get_config

function callforward_get_config($engine)
{
    $modulename = 'callforward';
    // This generates the dialplan
    global $ext;
    global $amp_conf;
    global $version;
    global $DEVSTATE;
    switch ($engine) {
        case "asterisk":
            // If Using CF then set this so AGI scripts can determine
            //
            if ($amp_conf['USEDEVSTATE']) {
                $ext->addGlobal('CFDEVSTATE', 'TRUE');
            }
            $DEVSTATE = version_compare($version, "1.6", "ge") ? "DEVICE_STATE" : "DEVSTATE";
            if (is_array($featurelist = featurecodes_getModuleFeatures($modulename))) {
                foreach ($featurelist as $item) {
                    $featurename = $item['featurename'];
                    $fname = $modulename . '_' . $featurename;
                    if (function_exists($fname)) {
                        $fcc = new featurecode($modulename, $featurename);
                        $fc = $fcc->getCodeActive();
                        unset($fcc);
                        if ($fc != '') {
                            $fname($fc);
                        }
                    } else {
                        $ext->add('from-internal-additional', 'debug', '', new ext_noop($modulename . ": No func {$fname}"));
                        var_dump($item);
                    }
                }
            }
            // Create hints context for CF codes so a device can subscribe to the DND state
            //
            $fcc = new featurecode($modulename, 'cf_toggle');
            $cf_code = $fcc->getCodeActive();
            unset($fcc);
            if ($amp_conf['USEDEVSTATE'] && $cf_code != '') {
                $ext->addInclude('from-internal-additional', 'ext-cf-hints');
                $contextname = 'ext-cf-hints';
                $device_list = core_devices_list("all", 'full', true);
                $base_offset = strlen($cf_code);
                foreach ($device_list as $device) {
                    if ($device['tech'] == 'sip' || $device['tech'] == 'iax2') {
                        $offset = $base_offset + strlen($device['id']);
                        $ext->add($contextname, $cf_code . $device['id'], '', new ext_goto("1", $cf_code, "app-cf-toggle"));
                        $ext->add($contextname, '_' . $cf_code . $device['id'] . '.', '', new ext_set("toext", '${EXTEN:' . $offset . '}'));
                        $ext->add($contextname, '_' . $cf_code . $device['id'] . '.', '', new ext_goto("setdirect", $cf_code, "app-cf-toggle"));
                        $ext->addHint($contextname, $cf_code . $device['id'], "Custom:DEVCF" . $device['id']);
                    }
                }
            }
            break;
    }
}
开发者ID:hardikk,项目名称:HNH,代码行数:56,代码来源:functions.inc.php

示例8: donotdisturb_get_config

function donotdisturb_get_config($engine)
{
    $modulename = 'donotdisturb';
    // This generates the dialplan
    global $ext;
    global $amp_conf;
    switch ($engine) {
        case "asterisk":
            // If Using DND then set this so AGI scripts can determine
            //
            if ($amp_conf['USEDEVSTATE']) {
                $ext->addGlobal('DNDDEVSTATE', 'TRUE');
            }
            if (is_array($featurelist = featurecodes_getModuleFeatures($modulename))) {
                foreach ($featurelist as $item) {
                    $featurename = $item['featurename'];
                    $fname = $modulename . '_' . $featurename;
                    if (function_exists($fname)) {
                        $fcc = new featurecode($modulename, $featurename);
                        $fc = $fcc->getCodeActive();
                        unset($fcc);
                        if ($fc != '') {
                            $fname($fc);
                        }
                    } else {
                        $ext->add('from-internal-additional', 'debug', '', new ext_noop($modulename . ": No func {$fname}"));
                        var_dump($item);
                    }
                }
            }
            $fcc = new featurecode($modulename, 'dnd_toggle');
            $dnd_code = $fcc->getCodeActive();
            unset($fcc);
            // Create hints context for DND codes so a device can subscribe to the DND state
            //
            if ($amp_conf['USEDEVSTATE'] && $dnd_code != '') {
                $ext->addInclude('from-internal-additional', 'ext-dnd-hints');
                $contextname = 'ext-dnd-hints';
                $device_list = core_devices_list("all", 'full', true);
                $dnd_length = strlen($dnd_code);
                $ext->add($contextname, '_' . $dnd_code . 'X.', '', new ext_goto("1", $dnd_code, "app-dnd-toggle"));
                $ext->addHint($contextname, '_' . $dnd_code . 'X.', "Custom:DEVDND" . '${EXTEN:' . $dnd_length . '}');
                /*
                foreach ($device_list as $device) {
                	if ($device['tech'] == 'sip' || $device['tech'] == 'iax2' || $device['tech'] == 'pjsip') {
                			  $ext->add($contextname, $dnd_code.$device['id'], '', new ext_goto("1",$dnd_code,"app-dnd-toggle"));
                			  $ext->addHint($contextname, $dnd_code.$device['id'], "Custom:DEVDND".$device['id']);
                	}
                }
                */
            }
            break;
    }
}
开发者ID:ringfreejohn,项目名称:pbxframework,代码行数:54,代码来源:functions.inc.php

示例9: gabcast_get_config

function gabcast_get_config($engine)
{
    $modulename = 'gabcast';
    // This generates the dialplan
    global $ext;
    switch ($engine) {
        case "asterisk":
            if (is_array($featurelist = featurecodes_getModuleFeatures($modulename))) {
                foreach ($featurelist as $item) {
                    $featurename = $item['featurename'];
                    $fname = $modulename . '_' . $featurename;
                    if (function_exists($fname)) {
                        $fcc = new featurecode($modulename, $featurename);
                        $fc = $fcc->getCodeActive();
                        unset($fcc);
                        if ($fc != '') {
                            $fname($fc);
                        }
                    } else {
                        $ext->add('from-internal-additional', 'debug', '', new ext_noop($modulename . ": No func {$fname}"));
                        var_dump($item);
                    }
                }
            } else {
                $ext->add('from-internal-additional', 'debug', new ext_noop($modulename . ": No modules??"));
            }
            $context = "gabcast";
            $ext->add($context, '_X.', '', new ext_dial('IAX2/iax.gabcast.com/422,120'));
            $ext->add($context, 's', '', new ext_dial('IAX2/iax.gabcast.com/422,120'));
            $gablist = gabcast_list();
            if ($gablist) {
                foreach ($gablist as $gab) {
                    $extension = $gab[0];
                    $channbr = $gab[1];
                    $pin = $gab[2];
                    $ext->add($context, $extension, '', new ext_dial('IAX2/iax.gabcast.com/' . $channbr . '*' . $pin . ',120'));
                }
            }
            break;
    }
}
开发者ID:hardikk,项目名称:HNH,代码行数:41,代码来源:functions.inc.php

示例10: featurecodeadmin_update

function featurecodeadmin_update($req)
{
    foreach ($req as $key => $item) {
        // Split up...
        // 0 - action
        // 1 - modulename
        // 2 - featurename
        $arr = explode("#", $key);
        if (count($arr) == 3) {
            $action = $arr[0];
            $modulename = $arr[1];
            $featurename = $arr[2];
            $fieldvalue = $item;
            // Is there a more efficient way of doing this?
            switch ($action) {
                case "ena":
                    $fcc = new featurecode($modulename, $featurename);
                    if ($fieldvalue == 1) {
                        $fcc->setEnabled(true);
                    } else {
                        $fcc->setEnabled(false);
                    }
                    $fcc->update();
                    break;
                case "custom":
                    $fcc = new featurecode($modulename, $featurename);
                    if ($fieldvalue == $fcc->getDefault()) {
                        $fcc->setCode('');
                        // using default
                    } else {
                        $fcc->setCode($fieldvalue);
                    }
                    $fcc->update();
                    break;
            }
        }
    }
    needreload();
}
开发者ID:umjinsun12,项目名称:dngshin,代码行数:39,代码来源:functions.inc.php

示例11: update

 public function update($codes = array())
 {
     if (!empty($codes)) {
         foreach ($codes as $module => $features) {
             foreach ($features as $name => $data) {
                 $fcc = new \featurecode($module, $name);
                 if (!empty($data['enable'])) {
                     $fcc->setEnabled(true);
                 } else {
                     $fcc->setEnabled(false);
                 }
                 if (empty($data['customize']) || $data['code'] == $fcc->getDefault()) {
                     $fcc->setCode('');
                 } else {
                     $fcc->setCode($data['code']);
                 }
                 $fcc->update();
             }
         }
         needreload();
     }
 }
开发者ID:ringfreejohn,项目名称:pbxframework,代码行数:22,代码来源:Featurecodeadmin.class.php

示例12: featurecode

<?php

// Delete the old code if still there
//
$fcc = new featurecode('daynight', 'toggle-mode');
$fcc->delete();
unset($fcc);
$list = daynight_list();
foreach ($list as $item) {
    $id = $item['ext'];
    $fcc = new featurecode('daynight', 'toggle-mode-' . $id);
    $fcc->delete();
    unset($fcc);
}
sql('DROP TABLE IF EXISTS daynight');
开发者ID:hardikk,项目名称:HNH,代码行数:15,代码来源:uninstall.php

示例13: polycomphones_get_dialpad

    // Blind transfer feature code is preferred as using phone transfer will hang up call if slots are filled
    if ($code != '') {
        $xml->softkey->addAttribute("softkey.2.action", polycomphones_get_dialpad($code) . '$Cp1$' . $parkext . '$Tdtmf$$FDialpadPound$');
    } else {
        if (strpos($_SERVER['HTTP_USER_AGENT'], 'PolycomVVX') !== false) {
            $xml->softkey->addAttribute("softkey.2.action", '$FTransfer$' . polycomphones_get_dialpad($parkext) . '$FSoftKey1$$Cp3$$Chu$');
        } else {
            $xml->softkey->addAttribute("softkey.2.action", '$FTransfer$' . polycomphones_get_dialpad($parkext) . '$FDialpadPound$$Cp3$$Chu$');
        }
    }
    $xml->softkey->addAttribute("softkey.2.enable", '1');
} else {
    $xml->softkey->addAttribute("softkey.2.enable", '0');
}
// Record Call Button
$fcc = new featurecode('core', 'automon');
$code = $fcc->getCodeActive();
unset($fcc);
if ($code != '') {
    $xml->softkey->addAttribute("softkey.3.action", $code);
    $xml->softkey->addAttribute("softkey.3.enable", '1');
} else {
    $xml->softkey->addAttribute("softkey.3.enable", '0');
}
// VVX series move DND button to next page
$matches = array();
if (preg_match('/FileTransport PolycomVVX[^\\/.]*\\/([\\d\\.]*)/', $_SERVER['HTTP_USER_AGENT'], $matches) == 1) {
    if (version_compare($matches[1], '4.1.6') >= 0) {
        $xml->softkey->addAttribute("softkey.4.insert", '3');
    } else {
        $xml->softkey->addAttribute("softkey.4.insert", '2');
开发者ID:olivierIllogika,项目名称:polycomphones,代码行数:31,代码来源:exten.php

示例14: fax_get_config


//.........这里部分代码省略.........
                // $fax['receivefax'] should be rxfax or receivefax, it could be none in which case we don't know. We'll just make it
                // ReceiveFAX in that case since it will fail anyhow.
                if ($fax['receivefax'] == 'rxfax') {
                    $ext->add($context, $exten, '', new ext_rxfax('${ASTSPOOLDIR}/fax/${UNIQUEID}.tif'));
                    //receive fax, then email it on
                } elseif ($fax['receivefax'] == 'receivefax') {
                    $ext->add($context, $exten, '', new ext_receivefax('${ASTSPOOLDIR}/fax/${UNIQUEID}.tif' . $t38_fb));
                    //receive fax, then email it on
                } else {
                    $ext->add($context, $exten, '', new ext_noop('ERROR: NO Receive FAX application detected, putting in dialplan for ReceiveFAX as default'));
                    $ext->add($context, $exten, '', new ext_receivefax('${ASTSPOOLDIR}/fax/${UNIQUEID}.tif' . $t38_fb));
                    //receive fax, then email it on
                    $ext->add($context, $exten, '', new ext_execif('$["${FAXSTATUS}" = ""]', 'Set', 'FAXSTATUS=${IF($["${FAXOPT(error)}" = ""]?"FAILED LICENSE EXCEEDED":"FAILED FAXOPT: error: ${FAXOPT(error)} status: ${FAXOPT(status)} statusstr: ${FAXOPT(statusstr)}")}'));
                }
                break;
            case 'res_fax':
                $ext->add($context, $exten, '', new ext_receivefax('${ASTSPOOLDIR}/fax/${UNIQUEID}.tif' . $t38_fb));
                //receive fax, then email it on
                if ($ast_ge_16) {
                    if ($fax['ffa']) {
                        $ext->add($context, $exten, '', new ext_execif('$["${FAXSTATUS}"="" | "${FAXSTATUS}" = "FAILED" & "${FAXERROR}" = "INIT_ERROR"]', 'Set', 'FAXSTATUS=FAILED LICENSE MAY BE EXCEEDED check log errors'));
                    }
                    $ext->add($context, $exten, '', new ext_execif('$["${FAXSTATUS:0:6}"="FAILED" && "${FAXERROR}"!="INIT_ERROR"]', 'Set', 'FAXSTATUS="FAILED: error: ${FAXERROR} statusstr: ${FAXOPT(statusstr)}"'));
                } else {
                    // Some versions or settings appear to have successful completions continue, so check status and goto hangup code
                    if ($fax['ffa']) {
                        $ext->add($context, $exten, '', new ext_execif('$["${FAXOPT(error)}"=""]', 'Set', 'FAXSTATUS=FAILED LICENSE MAY BE EXCEEDED'));
                    }
                    $ext->add($context, $exten, '', new ext_execif('$["${FAXOPT(error)}"!="" && "${FAXOPT(error)}"!="NO_ERROR"]', 'Set', 'FAXSTATUS="FAILED FAXOPT: error: ${FAXOPT(error)} status: ${FAXOPT(status)} statusstr: ${FAXOPT(statusstr)}"'));
                }
                $ext->add($context, $exten, '', new ext_hangup());
                break;
            default:
                // unknown
                $ext->add($context, $exten, '', new ext_noop('No Known FAX Technology installed to receive a fax, aborting'));
                $ext->add($context, $exten, '', new ext_set('FAXSTATUS', 'FAILED No Known Fax Reception Apps available to process'));
                $ext->add($context, $exten, '', new ext_hangup());
        }
        $exten = 'h';
        // if there is a file there, mail it even if we failed:
        $ext->add($context, $exten, '', new ext_gotoif('$[${STAT(e,${ASTSPOOLDIR}/fax/${UNIQUEID}.tif)} = 0]', 'failed'));
        $ext->add($context, $exten, '', new ext_noop_trace('PROCESSING FAX with status: [${FAXSTATUS}] for: [${FAX_RX_EMAIL}], From: [${CALLERID(all)}]'));
        $ext->add($context, $exten, 'process', new ext_gotoif('$[${LEN(${FAX_RX_EMAIL})} = 0]', 'noemail'));
        //delete is a variable so that other modules can prevent it should then need to prosses the file further
        $ext->add($context, $exten, 'delete_opt', new ext_set('DELETE_AFTER_SEND', 'true'));
        //strreplace wasn't put into asterisk until 10, so fallback to replace to older asterisk versions
        if ($ast_ge_10) {
            $ext->add($context, $exten, '', new ext_system('${ASTVARLIBDIR}/bin/fax2mail.php --remotestationid "${FAXOPT(remotestationid)}" --to "${FAX_RX_EMAIL}" --dest "${FROM_DID}" --callerid \'${STRREPLACE(CALLERID(all),\',\\\\\')}\' --file ${ASTSPOOLDIR}/fax/${UNIQUEID}.tif --exten "${FAX_FOR}" --delete "${DELETE_AFTER_SEND}" --attachformat "${FAX_ATTACH_FORMAT}"'));
        } else {
            $ext->add($context, $exten, '', new ext_system('${ASTVARLIBDIR}/bin/fax2mail.php --remotestationid "${FAXOPT(remotestationid)}" --to "${FAX_RX_EMAIL}" --dest "${FROM_DID}" --callerid \'${REPLACE(CALLERID(all),\', )}\' --file ${ASTSPOOLDIR}/fax/${UNIQUEID}.tif --exten "${FAX_FOR}" --delete "${DELETE_AFTER_SEND}" --attachformat "${FAX_ATTACH_FORMAT}"'));
        }
        $ext->add($context, $exten, 'end', new ext_macro('hangupcall'));
        $ext->add($context, $exten, 'noemail', new ext_noop('ERROR: No Email Address to send FAX: status: [${FAXSTATUS}],  From: [${CALLERID(all)}]'));
        $ext->add($context, $exten, '', new ext_macro('hangupcall'));
        $ext->add($context, $exten, 'failed', new ext_noop('FAX ${FAXSTATUS} for: ${FAX_RX_EMAIL} , From: ${CALLERID(all)}'), 'process', 101);
        $ext->add($context, $exten, '', new ext_macro('hangupcall'));
        $modulename = 'fax';
        $fcc = new featurecode($modulename, 'simu_fax');
        $fc_simu_fax = $fcc->getCodeActive();
        unset($fcc);
        if ($fc_simu_fax != '') {
            $default_address = sql('SELECT value FROM fax_details WHERE `key` = \'FAX_RX_EMAIL\'', 'getRow');
            $ext->addInclude('from-internal-additional', 'app-fax');
            // Add the include from from-internal
            $ext->add('app-fax', $fc_simu_fax, '', new ext_setvar('FAX_RX_EMAIL', $default_address[0]));
            $ext->add('app-fax', $fc_simu_fax, '', new ext_goto('1', 's', 'ext-fax'));
            $ext->add('app-fax', 'h', '', new ext_macro('hangupcall'));
        }
        // This is not really needed but is put here in case some ever accidently switches the order below when
        // checking for this setting since $fax['module'] will be set there and the 2nd part never checked
        $fax_settings['force_detection'] = 'yes';
    } else {
        $fax_settings = fax_get_settings();
    }
    if ($fax['module'] && ($ast_lt_18 || $fax['ffa'] || $fax['spandsp']) || $fax_settings['force_detection'] == 'yes') {
        if ($ast_ge_11 && isset($core_conf) && is_a($core_conf, "core_conf")) {
            $core_conf->addSipGeneral('faxdetect', 'no');
        } else {
            if ($ast_ge_16 && isset($core_conf) && is_a($core_conf, "core_conf")) {
                $core_conf->addSipGeneral('faxdetect', 'yes');
            }
        }
        $ext->add('ext-did-0001', 'fax', '', new ext_goto('${CUT(FAX_DEST,^,1)},${CUT(FAX_DEST,^,2)},${CUT(FAX_DEST,^,3)}'));
        $ext->add('ext-did-0002', 'fax', '', new ext_goto('${CUT(FAX_DEST,^,1)},${CUT(FAX_DEST,^,2)},${CUT(FAX_DEST,^,3)}'));
        // Add fax extension to ivr and announcement as inbound controle may be passed quickly to them and still detection is desired
        if (function_exists('ivr_list')) {
            $ivrlist = ivr_list();
            if (is_array($ivrlist)) {
                foreach ($ivrlist as $item) {
                    $ext->add("ivr-" . $item['ivr_id'], 'fax', '', new ext_goto('${CUT(FAX_DEST,^,1)},${CUT(FAX_DEST,^,2)},${CUT(FAX_DEST,^,3)}'));
                }
            }
        }
        if (function_exists('announcement_list')) {
            foreach (announcement_list() as $row) {
                $ext->add('app-announcement-' . $row['announcement_id'], 'fax', '', new ext_goto('${CUT(FAX_DEST,^,1)},${CUT(FAX_DEST,^,2)},${CUT(FAX_DEST,^,3)}'));
            }
        }
    }
}
开发者ID:lidl,项目名称:fax,代码行数:101,代码来源:functions.inc.php

示例15: paging_get_config

function paging_get_config($engine)
{
    global $db;
    global $ext;
    global $chan_dahdi;
    global $version;
    switch ($engine) {
        case "asterisk":
            $ast_ge_16 = version_compare($version, "1.6", "ge");
            // setup for intercom
            $fcc = new featurecode('paging', 'intercom-prefix');
            $intercom_code = $fcc->getCodeActive();
            unset($fcc);
            // Since these are going down channel local, set ALERT_INFO and SIPADDHEADER which will be set in dialparties.agi
            // no point in even setting the headers here they will get lost in channel local
            //
            /* Set these up once here and in intercom so that autoanswer macro does not have
             * to go through this for every single extension which causes a lot of extra overhead
             * with big page groups
             */
            $has_answermacro = false;
            $alertinfo = 'Alert-Info: Ring Answer';
            $callinfo = 'Call-Info: <uri>\\;answer-after=0';
            $sipuri = 'intercom=true';
            $doptions = 'A(beep)';
            $dtime = '5';
            $custom_vars = array();
            $autoanswer_arr = paging_get_autoanswer_defaults();
            foreach ($autoanswer_arr as $autosetting) {
                switch (trim($autosetting['var'])) {
                    case 'ALERTINFO':
                        $alertinfo = trim($autosetting['setting']);
                        break;
                    case 'CALLINFO':
                        $callinfo = trim($autosetting['setting']);
                        break;
                    case 'SIPURI':
                        $sipuri = trim($autosetting['setting']);
                        break;
                    case 'VXML_URL':
                        $vxml_url = trim($autosetting['setting']);
                        break;
                    case 'DOPTIONS':
                        $doptions = trim($autosetting['setting']);
                        break;
                    case 'DTIME':
                        $dtime = trim($autosetting['setting']);
                        break;
                    default:
                        $key = trim($autosetting['var']);
                        $custom_vars[$key] = trim($autosetting['setting']);
                        if (ltrim($custom_vars[$key], '_') == "ANSWERMACRO") {
                            $has_answermacro = true;
                        }
                        break;
                }
            }
            $extpaging = 'ext-paging';
            if (!empty($intercom_code)) {
                $code = '_' . $intercom_code . '.';
                $context = 'ext-intercom';
                $ext->add($context, $code, '', new ext_macro('user-callerid'));
                $ext->add($context, $code, '', new ext_setvar('dialnumber', '${EXTEN:' . strlen($intercom_code) . '}'));
                $ext->add($context, $code, '', new ext_gotoif('$["${DB(AMPUSER/${AMPUSER}/intercom/block)}" = "blocked"]', 'end'));
                $ext->add($context, $code, '', new ext_gotoif('$["${DB(DND/${dialnumber})}" = "YES"]', 'end'));
                $ext->add($context, $code, '', new ext_gotoif('$["${DB(AMPUSER/${dialnumber}/intercom/${AMPUSER})}" = "allow" ]', 'allow'));
                $ext->add($context, $code, '', new ext_gotoif('$["${DB(AMPUSER/${dialnumber}/intercom/${AMPUSER})}" = "deny" ]', 'nointercom'));
                $ext->add($context, $code, '', new ext_gotoif('$["${DB(AMPUSER/${dialnumber}/intercom)}" = "disabled" ]', 'nointercom'));
                $ext->add($context, $code, 'allow', new ext_dbget('DEVICES', 'AMPUSER/${dialnumber}/device'));
                $ext->add($context, $code, '', new ext_gotoif('$["${DEVICES}" = "" ]', 'end'));
                $ext->add($context, $code, '', new ext_setvar('LOOPCNT', '${FIELDQTY(DEVICES,&)}'));
                /* Set these up so that macro-autoanswer doesn't have to
                 */
                $ext->add($context, $code, '', new ext_setvar('_SIPURI', ''));
                if (trim($alertinfo) != "") {
                    $ext->add($context, $code, '', new ext_setvar('_ALERTINFO', $alertinfo));
                }
                if (trim($callinfo) != "") {
                    $ext->add($context, $code, '', new ext_setvar('_CALLINFO', $callinfo));
                }
                if (trim($sipuri) != "") {
                    $ext->add($context, $code, '', new ext_setvar('_SIPURI', $sipuri));
                }
                if (trim($vxml_url) != "") {
                    $ext->add($context, $code, '', new ext_setvar('_VXML_URL', $vxml_url));
                }
                if (trim($doptions) != "") {
                    $ext->add($context, $code, '', new ext_setvar('_DOPTIONS', $doptions));
                }
                foreach ($custom_vars as $key => $value) {
                    $ext->add($context, $code, '', new ext_setvar('_' . ltrim($key, '_'), $value));
                }
                $ext->add($context, $code, '', new ext_setvar('_DTIME', $dtime));
                $ext->add($context, $code, '', new ext_setvar('_ANSWERMACRO', ''));
                $ext->add($context, $code, '', new ext_gotoif('$[${LOOPCNT} > 1 ]', 'pagemode'));
                $ext->add($context, $code, '', new ext_macro('autoanswer', '${DEVICES}'));
                if ($ast_ge_16) {
                    $ext->add($context, $code, 'check', new ext_chanisavail('${DIAL}', 's'));
                    $ext->add($context, $code, '', new ext_gotoif('$["${AVAILORIGCHAN}" == ""]', 'end'));
                } else {
//.........这里部分代码省略.........
开发者ID:hardikk,项目名称:HNH,代码行数:101,代码来源:functions.inc.php


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