This is a great hack! Thank you!
A variation of this code I've put below might be easier. No modification of any existing code, you just use these 2 lines for each agent you want to change and repeat it for each additional agent.
if ($agent ['agentchannel'] == "SIP/1001")
$agent ['agentchannel'] = "John Smith";
Find this code in the file /var/www/html/modules/campaign_monitoring/index.php
function formatoAgente($agent)
{
$sEtiquetaStatus = _tr($agent['status']);
$sFechaHoy = date('Y-m-d');
$sDesde = '-';
switch ($agent['status']) {
case 'paused':
// Prioridad de pausa: hold, break, agendada
if ($agent['onhold']) {
$sEtiquetaStatus = _tr('Hold');
// TODO: desde cuándo está en hold?
} elseif (!is_null($agent['pauseinfo'])) {
$sDesde = $agent['pauseinfo']['pausestart'];
$sEtiquetaStatus .= ': '.$agent['pauseinfo']['pausename'];
}
// TODO: exponer pausa de agendamiento
break;
case 'oncall':
$sDesde = $agent['callinfo']['linkstart'];
break;
}
if (strpos($sDesde, $sFechaHoy) === 0)
$sDesde = substr($sDesde, strlen($sFechaHoy) + 1);
return array(
'agent' => $agent['agentchannel'],
'status' => $sEtiquetaStatus,
'callnumber' => is_null($agent['callinfo']['callnumber']) ? '-' : $agent['callinfo']['callnumber'],
'trunk' => is_null($agent['callinfo']['trunk']) ? '-' : $agent['callinfo']['trunk'],
'desde' => $sDesde,
);
Now insert the 'fix' above the "return array(" section below
EXAMPLE:
if (strpos($sDesde, $sFechaHoy) === 0)
$sDesde = substr($sDesde, strlen($sFechaHoy) + 1);
if ($agent ['agentchannel'] == "SIP/1001")
$agent ['agentchannel'] = "John Smith";
return array(
'agent' => $agent['agentchannel'],
'status' => $sEtiquetaStatus,
'callnumber' => is_null($agent['callinfo']['callnumber']) ? '-' : $agent['callinfo']['callnumber'],
'trunk' => is_null($agent['callinfo']['trunk']) ? '-' : $agent['callinfo']['trunk'],
'desde' => $sDesde,
);
You can repeat the code for a more agents
if (strpos($sDesde, $sFechaHoy) === 0)
$sDesde = substr($sDesde, strlen($sFechaHoy) + 1);
if ($agent ['agentchannel'] == "SIP/1001")
$agent ['agentchannel'] = "John Smith";
if ($agent ['agentchannel'] == "SIP/1002")
$agent ['agentchannel'] = "Barb Dell";
if ($agent ['agentchannel'] == "SIP/1003")
$agent ['agentchannel'] = "Jane Doe";
if ($agent ['agentchannel'] == "SIP/1004")
$agent ['agentchannel'] = "Maria Jones";
return array(
'agent' => $agent['agentchannel'],
'status' => $sEtiquetaStatus,
'callnumber' => is_null($agent['callinfo']['callnumber']) ? '-' : $agent['callinfo']['callnumber'],
'trunk' => is_null($agent['callinfo']['trunk']) ? '-' : $agent['callinfo']['trunk'],
'desde' => $sDesde,
);
Looks like this:
https://imgur.com/a/5tjM65n