<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[FOP2Callbacks.pm multiple servers]]></title><description><![CDATA[<p dir="auto">We have FOP2 connected to multiple asterisk manager interfaces<br />
Is there a way that we can use the <a href="http://FOP2Callbacks.pm" rel="nofollow ugc">FOP2Callbacks.pm</a> and when it sees an event on Server 1, that we can instruct it to send an action to Server 2</p>
<p dir="auto">Example:</p>
<blockquote>
<p dir="auto">A user logs into a queue on Server 1 and we want to issue a DevState command to server 2</p>
</blockquote>
<p dir="auto">Here is an example <a href="http://FOP2Callbacks.pm" rel="nofollow ugc">FOP2Callbacks.pm</a> which works perfectly when we have a single server.<br />
The user logs into a queue and we set the DevState on the server.</p>
<p dir="auto">What I need to do now is</p>
<ol>
<li>see the user logged into the queue</li>
<li>determine which server saw the event</li>
<li>send the DEVSTATE action to the other server</li>
</ol>
<p dir="auto">here is an example of my <a href="http://FOP2Callback.pm" rel="nofollow ugc">FOP2Callback.pm</a></p>
<pre><code>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;
        }
</code></pre>
<p dir="auto">Thanks for any insight.</p>
<p dir="auto">~ron</p>
]]></description><link>http://localhost:4567/topic/2621/fop2callbacks.pm-multiple-servers</link><generator>RSS for Node</generator><lastBuildDate>Tue, 27 Oct 2026 16:38:08 GMT</lastBuildDate><atom:link href="http://localhost:4567/topic/2621.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 26 Jan 2018 14:20:54 GMT</pubDate><ttl>60</ttl></channel></rss>