コード例 #1
0
ファイル: page.trunks.php プロジェクト: umjinsun12/dngshin
             if (empty($peerdetails)) {
                 $peerdetails = core_trunks_getTrunkPeerDetails($trunknum);
             }
             if (empty($usercontext)) {
                 $usercontext = htmlentities($trunk_details['usercontext']);
             }
             if (empty($userconfig)) {
                 $userconfig = core_trunks_getTrunkUserConfig($trunknum);
             }
             if (empty($register)) {
                 $register = core_trunks_getTrunkRegister($trunknum);
             }
         }
     }
     if (count($dialpattern_array) == 0) {
         $dialpattern_array = core_trunks_get_dialrules($trunknum);
     }
     $upper_tech = strtoupper($tech);
     if (trim($trunk_name) == '') {
         $trunk_name = $upper_tech == 'ZAP' | $upper_tech == 'DAHDI' ? sprintf(_('%s Channel %s'), $upper_tech, $channelid) : $channelid;
     }
     // find which routes use this trunk
     $routes = core_trunks_gettrunkroutes($trunknum);
     $num_routes = count($routes);
     if ($num_routes > 0) {
         $usage_list = framework_display_destination_usage(core_getdest(ltrim($extdisplay, 'OUT_')));
     }
 } else {
     // 'Add New Trunk' selected.
     // Generic defaults
     $outcid = "";
コード例 #2
0
ファイル: functions.inc.php プロジェクト: lidl/core
function core_trunks_list_dialrules()
{
    $rule_hash = array();
    $patterns = core_trunks_get_dialrules();
    foreach ($patterns as $pattern) {
        //$rule_hash[$pattern['trunkid']][] = $pattern['prepend_digits'].'^'.$pattern['match_pattern_prefix'].'|'.$pattern['match_pattern_pass'];
        $rule_hash[$pattern['trunkid']][] = $pattern;
    }
    return $rule_hash;
}
コード例 #3
0
ファイル: sipstation.html.php プロジェクト: hardikk/HNH
         ob_start();
         if (!@(include 'views/freepbx_reload.php')) {
             @(include '../../views/freepbx_reload.php');
             //TODO for debugging
         }
         $json_array['reload_header'] = ob_get_clean();
     }
     $json_array['show_reload'] = 'yes';
 } else {
     $json_array['show_reload'] = 'no';
 }
 // Check trunknum1 for a prefix and use it since it is the primary trunk
 // hopefully they will be the same
 //
 $json_array['areacode'] = "";
 $dialrules = core_trunks_get_dialrules($trunknum1);
 if (is_array($dialrules) && count($dialrules)) {
     foreach ($dialrules as $rule) {
         if (preg_match('/^1{0,1}(\\d{3})$/', $rule['prepend_digits'], $matches)) {
             $json_array['areacode'] = $matches[1];
             break;
         }
     }
 }
 $settings = sipstation_get_sip_settings();
 $json_array['asterisk_registerattempts'] = $settings['Outbound reg. attempts'];
 // Get the Asterisk Registration Status, retry once if bumping into Auth. Sent.
 //
 $try_again = false;
 $cnt = 0;
 do {
コード例 #4
0
ファイル: routes.html.php プロジェクト: hardikk/HNH
if (isset($tlist["SIP/fpbx-1-{$sip_user}"]) && isset($tlist["SIP/fpbx-2-{$sip_user}"])) {
    $globalvar1 = $tlist["SIP/fpbx-1-{$sip_user}"]['globalvar'];
    $trunknum1 = ltrim($globalvar1, 'OUT_');
    $globalvar2 = $tlist["SIP/fpbx-2-{$sip_user}"]['globalvar'];
    $trunknum2 = ltrim($globalvar2, 'OUT_');
    // Check if we need to add dialrules
    //
    if (isset($_POST['areacode']) && trim($_POST['areacode']) != "") {
        /* We are adding a prefix, make sure it is 3 digits, then grab what's there
              rip it out if it is in there, push it on top and if the two differ, update
              if replacing, the old one will be further down and be dumped as a duplicate
           */
        $areacode = preg_replace("/[^0-9]/", "", trim($_POST['areacode']));
        if (strlen($areacode) == 3) {
            foreach (array($trunknum1, $trunknum2) as $trunk) {
                $dialrules = core_trunks_get_dialrules($trunk);
                if (is_array($dialrules) && count($dialrules)) {
                    foreach ($dialrules as $rule) {
                        $match = $rule['match_pattern_pass'];
                        $prefix = $rule['match_pattern_prefix'];
                        $prepend = $rule['prepend_digits'];
                        $dialrules_tmp[] = array('match_pattern_prefix' => $prefix, 'match_pattern_pass' => $match, 'prepend_digits' => $prepend);
                        if ($match != 'NXXXXXX' || $prepend != $areacode || $prefix != '') {
                            $dialrules_2[] = array('match_pattern_prefix' => $prefix, 'match_pattern_pass' => $match, 'prepend_digits' => $prepend);
                        }
                    }
                } else {
                    $dialrules_2 = array();
                    $dialrules_tmp = array();
                }
                array_unshift($dialrules_2, array('match_pattern_prefix' => '', 'match_pattern_pass' => 'NXXXXXX', 'prepend_digits' => $areacode));