It's still not working. I turned on "Event When Called:" and edited my checkdir.php to show the following:
<?php
require_once('config.php');
function custom_popup($ALLVAR) {
// For Asternic Tag Call
if($ALLVAR['poptype']=="onconnect") {
// RINGING NOTIFICATION
$clidnum = $ALLVAR['clidnum'];
$poptype = $ALLVAR['poptype'];
$clidnum = base64_decode($ALLVAR['clidnum']);
header("Content-type: text/javascript");
echo "window.open('http://OurSugarCrmServer/crm/AsteriskSugDir.php?&search=$clidnum');\n";
} else {}
return 0;
}
exit;
?>
The subtext of Event When Called is "When this option is set to YES, the following manager events will be generated: AgentCalled, AgentDump, AgentConnect and AgentComplete." So I also tried "AgentConnect" in the IF statement where "onconnect" is thinking maybe my Trixbox server uses non-standard outputs. That didn't work either. Also, when I make changes in this file, should I restart the server or will the changes take effect as soon as I save?