Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

FOP2 Community Forum

  1. Home
  2. Support
  3. FOP2Callbacks.pm multiple servers

FOP2Callbacks.pm multiple servers

Scheduled Pinned Locked Moved Support
1 Posts 1 Posters 99 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R
    R
    rhartmann
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0

    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
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    Powered by NodeBB Contributors
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups