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


PHP AGI_AsteriskManager::GetVar方法代码示例

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


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

示例1: array

     * Get active channels with AGI lounched
     */
    $info = $asm->command("core show channels");
    $data = array();
    /*
     * Filter lines with AGI
     */
    foreach (preg_grep("/.*@.*:.*AGI/", explode("\n", $info["data"])) as $line) {
        $chan = preg_split("/ +/", $line);
        if (preg_match("/.*AGI\\((.*).*\\)/", $chan[3], $matches)) {
            $agi_params = preg_split("/,/", $matches[1]);
            /*
             * if ivr menu with name of second AGI param exist
             */
            if ($menu_table[$agi_params[1]]) {
                $call = array();
                $call['channel'] = $chan[0];
                $call['location'] = $chan[1];
                $call['state'] = $chan[2];
                $call['application'] = $chan[3];
                $cid = $asm->GetVar($chan[0], 'CALLERID(all)');
                $call['callerid'] = $cid['Value'];
                $data['calls'][] = $call;
            }
        }
    }
    if ($data && count($data)) {
        print_r(json_encode($data));
    }
    $asm->disconnect();
}
开发者ID:wdoyle,项目名称:phpivr,代码行数:31,代码来源:ivr-monitor.php

示例2: ExtrId

 if ($tmp2[5] == $sBridgeCall) {
     $i++;
     $leg1 = ExtrId($tmp2[0], $cDialplanSeparator);
     //после этого остаются только номера каналов без их технологии
     $leg2 = ExtrId($tmp2[$iSecondLegIndex], $cDialplanSeparator);
     //однако ZAP каналы будут называться как ZAPXXX
     //echo $leg1."\n";
     //echo $leg2."\n";
     if ($leg1 != $leg2) {
         $tmp3 = $ami->ExtensionState($leg1, $dialplan_context, $i * 1023);
         $connections[$leg1]["Status"] = $tmp3['Status'];
         $tmp3 = $ami->ExtensionState($leg2, $dialplan_context, $i * 1023);
         $connections[$leg2]["Status"] = $tmp3['Status'];
         $tmp3 = $ami->database_show("AMPUSER/{$leg1}/cidname");
         $leg1cid = $tmp3["/AMPUSER/{$leg1}/cidname"] . ' ';
         $tmp3 = $ami->GetVar($tmp2[$iSecondLegIndex], "CALLERID(name)");
         $leg2cid = $tmp3['Value'] . ' ';
         $connections[$leg1]["Connected"] = $leg2;
         $connections[$leg1]["Duration"] = @date("i:s", $tmp2[$iDurationIndex]);
         $connections[$leg1]["Application"] = $tmp2[5];
         $connections[$leg1]["CallerID"] = $leg2cid;
         $connections[$leg1]["Channel"] = $tmp2[$iSecondLegIndex];
         $connections[$leg2]["Connected"] = $leg1;
         $connections[$leg2]["Duration"] = @date("i:s", $tmp2[$iDurationIndex]);
         $connections[$leg2]["Application"] = $tmp2[5];
         $connections[$leg2]["CallerID"] = $leg1cid;
         $connections[$leg2]["Channel"] = $tmp2[0];
     }
 } elseif ($tmp2[4] == "Ring" and $tmp2[5] == "Dial") {
     $i++;
     $leg1 = ExtrId($tmp2[0], $cDialplanSeparator);
开发者ID:Open-Source-GIS,项目名称:lynks-ajax-panel,代码行数:31,代码来源:extensions-realtime.php

示例3: ExtrId

 if ($tmp2[5] == "Bridged Call") {
     $i++;
     $leg1 = ExtrId($tmp2[0]);
     //после этого остаются только номера каналов без их технологии
     $leg2 = ExtrId($tmp2[11]);
     //однако ZAP каналы будут называться как ZAPXXX
     //echo $leg1."\n";
     //echo $leg2."\n";
     if ($leg1 != $leg2) {
         $tmp3 = $ami->ExtensionState($leg1, "from-internal", $i * 1023);
         $connections[$leg1]["Status"] = $tmp3['Status'];
         $tmp3 = $ami->ExtensionState($leg2, "from-internal", $i * 1023);
         $connections[$leg2]["Status"] = $tmp3['Status'];
         $tmp3 = $ami->database_show("AMPUSER/{$leg1}/cidname");
         $leg1cid = $tmp3["/AMPUSER/{$leg1}/cidname"] . ' ';
         $tmp3 = $ami->GetVar($tmp2[11], "CALLERID(name)");
         $leg2cid = $tmp3['Value'] . ' ';
         $connections[$leg1]["Connected"] = $leg2;
         $connections[$leg1]["Duration"] = @date("i:s", $tmp2[10]);
         $connections[$leg1]["Application"] = $tmp2[5];
         $connections[$leg1]["CallerID"] = $leg2cid;
         $connections[$leg1]["Channel"] = $tmp2[11];
         $connections[$leg2]["Connected"] = $leg1;
         $connections[$leg2]["Duration"] = @date("i:s", $tmp2[10]);
         $connections[$leg2]["Application"] = $tmp2[5];
         $connections[$leg2]["CallerID"] = $leg1cid;
         $connections[$leg2]["Channel"] = $tmp2[0];
     }
 } elseif ($tmp2[4] == "Ring" and $tmp2[5] == "Dial") {
     $i++;
     $leg1 = ExtrId($tmp2[0]);
开发者ID:mirasis,项目名称:lynks-ajax-panel,代码行数:31,代码来源:extensions-realtime.php


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