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


PHP featurecode::getCodeActive方法代码示例

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


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

示例1: 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

示例2: 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

示例3: 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

示例4: 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

示例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: voicemail_get_config

function voicemail_get_config($engine)
{
    $modulename = 'voicemail';
    // This generates the dialplan
    global $ext;
    switch ($engine) {
        case "asterisk":
            /*
             * vm-callme context plays voicemail over telephone for web click-to-call
             * MSG and MBOX are channel variables that must be set when originating the call
             */
            $context = 'vm-callme';
            $ext->add($context, 's', '', new ext_answer());
            $ext->add($context, 's', '', new ext_wait(1));
            $ext->add($context, 's', 'repeat', new ext_background('${MSG}&silence/2&vm-repeat&vm-starmain'));
            $ext->add($context, 's', '', new ext_waitexten(15));
            $ext->add($context, '5', '', new ext_goto('repeat', 's'));
            $ext->add($context, '#', '', new ext_playback('vm-goodbye'));
            $ext->add($context, '#', '', new ext_hangup());
            $ext->add($context, '*', '', new ext_macro('get-vmcontext', '${MBOX}'));
            $ext->add($context, '*', '', new ext_vmmain('${MBOX}@${VMCONTEXT},s'));
            $ext->add($context, 'i', '', new ext_playback('pm-invalid-option'));
            $ext->add($context, 'i', '', new ext_goto('repeat', 's'));
            $ext->add($context, 't', '', new ext_playback('vm-goodbye'));
            $ext->add($context, 't', '', new ext_hangup());
            $ext->add($context, 'h', '', new ext_hangup());
            /* end vm-callme context  */
            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}"));
                    }
                }
            }
            // Temporary Kludge Until we remove these as globals out of VMX Locater and Other Places
            // However, if we remove these, we MUST make some changes to the dialplan currently commented
            // in the vmx locater code in core
            $settings = voicemail_admin_get();
            foreach ($settings as $k => $v) {
                $ext->addGlobal($k, $v);
            }
            break;
    }
}
开发者ID:ringfreejohn,项目名称:pbxframework,代码行数:53,代码来源:functions.inc.php

示例11: findmefollow_get_config

