本文整理汇总了PHP中astercrm::getTrunkinfo方法的典型用法代码示例。如果您正苦于以下问题:PHP astercrm::getTrunkinfo方法的具体用法?PHP astercrm::getTrunkinfo怎么用?PHP astercrm::getTrunkinfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类astercrm
的用法示例。
在下文中一共展示了astercrm::getTrunkinfo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: incomingCalls
function incomingCalls($myValue)
{
global $db, $locate, $config;
$objResponse = new xajaxResponse();
//print_r($myValue);exit;
if ($myValue['direction'] != '') {
$call = asterEvent::checkCallStatus($myValue['curid'], $myValue['uniqueid']);
#print_r($call);exit;
if ($call['status'] == '') {
if ($call['hold']['number'] != '') {
//print_r($myValue);exit;
$curcallerid = $call['hold']['number'];
$objResponse->addAssign("divHolding", "innerHTML", '<a href="###" onclick="getContact(' . $call['hold']['number'] . ');">[' . $call['hold']['number'] . ']</a> <a onclick="xajax_turnback(\'' . $call['hold']['channel'] . '\',\'' . $myValue['callerChannel'] . '\');return false;" href="###"><font size="2px">' . $locate->Translate("Turn back") . '</font></a> ');
//<a onclick="xajax_holdhangup(\''.$call['hold']['channel'].'\');return false;" href="###"><font size="2px">'.$locate->Translate("Hangup").'</font></a>
} else {
$curcallerid = $myValue['callerid'];
$objResponse->addAssign("divHolding", "innerHTML", '');
}
return $objResponse;
} elseif ($call['status'] == 'link') {
$objResponse->addAssign("btnDial", "disabled", true);
$objResponse->addScript("clearSettimePopup();");
if ($myValue['direction'] == 'in' && $myValue['trunkinfoStatus'] == 0) {
if ($call['didnumber'] != '') {
$didinfo = $locate->Translate("Callee id") . " : <b>" . $call['didnumber'] . "</b>";
$objResponse->addAssign('divDIDinfo', 'innerHTML', $didinfo);
}
$trunk = split("-", $call['callerChannel']);
//print_r($trunk);exit;
$info = $info . ' channel: ' . $trunk[0];
// get trunk info
$mytrunk = astercrm::getTrunkinfo($trunk[0], $call['didnumber']);
if ($mytrunk) {
$infomsg = "<strong>" . $mytrunk['trunkname'] . "</strong><br>";
$infomsg .= astercrm::db2html($mytrunk['trunknote']);
$objResponse->addAssign('divTrunkinfo', "innerHTML", $infomsg);
$objResponse->addAssign('trunkinfo_number', "innerHTML", $mytrunk['trunk_number']);
} else {
$infomsg = $locate->Translate("no information get for trunk") . ": " . $trunk[0];
$objResponse->addAssign('divTrunkinfo', "innerHTML", $infomsg);
$objResponse->addAssign('trunkinfo_number', "innerHTML");
}
$objResponse->addAssign('trunkinfoStatus', "value", '1');
if ($config['system']['enable_sms'] == 'callerid' && $myValue['callerid'] != '') {
$objResponse->addScript('xajax_SendSmsForm("callerid",' . $myValue['callerid'] . ')');
} else {
if ($config['system']['enable_sms'] == 'trunk_number' && $mytrunk['trunk_number'] != '') {
$objResponse->addScript('xajax_SendSmsForm("trunk_number",' . $mytrunk['trunk_number'] . ')');
} else {
if ($config['system']['enable_sms'] == 'campaign_number' && $result['campaignid'] != '') {
$objResponse->addScript('xajax_SendSmsForm("campaign_number",' . $result['campaignid'] . ')');
}
}
}
}
if ($myValue['callResultStatus'] != '2') {
$result = asterCrm::checkDialedlistCall($myValue['callerid']);
//print_r($result);exit;
$dialedlistid = $result['id'];
//$dialedlistid =
$campaign_id = $result['campaignid'];
if ($campaign_id != '') {
$objResponse->addAssign("dndlist_campaignid", "value", $campaign_id);
} else {
$objResponse->addAssign("dndlist_campaignid", "value", "0");
}
if ($dialedlistid) {
$divCallresult = Customer::getCampaignResultHtml($dialedlistid, 'ANSWERED');
//echo $divCallresult;exit;
$objResponse->addAssign("divCallresult", "style.display", "");
$objResponse->addAssign("divCallresult", "innerHTML", $divCallresult);
$objResponse->addAssign("dialedlistid", "value", $dialedlistid);
} else {
$objResponse->addAssign("dialedlistid", "value", 0);
}
$objResponse->addAssign("callResultStatus", "value", '2');
}
if ($myValue['extensionStatus'] == 'link') {
//already get link event
return $objResponse;
}
// if ($call['callerChannel'] == '' or $call['calleeChannel'] == '')
// return $objResponse;
$status = "link";
if ($call['hold']['number'] != '') {
//print_r($myValue);exit;
$curcallerid = $call['consultnum'];
$objResponse->addAssign("divHolding", "innerHTML", '<a href="###" onclick="getContact(' . $call['hold']['number'] . ');">[' . $call['hold']['number'] . ']</a> <a onclick="xajax_turnback(\'' . $call['hold']['channel'] . '\',\'' . $myValue['callerChannel'] . '\');return false;" href="###"><font size="2px">' . $locate->Translate("Turn back") . '</font></a> <a onclick="xajax_attendtransfer(\'' . $call['hold']['channel'] . '\',\'' . $myValue['calleeChannel'] . '\');return false;" href="###"><font size="2px">' . $locate->Translate("Transfer") . '</font></a> ');
//<a onclick="xajax_holdhangup(\''.$call['hold']['channel'].'\');return false;" href="###"><font size="2px">'.$locate->Translate("Hangup").'</font></a>
} else {
$curcallerid = $myValue['callerid'];
$objResponse->addAssign("divHolding", "innerHTML", '');
}
#print_r($myValue);exit;
if (!empty($call['srcname']) && $call['srcname'] != 'unknown' && $call['srcname'] != '<unknown>') {
$info = $locate->Translate("talking_to") . $curcallerid . ' (' . $call['srcname'] . ') ';
} else {
$info = $locate->Translate("talking_to") . $curcallerid;
}
if ($call['queue'] != '') {
//.........这里部分代码省略.........
示例2: waitingCalls
function waitingCalls($myValue)
{
global $db, $config;
$locate = new Localization($_SESSION['curuser']['country'], $_SESSION['curuser']['language'], 'portal');
$objResponse = new xajaxResponse();
$curid = trim($myValue['curid']);
// to improve system efficiency
/**************************
**************************/
// modified 2007/10/30 by solo
// start
//print_r($_SESSION);exit;
//if ($_SESSION['curuser']['channel'] == '')
$call = asterEvent::checkNewCall($curid, $_SESSION['curuser']['extension'], $_SESSION['curuser']['channel'], $_SESSION['curuser']['agent']);
//else
// $call = asterEvent::checkNewCall($curid,$_SESSION['curuser']['channel']);
// end
if ($call['status'] == '') {
$title = $locate->Translate("waiting");
$status = 'idle';
//$call['curid'] = $curid;
$direction = '';
$info = $locate->Translate("extension") . $_SESSION['curuser']['extension'] . "-" . $locate->Translate("stand_by");
} elseif ($call['status'] == 'incoming') {
//incoming calls here
$title = $call['callerid'];
$stauts = 'ringing';
$direction = 'in';
$info = $locate->Translate("incoming") . ' ' . $call['callerid'];
$trunk = split("-", $call['callerChannel']);
//print_r($trunk);exit;
$trunk_name = split('@', $trunk[0]);
$info = $info . ' channel: ' . $trunk_name[0];
// get trunk info
$mytrunk = astercrm::getTrunkinfo($trunk[0], $call['didnumber']);
if ($mytrunk) {
$infomsg = "<strong>" . $mytrunk['trunkname'] . "</strong><br>";
$infomsg .= mb_substr(astercrm::db2html($mytrunk['trunknote']), 0, 10, "UTF-8") . '...';
if ($call['didnumber'] != '') {
$infomsg .= " |" . $locate->Translate("Callee id") . " : <b>" . $call['didnumber'] . "</b>";
}
$objResponse->addAssign('divTrunkinfo', "innerHTML", $infomsg);
} else {
$trunk_name = split('@', $trunk[0]);
$infomsg = $locate->Translate("no information get for trunk") . ": " . $trunk_name[0];
$objResponse->addAssign('divTrunkinfo', "innerHTML", $infomsg);
}
$objResponse->addAssign("iptSrcNumber", "value", $call['callerid']);
$objResponse->addAssign("iptCallerid", "value", $call['callerid']);
$objResponse->addAssign("btnHangup", "disabled", false);
if ($config['system']['pop_up_when_dial_in']) {
if (strlen($call['callerid']) > $config['system']['phone_number_length'] && $call['callerid'] != '<unknown>') {
if ($myValue['popup'] == 'yes') {
if ($config['system']['enable_external_crm'] == false) {
$objResponse->loadXML(getContact($call['callerid']));
if ($config['system']['browser_maximize_when_pop_up'] == true) {
$objResponse->addScript('maximizeWin();');
}
} else {
//use external link
$myurl = $config['system']['external_crm_url'];
$myurl = preg_replace("/\\%method/", "dial_in", $myurl);
$myurl = preg_replace("/\\%callerid/", $call['callerid'], $myurl);
$myurl = preg_replace("/\\%calleeid/", $_SESSION['curuser']['extension'], $myurl);
if ($config['system']['open_new_window'] == false) {
$mycrm = '<iframe id="mycrm" name="mycrm" src="' . $myurl . '" width="100%" frameBorder=0 scrolling=auto height="100%"></iframe>';
$objResponse->addAssign("divCrm", "innerHTML", $mycrm);
} else {
$javascript = "openwindow('" . $myurl . "')";
$objResponse->addScript($javascript);
}
}
}
} else {
}
}
} elseif ($call['status'] == 'dialout') {
//dailing out here
$title = $call['callerid'];
$status = 'dialing';
$direction = 'out';
$info = $locate->Translate("dial_out") . ' ' . $call['callerid'];
$objResponse->addAssign("iptCallerid", "value", $call['callerid']);
$objResponse->addAssign("btnHangup", "disabled", false);
if ($call['didnumber'] != '') {
$didinfo = $locate->Translate("Callee id") . " : " . $call['didnumber'];
$objResponse->addAssign('divDIDinfo', 'innerHTML', $didinfo);
}
if ($config['system']['pop_up_when_dial_out']) {
if (strlen($call['callerid']) > $config['system']['phone_number_length']) {
if ($myValue['popup'] == 'yes') {
if ($config['system']['enable_external_crm'] == false) {
$objResponse->loadXML(getContact($call['callerid']));
if ($config['system']['browser_maximize_when_pop_up'] == true) {
$objResponse->addScript('maximizeWin();');
}
} else {
//use external link
$myurl = $config['system']['external_crm_url'];
$myurl = preg_replace("/\\%method/", "dial_out", $myurl);
//.........这里部分代码省略.........