Auto Answer on Conference action button
-
-
-
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,
-
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";};
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