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
-
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login