I'm trying to set FOP2 up so that only when a call is picked up, it'll open a certain web page. Currently the contents of the file are as follows:
<?php
require_once('config.php');
function custom_popup($ALLVAR) {
$clidnum = $ALLVAR['clidnum'];
$clidname = $ALLVAR['clidname'];
$fromqueue = $ALLVAR['fromqueue'];
$exten = $ALLVAR['exten'];
$poptype = $ALLVAR['poptype'];
$clidname = base64_decode($ALLVAR['clidname']);
$clidnum = base64_decode($ALLVAR['clidnum']);
header("Content-type: text/javascript");
echo "window.open('http://OurSugarCrmServer/crm/AsteriskSugDir.php?&search=$clidnum');\n";
return 0; // We still want regular notifications
}
$ret = custom_popup($_GET);
exit;
Header( "X-JSON: ({ 'clidnum': '$clidnum', 'clidname': '$clidname', 'picture': '$picture', 'queue': '$fromqueue' })");
?>
I'm no PHP coder, so I don't really know what to do at this point. I've tried changing the "If" section that was there from
if($ALLVAR['poptype']=="ringing") {
to
if($ALLVAR['poptype']=="answered") {
Of course it wasn't that easy. :roll:
So instead I just got rid of that statement and created this line to help me figure out what other 'poptype' values there were:
echo "window.open('http://$poptype');\n";
That didn't do anything for me.
I'm thinking I'll have to go further up the code tree to find whatever activates the checkdir.php file and set it to only use it when the call is answered instead of when it's ringing. I'm thinking that'll be the swf on the client though... Any Ideas?
Thanks!
--AkkerKid