function findmefollow_get_config($engine)
{
    global $ext;
    // is this the best way to pass this?
    global $amp_conf;
    switch ($engine) {
        case "asterisk":
            if ($amp_conf['USEDEVSTATE']) {
                $ext->addGlobal('FMDEVSTATE', 'TRUE');
            }
            $fcc = new featurecode('findmefollow', 'fmf_toggle');
            $fmf_code = $fcc->getCodeActive();
            unset($fcc);
            if ($fmf_code != '') {
                findmefollow_fmf_toggle($fmf_code);
            }
            $ext->addInclude('from-internal-additional', 'ext-findmefollow');
            $ext->addInclude('from-internal-additional', 'fmgrps');
            $contextname = 'ext-findmefollow';
            // Before creating all the contexts, let's make a list of hints if needed
            //
            if ($amp_conf['USEDEVSTATE'] && $fmf_code != '') {
                $device_list = core_devices_list("all", 'full', true);
                foreach ($device_list as $device) {
                    if ($device['tech'] == 'sip' || $device['tech'] == 'iax2') {
                        $ext->add($contextname, $fmf_code . $device['id'], '', new ext_goto("1", $fmf_code, "app-fmf-toggle"));
                        $ext->addHint($contextname, $fmf_code . $device['id'], "Custom:FOLLOWME" . $device['id']);
                    }
                }
            }
            $ringlist = findmefollow_full_list();
            if (is_array($ringlist)) {
                foreach ($ringlist as $item) {
                    $grpnum = ltrim($item['0']);
                    $grp = findmefollow_get($grpnum);
                    $strategy = $grp['strategy'];
                    $grptime = $grp['grptime'];
                    $grplist = $grp['grplist'];
                    $postdest = $grp['postdest'];
                    $grppre = isset($grp['grppre']) ? $grp['grppre'] : '';
                    $annmsg_id = $grp['annmsg_id'];
                    $dring = $grp['dring'];
                    $needsconf = $grp['needsconf'];
                    $remotealert_id = $grp['remotealert_id'];
                    $toolate_id = $grp['toolate_id'];
                    $ringing = $grp['ringing'];
                    $pre_ring = $grp['pre_ring'];
                    if ($ringing == 'Ring' || empty($ringing)) {
                        $dialopts = '${DIAL_OPTIONS}';
                    } else {
                        // We need the DIAL_OPTIONS variable
                        $sops = sql("SELECT value from globals where variable='DIAL_OPTIONS'", "getRow");
                        $dialopts = "m({$ringing})" . str_replace('r', '', $sops[0]);
                    }
                    // Direct target to Follow-Me come here bypassing the followme/ddial conditional check
                    //
                    $ext->add($contextname, 'FM' . $grpnum, '', new ext_goto("FM{$grpnum}", "{$grpnum}"));
                    //
                    // If the followme is configured for extension dialing to go to the the extension and not followme then
                    // go there. This is often used in VmX Locater functionality when the user does not want the followme
                    // to automatically be called but only if chosen by the caller as an alternative to going to voicemail
                    //
                    $ext->add($contextname, $grpnum, '', new ext_gotoif('$[ "${DB(AMPUSER/' . $grpnum . '/followme/ddial)}" = "EXTENSION" ]', 'ext-local,' . $grpnum . ',1'));
                    $ext->add($contextname, $grpnum, 'FM' . $grpnum, new ext_macro('user-callerid'));
                    $ext->add($contextname, $grpnum, '', new ext_set('__EXTTOCALL', '${EXTEN}'));
                    // block voicemail until phone is answered at which point a macro should be called on the answering
                    // line to clear this flag so that subsequent transfers can occur, if already set by a the caller
                    // then don't change.
                    //
                    $ext->add($contextname, $grpnum, '', new ext_gotoif('$["foo${BLKVM_OVERRIDE}" = "foo"]', 'skipdb'));
                    $ext->add($contextname, $grpnum, '', new ext_gotoif('$["${DB(${BLKVM_OVERRIDE})}" = "TRUE"]', 'skipov'));
                    $ext->add($contextname, $grpnum, 'skipdb', new ext_setvar('__NODEST', ''));
                    $ext->add($contextname, $grpnum, '', new ext_setvar('__BLKVM_OVERRIDE', 'BLKVM/${EXTEN}/${CHANNEL}'));
                    $ext->add($contextname, $grpnum, '', new ext_setvar('__BLKVM_BASE', '${EXTEN}'));
                    $ext->add($contextname, $grpnum, '', new ext_setvar('DB(${BLKVM_OVERRIDE})', 'TRUE'));
                    // Remember if NODEST was set later, but clear it in case the call is answered so that subsequent
                    // transfers work.
                    //
                    $ext->add($contextname, $grpnum, 'skipov', new ext_setvar('RRNODEST', '${NODEST}'));
                    $ext->add($contextname, $grpnum, 'skipvmblk', new ext_setvar('__NODEST', '${EXTEN}'));
                    $ext->add($contextname, $grpnum, '', new ext_gosubif('$[${DB_EXISTS(AMPUSER/' . $grpnum . '/followme/changecid)} = 1 & "${DB(AMPUSER/' . $grpnum . '/followme/changecid)}" != "default" & "${DB(AMPUSER/' . $grpnum . '/followme/changecid)}" != ""]', 'sub-fmsetcid,s,1'));
                    // deal with group CID prefix
                    // but strip only if you plan on setting a new one
                    if ($grppre != '') {
                        $ext->add($contextname, $grpnum, '', new ext_gotoif('$["foo${RGPREFIX}" = "foo"]', 'REPCID'));
                        $ext->add($contextname, $grpnum, '', new ext_gotoif('$["${RGPREFIX}" != "${CALLERID(name):0:${LEN(${RGPREFIX})}}"]', 'REPCID'));
                        $ext->add($contextname, $grpnum, '', new ext_noop('Current RGPREFIX is ${RGPREFIX}....stripping from Caller ID'));
                        $ext->add($contextname, $grpnum, '', new ext_setvar('CALLERID(name)', '${CALLERID(name):${LEN(${RGPREFIX})}}'));
                        $ext->add($contextname, $grpnum, '', new ext_setvar('_RGPREFIX', ''));
                        $ext->add($contextname, $grpnum, 'REPCID', new ext_noop('CALLERID(name) is ${CALLERID(name)}'));
                        $ext->add($contextname, $grpnum, '', new ext_setvar('_RGPREFIX', $grppre));
                        $ext->add($contextname, $grpnum, '', new ext_setvar('CALLERID(name)', '${RGPREFIX}${CALLERID(name)}'));
                    }
                    // recording stuff
                    $ext->add($contextname, $grpnum, '', new ext_setvar('RecordMethod', 'Group'));
                    // append the followme's extension to the grouplist. This may be redundant but will ensure recording if the extension itself is not part of
                    // the list
                    $ext->add($contextname, $grpnum, '', new ext_macro('record-enable', '${DB(AMPUSER/' . "{$grpnum}/followme/grplist)}-{$grpnum}" . ',${RecordMethod}'));
                    // MODIFIED (PL)
                    // Add Alert Info if set but don't override and already set value (could be from ringgroup, directdid, etc.)
//.........这里部分代码省略.........
开发者ID:hardikk,项目名称:HNH,代码行数:101,代码来源:functions.inc.php

示例12: featurecode

$bootstrap_settings['freepbx_auth'] = false;
if (!@(include_once getenv('FREEPBX_CONF') ? getenv('FREEPBX_CONF') : '/etc/freepbx.conf')) {
    include_once '/etc/asterisk/freepbx.conf';
}
if (isset($argv[1])) {
    $queue_toggle_code = $argv[1];
} else {
    $fcc = new featurecode('queues', 'que_toggle');
    $queue_toggle_code = $fcc->getCodeActive();
    unset($fcc);
}
if (isset($argv[2])) {
    $queue_pause_code = $argv[2];
} else {
    $fcc = new featurecode('queues', 'que_pause_toggle');
    $queue_pause_code = $fcc->getCodeActive();
    unset($fcc);
}
if ($queue_pause_code == '' && $queue_toggle_code == '') {
    exit(0);
}
$var = $astman->database_show('AMPUSER');
foreach ($var as $key => $value) {
    $myvar = explode('/', trim($key, '/'));
    $user_hash[$myvar[1]] = true;
}
foreach (array_keys($user_hash) as $user) {
    if ($user == '') {
        unset($user_hash[$user]);
        continue;
    }
开发者ID:ringfreejohn,项目名称:pbxframework,代码行数:31,代码来源:generate_queue_hints.php

示例13: core_do_get_config

function core_do_get_config($engine)
{
    global $ext;
    // is this the best way to pass this?
    global $version;
    // this is not the best way to pass this, this should be passetd together with $engine
    global $engineinfo;
    global $amp_conf;
    global $core_conf;
    global $chan_dahdi;
    global $chan_dahdi_loaded;
    global $astman;
    $modulename = "core";
    $callrecording = 'callrecording';
    $callrecording_uid = 'MISSING_CALLRECORDINGS';
    $getCallRecordingModInfo = module_getinfo($callrecording, MODULE_STATUS_ENABLED);
    $nt = notifications::create();
    if (!isset($getCallRecordingModInfo[$callrecording]) || $getCallRecordingModInfo[$callrecording]['status'] !== MODULE_STATUS_ENABLED) {
        if (!$nt->exists($modulename, $callrecording_uid)) {
            $nt->add_notice($modulename, $callrecording_uid, _('Call Recording Module Not Enabled'), _('The Call Recording module is not enabled. Since this feature is required for call recording you may not be able to record calls until the module is installed and enabled.'), '', true, true);
        }
    } else {
        if ($nt->exists($modulename, $callrecording_uid)) {
            $nt->delete($modulename, $callrecording_uid);
        }
    }
    switch ($engine) {
        case "asterisk":
            $ast_ge_14 = version_compare($version, '1.4', 'ge');
            $ast_lt_16 = version_compare($version, '1.6', 'lt');
            $ast_lt_161 = version_compare($version, '1.6.1', 'lt');
            $ast_ge_162 = version_compare($version, '1.6.2', 'ge');
            $ast_ge_10 = version_compare($version, '10', 'ge');
            // Now add to sip_general_addtional.conf
            //
            if (isset($core_conf) && is_a($core_conf, "core_conf")) {
                $useragent = $amp_conf['SIPUSERAGENT'] . '-' . getversion() . "({$version})";
                $core_conf->addIaxGeneral('disallow', 'all');
                $core_conf->addIaxGeneral('allow', 'ulaw');
                $core_conf->addIaxGeneral('allow', 'alaw');
                $core_conf->addIaxGeneral('allow', 'gsm');
                $core_conf->addIaxGeneral('mailboxdetail', 'yes');
                if ($ast_ge_14) {
                    $core_conf->addIaxGeneral('tos', 'ef');
                    // Recommended setting from doc/ip-tos.txt
                }
                $fcc = new featurecode($modulename, 'blindxfer');
                $code = $fcc->getCodeActive();
                unset($fcc);
                $core_conf->addFeatureMap('blindxfer', $code);
                $fcc = new featurecode($modulename, 'atxfer');
                $code = $fcc->getCodeActive();
                unset($fcc);
                $core_conf->addFeatureMap('atxfer', $code);
                $fcc = new featurecode($modulename, 'automon');
                $code = $fcc->getCodeActive();
                unset($fcc);
                if ($code != '') {
                    $core_conf->addFeatureMap('automon', $code);
                    //references app record
                    $core_conf->addApplicationMap('apprecord', $code . ',caller,Macro,one-touch-record', true);
                    /* At this point we are not using hints since we have not found a good way to be always
                     * consistent on both sides of the channel
                     *
                     * $ext->addInclude('from-internal-additional', 'device-hints');
                     * $device_list = core_devices_list("all", 'full', true);
                     * foreach ($device_list as $device) {
                     * 	if ($device['tech'] == 'sip' || $device['tech'] == 'iax2') {
                     *    $ext->add('device-hints', $code.$device['id'], '', new ext_noop("AutoMixMon Hint for: ".$device['id']));
                     *    $ext->addHint('device-hints', $code.$device['id'], "Custom:RECORDING".$device['id']);
                     *   }
                     * }
                     */
                }
                $fcc = new featurecode($modulename, 'disconnect');
                $code = $fcc->getCodeActive();
                unset($fcc);
                $core_conf->addFeatureMap('disconnect', $code);
                $fcc = new featurecode($modulename, 'pickupexten');
                $code = $fcc->getCodeActive();
                unset($fcc);
                $core_conf->addFeatureGeneral('pickupexten', $code);
            }
            // FeatureCodes
            $fcc = new featurecode($modulename, 'userlogon');
            $fc_userlogon = $fcc->getCodeActive();
            unset($fcc);
            $fcc = new featurecode($modulename, 'userlogoff');
            $fc_userlogoff = $fcc->getCodeActive();
            unset($fcc);
            global $version;
            if (version_compare($version, "12.5", "<")) {
                $fcc = new featurecode($modulename, 'zapbarge');
                $fc_zapbarge = $fcc->getCodeActive();
                unset($fcc);
            }
            $fcc = new featurecode($modulename, 'chanspy');
            $fc_chanspy = $fcc->getCodeActive();
            unset($fcc);
            $fcc = new featurecode($modulename, 'simu_pstn');
//.........这里部分代码省略.........
开发者ID:lidl,项目名称:core,代码行数:101,代码来源:functions.inc.php

示例14: _

// check to see if user has automatic updates enabled
$cm =& cronmanager::create($db);
$online_updates = $cm->updates_enabled() ? true : false;
// check if new version of module is available
if ($online_updates && ($foo = trunkalarm_vercheck())) {
    print "<br>A <b>new version</b> of the Trunk Monitor module is available from the <a target='_blank' href='http://github.com/reconwireless/freepbx-trunk-monitor/downloads'>Reconwireless Repository on github</a><br>";
}
//tts_findengines()
if (count($_POST)) {
    trunkalarmoptions_saveconfig();
}
$date = trunkalarmoptions_getconfig();
$selected = $date[0];
//  Get current featurecode from FreePBX registry
$fcc = new featurecode('trunkalarm', 'trunkalarm');
$featurecode = $fcc->getCodeActive();
?>
<form method="POST" action="">
	<br><h2><?php 
echo _("Trunk Monitor");
?>
<hr></h5></td></tr>
Trunk Monitoring allows you to recieve an email alert whenvever the system detects a Trunk Failure.  .<br><br>
The goal is to have an automated call to an internal and external extension reading the trunk failure information via the selected text-to-speech engine. <br><br>
The feature code to access this service is currently set to <b><?php 
print $featurecode;
?>
</b>.  This value can be changed in Feature Codes. <br>

<br><h5>User Data:<hr></h5>
Select the Notifications Options and TTS Program combination you wish the Trunk Monitoring program to use.<br>The module does not check to see if the selected TTS engine is present, ensure to choose an engine that is installed on the system.<br><br>
开发者ID:reconwireless,项目名称:freepbx-trunk-monitor,代码行数:31,代码来源:page.trunkalarm.php

示例15: recordings_get_config

function recordings_get_config($engine)
{
    global $ext;
    // is this the best way to pass this?
    global $recordings_save_path;
    global $version;
    $ast_ge_14 = version_compare($version, '1.4', 'ge');
    $modulename = "recordings";
    $appcontext = "app-recordings";
    switch ($engine) {
        case "asterisk":
            // FeatureCodes for save / check
            $fcc = new featurecode($modulename, 'record_save');
            $fc_save = $fcc->getCodeActive();
            unset($fcc);
            $fcc = new featurecode($modulename, 'record_check');
            $fc_check = $fcc->getCodeActive();
            unset($fcc);
            if ($fc_save != '' || $fc_check != '') {
                $ext->addInclude('from-internal-additional', 'app-recordings');
                // Add the include from from-internal
                if ($fc_save != '') {
                    $ext->add($appcontext, $fc_save, '', new ext_macro('user-callerid'));
                    $ext->add($appcontext, $fc_save, '', new ext_wait('2'));
                    $ext->add($appcontext, $fc_save, '', new ext_macro('systemrecording', 'dorecord'));
                }
                if ($fc_check != '') {
                    $ext->add($appcontext, $fc_check, '', new ext_macro('user-callerid'));
                    $ext->add($appcontext, $fc_check, '', new ext_wait('2'));
                    $ext->add($appcontext, $fc_check, '', new ext_macro('systemrecording', 'docheck'));
                }
            }
            // Now generate the Feature Codes to edit recordings
            //
            $recordings = recordings_list();
            foreach ($recordings as $item) {
                // Get the feature code, and do a sanity check if it is not suppose to be active and delete it
                //
                if ($item['fcode'] != 0) {
                    $fcc = new featurecode($modulename, 'edit-recording-' . $item['id']);
                    $fcode = $fcc->getCodeActive();
                    unset($fcc);
                } else {
                    $fcc = new featurecode('recordings', 'edit-recording-' . $item['id']);
                    $fcc->delete();
                    unset($fcc);
                    continue;
                    // loop back to foreach
                }
                if ($fcode != '') {
                    // Do a sanity check, there should be no compound files
                    //
                    if (strpos($item['filename'], '&') === false && trim($item['filename']) != '') {
                        $fcode_pass = trim($item['fcode_pass']) != '' ? ',' . $item['fcode_pass'] : '';
                        $ext->add($appcontext, $fcode, '', new ext_macro('user-callerid'));
                        $ext->add($appcontext, $fcode, '', new ext_wait('2'));
                        $ext->add($appcontext, $fcode, '', new ext_macro('systemrecording', 'docheck,' . $item['filename'] . $fcode_pass));
                        //$ext->add($appcontext, $fcode, '', new ext_macro('hangup'));
                    }
                }
            }
            // moved from modules/core to modules/recordings
            // since it really belongs here and not there
            // also provides direct access to $recordings_save_path
            // which removes a hard-coded value in the macro
            $context = 'macro-systemrecording';
            $ext->add($context, 's', '', new ext_setvar('RECFILE', '${IF($["${ARG2}" = ""]?' . $recordings_save_path . '${AMPUSER}-ivrrecording:${ARG2})}'));
            $ext->add($context, 's', '', new ext_execif('$["${ARG3}" != ""]', 'Authenticate', '${ARG3}'));
            $ext->add($context, 's', '', new ext_goto(1, '${ARG1}'));
            $exten = 'dorecord';
            // Delete all versions of the current sound file (does not consider languages though
            // otherwise you might have some versions that are not re-recorded
            //
            $ext->add($context, $exten, '', new ext_system('rm ${ASTVARLIBDIR}/sounds/${RECFILE}.*'));
            $ext->add($context, $exten, '', new ext_record('${RECFILE}:wav'));
            $ext->add($context, $exten, '', new ext_wait(1));
            $ext->add($context, $exten, '', new ext_goto(1, 'confmenu'));
            $exten = 'docheck';
            $ext->add($context, $exten, '', new ext_playback('beep'));
            if ($ast_ge_14) {
                $ext->add($context, $exten, 'dc_start', new ext_background('${RECFILE},m,${CHANNEL(language)},macro-systemrecording'));
            } else {
                $ext->add($context, $exten, 'dc_start', new ext_background('${RECFILE},m,${LANGUAGE},macro-systemrecording'));
            }
            $ext->add($context, $exten, '', new ext_wait(1));
            $ext->add($context, $exten, '', new ext_goto(1, 'confmenu'));
            $exten = 'confmenu';
            if ($ast_ge_14) {
                $ext->add($context, $exten, '', new ext_background('to-listen-to-it&press-1&to-rerecord-it&press-star&astcc-followed-by-pound,m,${CHANNEL(language)},macro-systemrecording'));
            } else {
                $ext->add($context, $exten, '', new ext_background('to-listen-to-it&press-1&to-rerecord-it&press-star&astcc-followed-by-pound,m,${LANGUAGE},macro-systemrecording'));
            }
            $ext->add($context, $exten, '', new ext_read('RECRESULT', '', 1, '', '', 4));
            $ext->add($context, $exten, '', new ext_gotoif('$["x${RECRESULT}"="x*"]', 'dorecord,1'));
            $ext->add($context, $exten, '', new ext_gotoif('$["x${RECRESULT}"="x1"]', 'docheck,2'));
            $ext->add($context, $exten, '', new ext_goto(1));
            $ext->add($context, '1', '', new ext_goto('dc_start', 'docheck'));
            $ext->add($context, '*', '', new ext_goto(1, 'dorecord'));
            $ext->add($context, 't', '', new ext_playback('goodbye'));
            $ext->add($context, 't', '', new ext_hangup());
//.........这里部分代码省略.........
开发者ID:hardikk,项目名称:HNH,代码行数:101,代码来源:functions.inc.php


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