Variable BLINDTRANSFER is empty

  1. 8 years ago

    Does it exist an solution for this ?

    When we do an blind transfer from the phone, Asterisk set BLINDTRANSFER variable automaticly.
    But when we do an transfer from FOP2 panel, the BLINDTRANSFER variable was not set

    From : http://forum.fop2.com/3497-no-blindtransfer-set/0
    I have try to edit FOP2Callbacks.pm
    But after modification, FOP2 won't start

    From : http://forum.fop2.com/4165-fop2-la-variable-blindtransfer-llega-vac-a/0#p11614
    But don't seem to have solution ?

  2. admin

    20 Aug 2016 Administrator
    Edited 8 years ago by admin

    You can write a plugin or modify an existing plugin code and insert this into the server (.pl) side:

    $Client_Pre_Command_Handler{'sampleplugin'}{'blindxfer'} = 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 $activechannel  = main::get_active_chan($mychannel);
        my $bridgechannel  = main::get_active_link($mychannel);
    
        $return  = "Action: Setvar\r\n";
        $return .= "Channel: $bridgechannel\r\n";
        $return .= "Variable: BLINDTRANSFER\r\n";
        $return .= "Value: $activechannel\r\n";
        $return .= "\r\n";
    
        push @allreturn, $return;
    
        return @allreturn;
    }

    You will have to change 'sampleplugin' with the name of your own plugin or the plugin you are injecting this code to... This will intercept the blind transfer action and will get active and bridged channels and set the variable BLINDTRANSFER.

    Best regards,

  3. Where I put this Perl script ?

    Inside new file in directory /usr/local/fop2 ?
    Or inside new file in new directory in /var/www/html/fop2/admin/plugins ?

    I have try both, nothing seem to work, does I need to do something more to activate the script ?

    Thanks you

  4. admin

    22 Aug 2016 Administrator

    This function must be added to the .pl side of a plugin. You can either write a full plugin (look at the sampleplugin included in the fop2 tarball. Or you can look for any other plugin you might have already installed (in folder /var/www/html/fop2/admin/plugins/xxxx), and insert that block at the end of the xxxx.pl file, and replacing 'sampleplugin' string with the name of the plugin directory, so if you add it to the clock plugin in /var/www/html/fop2/admin/plugins/clock/clock.pl, then change sampleplugin to clock in the above source.

  5. Edited 8 years ago by secathor

    Thank you

    I read file /plugins/README from the tarball

    I have create folder /var/www/html/fop2/admin/plugins/myblindvalue
    Create file plugin.xml (used one from sample plugin)
    Create file myblindvalue.pl and copy your script with remplacing 'sampleplugin' by 'myblindvalue'

    Edit /usr/local/fop2/fop2.cfg, and add line
    plugin=myblindvalue:/var/www/html/fop2/admin/plugins/myblindvalue
    And add to my user
    user=119:password:all::myblindvalue

    I also add the clock plugin

    The clock work but the myblindvalue plugin won't work

    I have start FOP2 with all debug (/usr/local/fop2/fop2_server -X 511 -l /var/log/fop2)
    And if I search for "Setvar" in the log file. I only found line for variable PICKUPMARK

  6. admin

    23 Aug 2016 Administrator

    Are you using the FOP2 Manager for configuring users and stuff? If so, you should not need to add any plugin=xxx lines in fop2.cfg, nor modify user=xxx lines.

    Just asking, as having #exec in fop2.cfg (for FOP2 Manager), and manual entries won't work.

    If you *do* use the FOP2 Manager and have the #exec autoconfig_users.sh at the end, then remove the plugin=xx and user=xx entries you created and just log into the FOP2 Manager, select the Plugins tab, your new plugin should show, be sure to check the global checkbox if its not set. Then restart FOP2 and try again.

  7. I have removed all config files in /usr/local/fop2/ and copied default files from fop2 tarball
    I also put the perl script in "clock.pl" of the clock plugins (/var/www/html/fop2/admin/plugins/clock/) and use FOP2 Manager to enable clock

    Now, it's work !

or Sign Up to reply!