<?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 Event Handling]]></title><description><![CDATA[<p dir="auto">I am looking to see if there is a way to take two actions based on seeing a single event</p>
<p dir="auto">Example when i see EVENT QUEUEMEMBERPAUSED, I would like to update some filed in the AstDB and update a device State</p>
<pre><code>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;
	}
}
</code></pre>
<p dir="auto">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.</p>
<p dir="auto">Thanks for your assistance, and any ideas how to work around this if it is not possible directly in the <a href="http://FOP2Callbacks.pm" rel="nofollow ugc">FOP2Callbacks.pm</a></p>
]]></description><link>http://localhost:4567/topic/2395/fop2callbacks.pm-event-handling</link><generator>RSS for Node</generator><lastBuildDate>Tue, 27 Oct 2026 16:37:23 GMT</lastBuildDate><atom:link href="http://localhost:4567/topic/2395.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 15 Nov 2016 19:13:51 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to FOP2Callbacks.pm Event Handling on Tue, 15 Nov 2016 20:56:14 GMT]]></title><description><![CDATA[<pre><code># 1st command:

$return = "My command\r\n";
push @allreturn, $return;

# 2nd command:

$return = "Another command\r\n";
push @allreturn, $return;

# send back all to server:
return @allreturn;
</code></pre>
<p dir="auto">Best regards,</p>
]]></description><link>http://localhost:4567/post/10487</link><guid isPermaLink="true">http://localhost:4567/post/10487</guid><dc:creator><![CDATA[nicolas]]></dc:creator><pubDate>Tue, 15 Nov 2016 20:56:14 GMT</pubDate></item></channel></rss>