Auto Answer on Conference action button

  1. 8 years ago

    Any chance that you could enable auto answer via header when using the conference action button?
    It doesn't work there. "Call Pickup", "Pickup from Park" and "Queue "work fine now.

  2. Is this something you could add in a future release?
    Auto Answer already works on listen and listen/whisper, and I believe the conference action button is the same as listen/whisper, isn't it?

    Thank you for considering this.

  3. admin

    6 May 2016 Administrator

    Edit /var/www/html/fop2/admin/plugins/conferencebutton.pl and change this function:

    $Client_Post_Command_Handler{'conferencebutton'}{'customconference'} = sub {
        my @allreturn = ();
        my $origen   = shift;
        my $destino  = shift;
        my $contexto = shift;
        my $socket   = shift;
        my $mychannel = main::get_btn_config( "$contexto", $origen, 'MAINCHANNEL');
        my $extension_to_dial = $destino;
    
        if ( !main::hasPermChannel( $socket, "dial", $mychannel ) && !main::hasPerm( $socket, "all" ) ) {
            # No 'dial' permission, abort action
            print "No permissions for conference\n";
            return @allreturn;
        }
    
        my @orivariables;
        my $autoanswer         = main::get_btn_config( "$contexto", $origen, 'AUTOANSWER');
        my $autoanswer_header  = main::get_btn_config( "$contexto", $origen, 'AUTOANSWERHEADER');
        my $originate_variable = main::get_btn_config( "$contexto", $origen, 'ORIGINATEVARIABLES');
    
        if ( $autoanswer_header ne "" && $autoanswer == 1) {
            push @orivariables, $autoanswer_header;
        }
        if ( $originate_variable ne "" ) {
            push @orivariables, $originate_variable;
        }
    
        my $orivariable = join( ',', @orivariables );
    
        my $return  = "Action: Originate\r\n";
        $return .= "Channel: Local/$extension_to_dial\@from-internal\r\n";
        $return .= "Application: ChanSpy\r\n";
        $return .= "Data: $mychannel,BEq\r\n";
        $return .= "Variable: $orivariable\r\n";
        $return .= "\r\n";
        push @allreturn, $return;
        return @allreturn;
    };

    Then restart FOP2 and test it out.. if it works fine I will update the plugin and release a new version.

    Best regards,

  4. This is my /var/www/html/fop2/admin/plugins/conferencebutton/conferencebutton.pl now.
    Auto answer doesn't work.

    $Client_Post_Command_Handler{'conferencebutton'}{'customconference'} = sub {
    my @allreturn = ();
    my $origen = shift;
    my $destino = shift;
    my $contexto = shift;
    my $socket = shift;
    my $mychannel = main::get_btn_config( "$contexto", $origen, 'MAINCHANNEL');
    my $extension_to_dial = $destino;

    if ( !main::hasPermChannel( $socket, "dial", $mychannel ) && !main::hasPerm( $socket, "all" ) ) {
    # No 'dial' permission, abort action
    print "No permissions for conference\n";
    return @allreturn;
    }

    my @orivariables;
    my $autoanswer = main::get_btn_config( "$contexto", $origen, 'AUTOANSWER');
    my $autoanswer_header = main::get_btn_config( "$contexto", $origen, 'AUTOANSWERHEADER');
    my $originate_variable = main::get_btn_config( "$contexto", $origen, 'ORIGINATEVARIABLES');

    if ( $autoanswer_header ne "" && $autoanswer == 1) {
    push @orivariables, $autoanswer_header;
    }
    if ( $originate_variable ne "" ) {
    push @orivariables, $originate_variable;
    }

    my $orivariable = join( ',', @orivariables );

    my $return = "Action: Originate\r\n";
    $return .= "Channel: Local/$extension_to_dial\@from-internal\r\n";
    $return .= "Application: ChanSpy\r\n";
    $return .= "Data: $mychannel,BEq\r\n";
    $return .= "Variable: $orivariable\r\n";
    $return .= "\r\n";
    push @allreturn, $return;
    return @allreturn;
    };

    $Client_Pre_Command_Handler{'conferencebutton'}{'ping'} = sub {
    print "pong pong conferencebutton!\n";
    };

    $AMI_Event_Handler{'conferencebutton'}{'QUEUEMEMBER'} = sub {
    my $event = shift;

    #my @keys = keys %$event;
    #foreach my $key (@keys) {
    # print "$key = ".${$event}{$key}."\n";
    #}
    #print "\n";
    };

or Sign Up to reply!