Ejemplo n.º 1
0
function _moduleContent(&$smarty, $module_name)
{
    global $arrConf;
    //folder path for custom templates
    $local_templates_dir = getWebDirModule($module_name);
    //conexion resource
    $pDB = new paloDB($arrConf['elastix_dsn']["elastix"]);
    //user credentials
    global $arrCredentials;
    $action = getAction();
    $content = "";
    switch ($action) {
        case "new_trunk":
            $content = viewFormTrunk($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials);
            break;
        case "view":
            $content = viewFormTrunk($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials);
            break;
        case "view_edit":
            $content = viewFormTrunk($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials);
            break;
        case "save_new":
            $content = saveTrunk($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials);
            break;
        case "save_edit":
            $content = saveTrunk($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials);
            break;
        case "delete":
            $content = deleteTrunk($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials);
            break;
        case "get_num_calls":
            $content = get_num_calls($smarty, $pDB, $arrCredentials);
            break;
        case "actDesactTrunk":
            $content = actDesactTrunk($smarty, $pDB);
            break;
        default:
            // report
            $content = reportTrunks($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials);
            break;
    }
    return $content;
}
Ejemplo n.º 2
0
     exec($iaxScript);
     exec($wOpScript);
     needreload();
     $extdisplay = "OUT_" . $trunknum;
     break;
 case "edittrunk":
     editTrunk($trunknum, $channelid, $dialoutprefix, $maxchans, $outcid, $peerdetails, $usercontext, $userconfig, $register, $accountcodefinal, $outtrunkright);
     addDialRules($trunknum, $dialrules);
     exec($extenScript);
     exec($sipScript);
     exec($iaxScript);
     exec($wOpScript);
     needreload();
     break;
 case "deltrunk":
     deleteTrunk($trunknum);
     deleteDialRules($trunknum);
     exec($extenScript);
     exec($sipScript);
     exec($iaxScript);
     exec($wOpScript);
     needreload();
     $extdisplay = '';
     break;
 case "populatenpanxx":
     if (preg_match("/^([2-9]\\d\\d)-?([2-9]\\d\\d)\$/", $_REQUEST["npanxx"], $matches)) {
         $ch = curl_init();
         curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
         curl_setopt($ch, CURLOPT_URL, "http://members.dandy.net/~czg/lca_prefix.php?npa=" . $matches[1] . "&nxx=" . $matches[2] . "&ocn=&pastdays=0&nextdays=0");
         curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Linux; Voiper Local Trunks Configuration)");
         $str = curl_exec($ch);
Ejemplo n.º 3
0
function editTrunk($trunknum, $channelid, $dialoutprefix, $maxchans, $outcid, $peerdetails, $usercontext, $userconfig, $register, $accountcodefinal, $outtrunkright)
{
    //echo "editTrunk($trunknum, $channelid, $dialoutprefix, $maxchans, $outcid, $peerdetails, $usercontext, $userconfig, $register)";
    $tech = getTrunkTech($trunknum);
    deleteTrunk($trunknum, $tech);
    backendAddTrunk($trunknum, $tech, $channelid, $dialoutprefix, $maxchans, $outcid, $peerdetails, $usercontext, $userconfig, $register, $accountcodefinal, $outtrunkright);
}