Changeset 46

Show
Ignore:
Timestamp:
06/21/07 19:01:52 (1 year ago)
Author:
root
Message:

Add Monitoring to FOP actions by single clicking on the arrow

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/ming-source/comunicator.pl

    r4 r46  
    140140                                _global.restrict = numeroboton; 
    141141                _global.mybutton = numeroboton; 
    142                                 var myresa = eval('_root.resaltado'+_global.restrict); 
    143                                 myresa._visible = true; 
    144                                 return; 
    145142                        } 
    146143 
     
    155152 
    156153                        if (_root.context == boton_contexto) { 
    157                                 colaEvento(boton_numero,comando,textofinal); 
     154                                if(_global.restrict != undefined) { 
     155                                        if(_global.restrict == boton_numero) { 
     156                                                colaEvento(boton_numero,comando,textofinal); 
     157                                        } 
     158                                } else { 
     159                                        colaEvento(boton_numero,comando,textofinal); 
     160                                } 
    158161                        } 
    159162                        // endif root.context 
  • trunk/ming-source/operator_panel.pl

    r43 r46  
    94059405                // Un solo click 
    94069406                if (clip._name.substring(0, 7) != "casilla") { 
    9407                         if (_global.meetmemember[numeroclip]>0) { 
    9408                                 if (_global.authorized == true) { 
     9407                        if (_global.authorized == true) { 
     9408                                if (_root.context.length>0) { 
     9409                                     boton_numero_con_contexto = numeroclip+"@"+context; 
     9410                                } else { 
     9411                                     boton_numero_con_contexto = numeroclip; 
     9412                                } 
     9413                                if (_global.meetmemember[numeroclip]>0) { 
    94099414                                        var statusclid = eval("rectangulo"+numeroclip+".statusprint"+numeroclip); 
    9410                                         if (_root.context.length>0) { 
    9411                                         boton_numero_con_contexto = numeroclip+"@"+context; 
    9412                                     } else { 
    9413                                         boton_numero_con_contexto = numeroclip; 
    9414                                         } 
    94159415                                        if (_global.meetmemute[numeroclip]>0) { 
    94169416                                                logea("envio meetmemute"); 
     
    94259425                                        } 
    94269426                                } else { 
    9427                                         // Not authorized 
    9428                                         envia_comando("bogus", 0, 0); 
    9429                                         logea("no esta autorizado"); 
    9430                                 } 
     9427                                        logea("no es meetmemember, empiezo record"); 
     9428                                        envia_comando("startmonitor",numeroclip,numeroclip); 
     9429                                }  
    94319430                        } else { 
    9432                                 logea("no es meetmemember"); 
    9433                         }  
     9431                                // Not authorized 
     9432                                envia_comando("bogus", 0, 0); 
     9433                                logea("no esta autorizado");                             
     9434                        } 
    94349435                } else { 
    9435                         logea("single click en led no hace nada"); 
     9436                        logea("single click en led no hace nada "+clip._name); 
    94369437                } 
    94379438        } 
  • trunk/op_server.cfg

    r43 r46  
    230230;attendant_failure_redirect_to = 6${EXTEN}@${CONTEXT} 
    231231 
     232; It is possible to start monitoring a conversation 
     233; by single clicking on the arrow for a button 
     234; FOP will use a filename and format based on the 
     235; following two paramters: 
     236 
     237;monitor_filename = FOP-${CLIDNUM}-${LINK}-${UNIQUEID} 
     238;monitor_format = gsm 
     239 
     240 
    232241; You can have panel contexts with their own 
    233242; button layout and configuration. The following entry 
  • trunk/op_server.pl

    r45 r46  
    3838my %datos          = (); 
    3939my %chanvar        = (); 
     40my %monitoring     = (); 
    4041my %passvar        = (); 
    4142my %sesbot         = (); 
     
    570571    } 
    571572 
     573    if ( !defined $config->{GENERAL}{monitor_filename} ) { 
     574        $config->{GENERAL}{monitor_filename} = "\${UNIQUEID}"; 
     575    } 
     576 
     577    if ( !defined $config->{GENERAL}{monitor_format} ) { 
     578        $config->{GENERAL}{monitor_format} = "wav"; 
     579    } 
     580 
    572581    if ( !defined $clid_privacy ) { 
    573582        $clid_privacy = 0; 
     
    20702079    log_debug( "$heading borro cache_hit($indice_cache)", 128 ) if DEBUG; 
    20712080    delete $cache_hit{$indice_cache}; 
     2081    delete $monitoring{$canalsesion}; 
    20722082    if ( keys(%cache_hit) ) { 
    20732083        for ( keys %cache_hit ) { 
     
    28912901    elsif ( $evento =~ /^OriginateFailure$/ )          { $evento = "originatefailure"; } 
    28922902    elsif ( $evento =~ /^ChannelReload$/ )             { $evento = "channelreload"; } 
     2903    elsif ( $evento =~ /^response-/ )                  { $evento = "monitor"; } 
    28932904    else { log_debug( "$heading No event match ($evento)", 32 ); } 
    28942905 
     
    29092920    } 
    29102921 
    2911     if ( $evento eq "channelreload" ) { 
     2922    if ( $evento eq "monitor" ) { 
     2923        my $botinro = ""; 
     2924        ( undef, $estado_final, undef ) = split( /-/, $hash_temporal{ActionID}, 3 ); 
     2925        ( $canal, undef ) = separate_session_from_channel( $hash_temporal{Channel} ); 
     2926        $canalid = $hash_temporal{Channel}; 
     2927        $estado_final =~ tr/A-Z/a-z/; 
     2928    } 
     2929    elsif ( $evento eq "channelreload" ) { 
    29122930 
    29132931        # Event: ChannelReload 
     
    49404958        $parked{"$server^$hash_temporal{'Channel'}"} = $parksl; 
    49414959        $evento = "";    #NEW 
    4942         print "park PARK/$parksl|park|[$textid]$timeout|$hash_temporal{'Timeout'}-$server|$hash_temporal{'Channel'}\n"; 
    49434960    } 
    49444961    elsif ( $evento eq "newcallerid" ) { 
     
    49664983 
    49674984    if ( $evento ne "" ) { 
    4968         log_debug( "$heading Event $evento, canal '$canal'", 32 ) if DEBUG; 
     4985        log_debug( "$heading Event $evento, canal '$canal', estadofinal $estado_final", 32 ) if DEBUG; 
    49694986 
    49704987        # De acuerdo a los datos de la extension genera 
     
    66896706                                        || $bloque_final =~ /Message: Mailbox/ 
    66906707                                        || $bloque_final =~ /SIP-CanReinvite/ 
     6708                                        || $bloque_final =~ /ActionID: monitor-/ 
    66916709                                        || $bloque_final =~ /Message: Timeout/ ) 
    66926710                                    { 
     
    66996717                                                $block_count++; 
    67006718                                                $bloque[$block_count]{Event} = "sippeerentrylong"; 
     6719                                            } 
     6720                                            elsif ( $p =~ /ActionID: monitor-/ ) { 
     6721                                                my ( undef, $quemonitor, $quecana ) = split( /-/, $p, 3 ); 
     6722                                                $block_count++; 
     6723                                                $bloque[$block_count]{Event}   = "response-$quemonitor"; 
     6724                                                $bloque[$block_count]{Channel} = $quecana; 
    67016725                                            } 
    67026726                                            my $my_event = ""; 
     
    68536877    my $res   = syswrite( $socket, $encriptadofinal, $largo ); 
    68546878 
    6855     select(undef, undef, undef, 0.0.1); 
     6879    select( undef, undef, undef, 0.01 ); 
    68566880 
    68576881    if ( defined $res && $res > 0 ) { 
     
    73067330                    ($destino) = split( /\&/, $destino ); 
    73077331                    log_debug( "$heading El boton de destino es $destino en el server $destin_server", 64 ) if DEBUG; 
    7308                     print("$heading El boton de destino es $destino en el server $destin_server\n"); 
    73097332                } 
    73107333            } 
     
    74127435            } 
    74137436 
    7414             if ( $accion eq "cortar" ) { 
     7437            if ( $accion =~ /^startmonitor/ ) { 
     7438                my $buton_number = $datosflash; 
     7439                foreach my $ses ( @{ $sesbot{$buton_number} } ) { 
     7440                    my $monaction   = ""; 
     7441                    my $extracomand = ""; 
     7442                    if ( !defined( $monitoring{$ses} ) ) { 
     7443                        log_debug( "$heading START MONITOR $ses -- ($origin_server $origin_channel)", 1 ); 
     7444                        my $unique = find_uniqueid( $ses, $origin_server ); 
     7445                        my ( $filename, $format ) = compute_monitoring_filename( $unique, $panelcontext ); 
     7446                        $monaction = "Monitor"; 
     7447                        $monitoring{$ses} = 1; 
     7448                        $extracomand .= "File: $filename\r\n"; 
     7449                        $extracomand .= "Format: $format\r\n"; 
     7450                        $extracomand .= "Mix: 1\r\n"; 
     7451                    } 
     7452                    else { 
     7453                        log_debug( "$heading STOP MONITOR $ses", 1 ); 
     7454                        $monaction = "StopMonitor"; 
     7455                        delete $monitoring{$ses}; 
     7456                    } 
     7457                    $comando = "Action: $monaction\r\n"; 
     7458                    $comando .= "Channel: $ses\r\n"; 
     7459                    $comando .= "ActionID: monitor-$monaction-$ses\r\n"; 
     7460                    $comando .= $extracomand . "\r\n"; 
     7461                    send_command_to_manager( $comando, $p[ $button_server{$datosflash} ], 
     7462                        0, $astmanproxy_servers[ $button_server{$datosflash} ] ); 
     7463                } 
     7464            } 
     7465            elsif ( $accion eq "cortar" ) { 
    74157466                my $buton_number = $datosflash; 
    74167467                log_debug( "$heading Will try to hangup channel para el boton $buton_number", 16 ) if DEBUG; 
     
    77137764    } 
    77147765    $tab = substr( $tab, 0, -1 ) if DEBUG; 
     7766} 
     7767 
     7768sub compute_monitoring_filename { 
     7769    my $unique       = shift; 
     7770    my $panelcontext = shift; 
     7771    my $filename     = ""; 
     7772    my $format       = ""; 
     7773    my @return; 
     7774    my %hasha; 
     7775 
     7776    if ( !defined( $config->{$panelcontext}{monitor_filename} ) ) { 
     7777        $filename = $config->{GENERAL}{monitor_filename}; 
     7778    } 
     7779    else { 
     7780        $filename = $config->{$panelcontext}{monitor_filename}; 
     7781    } 
     7782    if ( !defined( $config->{$panelcontext}{monitor_format} ) ) { 
     7783        $format = $config->{GENERAL}{monitor_format}; 
     7784    } 
     7785    else { 
     7786        $format = $config->{$panelcontext}{monitor_format}; 
     7787    } 
     7788 
     7789    while ( my ( $key, $val ) = each( %{ $datos{$unique} } ) ) { 
     7790        $key =~ tr/a-z/A-Z/; 
     7791        if ( $key eq "CALLERID" ) { 
     7792            $key = "CLID"; 
     7793        } 
     7794        elsif ( $key eq "CALLERIDNUM" ) { 
     7795            $key = "CLIDNUM"; 
     7796        } 
     7797        elsif ( $key eq "CALLERIDNAME" ) { 
     7798            $key = "CLIDNAME"; 
     7799        } 
     7800        elsif ( $key eq "UNIQUEID" ) { 
     7801            my ( $realunique, undef ) = split( /-/, $val, 2 ); 
     7802            $val = $realunique; 
     7803        } 
     7804        $hasha{$key} = $val; 
     7805    } 
     7806    $filename =~ s/\${CLIDNAME}/$hasha{CLIDNAME}/gi; 
     7807    $filename =~ s/\${CLIDNUM}/$hasha{CLIDNUM}/gi; 
     7808    $filename =~ s/\${CLID}/$hasha{CLID}/gi; 
     7809    $filename =~ s/\${UNIQUEID}/$hasha{UNIQUEID}/gi; 
     7810    $filename =~ s/\${CHANNEL}/$hasha{CHANNEL}/gi; 
     7811    $filename =~ s/\${LINK}/$hasha{LINK}/gi; 
     7812    $filename =~ s/\//-/gi; 
     7813    push @return, $filename; 
     7814    push @return, $format; 
     7815    return @return; 
    77157816} 
    77167817 
     
    79648065            for $interno ( keys %botonpermanenttext ) { 
    79658066                if ( $botonpermanenttext{$interno} ne "" ) { 
    7966                     print "permanente $interno -$botonpermanenttext{$interno}-\n"; 
    79678067                    send_status_to_flash( $socket, "$interno|settext|$botonpermanenttext{$interno}", 0 ); 
    79688068                } 
     
    85648664                    $match++; 
    85658665                } 
    8566                 if ( $key eq "Server" && $val eq $server ) { 
     8666                if ( $key eq "Server" && ( $val eq $server || $server eq "-1" ) ) { 
    85678667                    $match++; 
    85688668                }