checkdir.php

  1. 7 years ago
    Edited 7 years ago by rhartmann

    I am having an issue getting the checkdir.php to pop up a window on connect.

    function custom_popup($ALLVAR) {
    
        // For Asternic Tag Call
        if($ALLVAR['poptype']=="ringing") {
    
            // RINGING NOTIFICATION
    
        } else {
    
            // AGENT CONNECT NOTIFICATION
    
            $clidnum   = $ALLVAR['clidnum'];
            $clidname  = $ALLVAR['clidname'];
            $fromqueue = $ALLVAR['fromqueue'];
            $exten     = $ALLVAR['exten'];
            $clidname = base64_decode($ALLVAR['clidname']);
            $clidnum  = base64_decode($ALLVAR['clidnum']);
            file_put_contents('/tmp/popup.txt', print_r($ALLVAR, true));
    
            header("Content-type: text/javascript");
            echo "window.open('http://192.168.1.1/popup.php?callerid=$clidnum&name=$clidname&queue=$fromqueue&agent=$exten')";
    
        }
    
        return 0;   // We do not want regular notifications
    }

    I am getting the debug contents in my /tmp/popup.txt

    Array
    (
        [poptype] => connect
        [clidnum] => MTUxMzMyODg0MzY=
        [clidname] => TnVyc2U6Q2VsbCBQaG9uZSAgIE9I
        [exten] => 2004
        [fromqueue] => Nurse 302
        [UNIQUEID] => 1479837388.2057
    )

    NOTE: [fromqueue] is showing the Queue's LABEL (as defined in the button config) , is there a way to get the Queue's Extension instead

    [QUEUE/302]
    type=queue
    Label=Nurse 302
    Extension=302
    context=from-support-srvcs

    NOTE: that the cidname and num have not been decoded as they are a print out from the $ALLVAR[] array

    I was hoping that this would pop up in my minibrowser plugin like when i add the popup url to the preferences section.

    http://192.168.1.1/popup.php?callerid=#{CLIDNUM}&callername=#{CLIDNAME}&UNIQUEID=#{UNIQUEID}&QUEUE=#{FROMQUEUE}&AGENT=#{EXTEN}

    I switched from adding the info in the fop panel preferences URL POPUP because I am unable to get the Extension number that took the call to be passed and i need to be able to pass that to my popup.php

    here is the output i am getting when using the popupurl in preferences
    Array
    (
    [callerid] => 18885551212
    [callername] => Nurse:Cell Phone OH
    [UNIQUEID] => 1479837733.2063
    [QUEUE] => Nurse 302
    [AGENT] => undefined
    )

    As you can see in this example there is no EXTEN variable getting saved.

    Not sure where to go from here debug wise.

    ~ron

  2. admin

    1 Dec 2016 Administrator

    Exten is passed only to checkdir.php, the next FOP2 release will pass it also to the configured url in preferences.

or Sign Up to reply!