rhartmann

Member

Last active 11 months ago

  1. 11 months ago
    Thu May 10 17:09:31 2018
    rhartmann started the conversation showLines.

    I noticed in the newest version of FOP2 that the
    ShowLines has been moved out of the js/presence.js file and is moved to the manager gui

    Is there ANY way to add this into the button config file? we are running a vanilla asterisk and need to figure a way manipulate this on a Context by Context basis

    example http://1.1.1.1/fop2?context=tenant1 wants to have 1 showLines
    whereas http://1.1.1.1/fop2?context=tenant2 wants to have 3 showLines

    ~ron

  2. last year
    Fri Jan 26 14:20:54 2018
    rhartmann started the conversation FOP2Callbacks.pm multiple servers.

    We have FOP2 connected to multiple asterisk manager interfaces
    Is there a way that we can use the FOP2Callbacks.pm and when it sees an event on Server 1, that we can instruct it to send an action to Server 2

    Example:

    A user logs into a queue on Server 1 and we want to issue a DevState command to server 2

    Here is an example FOP2Callbacks.pm which works perfectly when we have a single server.
    The user logs into a queue and we set the DevState on the server.

    What I need to do now is

    1. see the user logged into the queue
    2. determine which server saw the event
    3. send the DEVSTATE action to the other server

    here is an example of my FOP2Callback.pm

    sub amiCommand {
    
        # Received an event from Asterisk Manager Interface
    
        $command  = shift;
    
    #We see this come in on the AMI
    #How do we know which server this came from?
    #is there a variable that tells us the Asterisk Server that the AMI event came in on
    
        if( ($command eq "QueueMemberAdded") {
    
            %event = @_;
            my $return = "";
            my @allreturn = ();
    
                my $tiempo = time();
                $tiempo = $tiempo + 30;
                my $uniid  = $event{Uniqueid};
                my $queue  = $event{Queue};
                my $member  = $event{Location};
            
               #Can we define which SERVER to send this ACTION to
               #For example if this ABOVE "QueueMemberAdded" came from server A we want to post the following ACTION to SERVER B
               #How do we instruct the system to send the Action to a specific server
    
                $return = "Action: DevState\r\n";
                $return .= "DevState: ".$member.$queue."\r\n";
                $return .= "Value: 2\r\n";
                $return .= "\r\n";
    
                push @allreturn, $return;
                return @allreturn;
            }

    Thanks for any insight.

    ~ron

  3. 2 years ago
    Mon Nov 28 21:02:25 2016
    rhartmann started the conversation browser plugin 1.0.3 arguments.

    Does anyone know of a way to pass the user id (the user name that was used to login to fop2) as an option on the initial URL as defined in the browser.ini.

    Something like

    initial_url = "https://MYSERVER/dashboard.php?user=1234"

    where 1234 is who is logged into the fop2

    If this is not possible, is there a place in the browser.js where a lookup could be performed to determine the logged in user and append it to the initial_url

    ~ron

  4. Tue Nov 22 18:07:53 2016
    rhartmann started the conversation checkdir.php.

    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

  5. Mon Nov 21 17:44:23 2016
    rhartmann posted in PopUp on Connect.

    Basically I am trying to see what even block FOP is using to gather the Variables that it sends to the browser.

    I have Found AgentConnect, but I suspect that there are other blocks.

    ~ron

  6. Fri Nov 18 21:07:11 2016
    rhartmann started the conversation PopUp on Connect.

    I have the Popup working for Agents when they are connected to a call.

    I am trying to figure out why I am not able to see the #{EXTEN} or #{HOLDTIME} variables.

    My Popup URL is

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

    My Output is for $_GET variables is

    Array
    (
        [callerid] => 18885551212
        [callername] => Nurse:Walton      
        [UNIQUEID] => 1479501189.1594
        [QUEUE] => Nurse 302
        [AGENT] => undefined
        [HOLD] => undefined
    )

    Can anyone provide me what Debug level i should use and what to search for so i can see what variables are available to be sent to the POPup

    ~ron

  7. Fri Nov 18 18:49:31 2016
    rhartmann posted in browser-1.0.3 plugin.

    Just like you stated :-)

    Added the permissions and all is well and functional.

    THX

  8. Thu Nov 17 01:09:17 2016
    rhartmann started the conversation browser-1.0.3 plugin.

    I am trying to get the browser plugin to show up on my panel (I have left everything defaulted except the browser.ini

    The other plugins are working as expected busycounter, queuecounter :-) I just see nothing regarding browser plugin

    I have added the plugin definition like all my other plugins to the fop2.cfg

    plugin=browser:/var/www/html/fop2/admin/plugins/browser

    I have the permission in the user settings

    user=1001:1234:dial,hangupself,transfer,voicemail,preferences::browser,busycounter,queuecounter

    browser.ini

    initial_url = "http://help.websiteos.com/websiteos/example_of_a_simple_html_page.htm"
    show_controls = 1

    My understanding is that when user 1001 logs in they would see a mini browser embedded into the operator panel and it would have displayed the webpage http://help.websiteos.com/websiteos/example_of_a_simple_html_page.htm

    Im wondering if the mini browser is only visible if there is some sort of pop sent to the panel.

    Anyone who can tell me what to look for in the "fop2_server -X 55" or higher debug if needed, I would be most appreciative.

    ~ron

  9. Tue Nov 15 19:13:51 2016
    rhartmann started the conversation FOP2Callbacks.pm Event Handling.

    I am looking to see if there is a way to take two actions based on seeing a single event

    Example when i see EVENT QUEUEMEMBERPAUSED, I would like to update some filed in the AstDB and update a device State

    sub amiCommand {
    
        # Received an event from Asterisk Manager Interfase
    
        $command  = shift;
    
    	if($command eq "QUEUEMEMBERPAUSED") {
    
                    %event = @_;
                     my $return = "";
                    my @allreturn = ();
    
                    my $tiempo = time();
                    $tiempo = $tiempo + 30;
                    my $uniid  = $event{Uniqueid};
                    my $queue  = $event{Queue};
                    my $reason  = $event{Reason};
                    my $paused  = $event{Paused};
                    my $member  = $event{Location};
                          
    
                    $return  = "Action: Command\r\n";
    		$return .= "Command: database put some stuff here\r\n";
    		$return .= "\r\n";
    
    	#### I have a need to perform a second manager command IS THERE A WAY push two commands 
                
    	#                $return2 = "Action: DevState\r\n";
    	#                $return2 .= "DevState: "BLINKING-LIGHT"\r\n";
    	#                $return2 .= "Value: 6\r\n";
    	#                $return2 .= "\r\n";
    
    
    		#### SEND OUT THE COMMAND DATABASE NOTE: THIS WORKS GREAT and DB is updated
    		push @allreturn, $return;
                    return @allreturn;
    	}
    }

    NOTE: i can accomplish the tasks (one or the other) when the Event is found, but can not seam to figure a way to push two manager commands for a single event.

    Thanks for your assistance, and any ideas how to work around this if it is not possible directly in the FOP2Callbacks.pm

  10. Tue Nov 8 22:38:23 2016
    rhartmann started the conversation Popups for each device.

    when a new call "Rings" in i get a popup on the display for each device that is tied to my extension
    Example When you call 2004 it will issue a dial

    SIP/8801&SIP4407&SIP1475

    All three of these phones ring upon receipt of a new call.

    This allows me to be able to answer the calls to my extension no mater where in the office i am working at that moment (warehouse desk, office desk, mobile softphone).

    The problem that is presented is each one of these results in a Popup on Ringing I only need to have a single pop up not 3 of them

    Is there a way to interupt the code that performs the popup so that it will show only a single popup no mater which of the Channels are ringing

    my button looks like this

    [SIP/8801]
    Label=Ronald Hartmann
    Extension=2004
    Context=internal-calls
    type=extension
    group=engineering
    channel=SIP/4407
    channel=SIP/1475

    What I am looking for is a single popup whenever extension 2004 has a call coming in.

    Any guidance is appreciated.

View more