Example #1
0
function gabcast_sidebar($sel, $type, $iam)
{
    echo "</div><div class='rnav'>\n";
    echo "<ul><li><a id='" . ($sel == '' ? 'current' : 'std') . "' ";
    echo "href='config.php?type={$type}&amp;display={$iam}&amp;action=add'>" . _("Add Gabcast Channel") . "</a></li>";
    //get the list of paging groups
    $resarr = gabcast_list();
    if ($resarr) {
        foreach ($resarr as $resar) {
            $cursel = $resar[0];
            echo "<li><a id=\"" . ($sel == $cursel ? 'current' : 'std');
            echo "\" href=\"config.php?type={$type}&amp;display=";
            echo "{$iam}&amp;ext={$cursel}&amp;action=edit\">";
            echo _("Ext") . " {$cursel} -> " . _("Chan") . " {$resar[1]} </a></li>";
        }
    }
    echo "</ul></div><div class='content'><h2>" . _("Gabcast Configuration") . "</h2>\n";
}
Example #2
0
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;
    }
}