Changeset 43

Show
Ignore:
Timestamp:
05/14/07 20:21:22 (2 years ago)
Author:
root
Message:

Add passvars parameter to op_server.cfg to pass extra values to popups

Files:

Legend:

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

    r24 r43  
    74127412                        }  
    74137413 
    7414                         // logea(numeroboton+"|"+comando+"|"+textofinal.substring(0,20)); 
     7414                        logea(numeroboton+"|"+comando+"|"+textofinal.substring(0,20)); 
    74157415 
    74167416                        var botonparte = numeroboton.split("@"); 
     
    77677767                                        //var clidname = base64_decode(textofinal); 
    77687768                                        _global.clidname[boton_numero]=textofinal; 
    7769                                         var clidname = base64_decode(textofinal); 
     7769                                        //var clidname = base64_decode(textofinal); 
     7770                                } 
     7771                                if (comando == "setvar") { 
     7772                                        if(_global.chanvars[boton_numero].length == undefined) { 
     7773                                                _global.chanvars[boton_numero] = new Array; 
     7774                                        } 
     7775                                         chanvars[boton_numero].push(textofinal); 
    77707776                                } 
    77717777         
     
    77987804                                                                c.clid      = _global.clidnumber[boton_numero]; 
    77997805                                                                c.clidname  = _global.clidname[boton_numero]; 
     7806 
     7807                                                                var a=-1; 
     7808                                                                while (++a < chanvars[boton_numero].length) { 
     7809                                                                        var datossplit = chanvars[boton_numero][a].split("="); 
     7810                                                                        var mivar = datossplit[0]; 
     7811                                                                        var mival = datossplit[1]; 
     7812                                                                        c[mivar]=mival; 
     7813                                                                } 
     7814                                                                chanvars[boton_numero]=""; 
    78007815                                                                c.send(url, target, 'GET'); 
    7801                                                                 logea("Open url "+url+" in target "+target+" with clid "+clidnumber); 
     7816                                                                logea("Open url "+url+" in target "+target+" with clid "+c.clid); 
    78027817                                                        } 
    78037818                                                } else { 
     
    86898704        _global.logwindow = 1; 
    86908705        _global.margenbar = 2; 
     8706        _global.chanvars = new Array(); 
    86918707        _global.loglines = new Array(); 
    86928708        _global.texto_tip = new Array(); 
  • trunk/op_server.cfg

    r36 r43  
    191191voicemail_extension = 3000@features 
    192192 
     193 
     194; Channel variables to be passed from origin channels to Ringing channels  
     195; Those variables will appear in the popup base64 encoded. A new event 
     196; will be generated to clients in the form:  
     197; "setvar" and data VARNAME=BASE64(value) 
     198passvars=FROM_DID 
     199 
     200 
    193201; Attendant transfers. If this parameters are uncomented, then 
    194202; barge in functionality will be replaced with attendant transfers 
  • trunk/op_server.pl

    r42 r43  
    3737my $FOP_VERSION    = "SVNVERSION"; 
    3838my %datos          = (); 
     39my %chanvar        = (); 
     40my %passvar        = (); 
    3941my %sesbot         = (); 
    4042my %linkbot        = (); 
     
    189191my $queue_hide; 
    190192my $enable_restart; 
     193my $passvars; 
    191194my $change_led; 
    192195my $cdial_nosecure; 
     
    484487    $enable_restart   = $config->{GENERAL}{enable_restart}; 
    485488    $defaultlanguage  = $config->{GENERAL}{language}; 
     489    $passvars         = $config->{GENERAL}{passvars}; 
    486490 
    487491    if ( $debuglevel == -1 ) { 
     
    21252129                        log_debug( "** Found a match $canalid=$val ($quehay) - Cleared!", 16 ) if DEBUG; 
    21262130                        delete $datos{$quehay}; 
     2131                        delete $chanvar{$quehay}; 
     2132                        delete $passvar{$quehay}; 
    21272133                    } 
    21282134                } 
     
    26622668    } 
    26632669 
     2670    if ( defined( $hash_temporal{Application} ) ) { 
     2671 
     2672        # Chanvar hash stores the complete list of channel variables 
     2673        # that are "SET" in the dialplan for a given Uniqueid 
     2674        if ( $hash_temporal{Application} eq "Set" ) { 
     2675            my @vardata = split( /\|/, $hash_temporal{AppData} ); 
     2676            foreach my $vara (@vardata) { 
     2677                my ( $vari, $valu ) = split( /=/, $vara ); 
     2678                $vari =~ s/^_.?//g; 
     2679                $chanvar{ $hash_temporal{Uniqueid} }{$vari} = $valu; 
     2680            } 
     2681        } 
     2682    } 
    26642683    if ( defined( $hash_temporal{Channel} ) ) { 
    26652684        if ( $hash_temporal{Channel} =~ /^Agent/ ) { 
     
    31903209        $remote_callerid_name{$key} = $hash_temporal{"CallerIDName"}; 
    31913210 
     3211        foreach my $var ( split( /\|/, $passvars ) ) { 
     3212            if ( defined( $chanvar{ $hash_temporal{"SrcUniqueID"} }{$var} ) ) { 
     3213                $passvar{ $hash_temporal{"DestUniqueID"} }{$var} = $chanvar{ $hash_temporal{"SrcUniqueID"} }{$var}; 
     3214            } 
     3215        } 
     3216 
    31923217        if ( $hash_temporal{'Source'} =~ m/^Local/i ) { 
    31933218 
     
    50225047            if ( $clidnum ne "" ) { 
    50235048                my $base64_clidnum = encode_base64( $clidnum . " " ); 
    5024                 $ret = "$canal|clidnum|$base64_clidnum|$unico_id|$hash_temporal{'Channel'}"; 
     5049                $ret = "$canal|clidnum|$base64_clidnum|$unico_id|$hash_temporal{Channel}"; 
    50255050                push @return, $ret; 
    50265051            } 
    50275052            if ( defined($clidname) ) { 
    50285053                my $base64_clidname = encode_base64( $clidname . " " ); 
    5029                 $ret = "$canal|clidname|$base64_clidname|$unico_id|$hash_temporal{'Channel'}"; 
     5054                $ret = "$canal|clidname|$base64_clidname|$unico_id|$hash_temporal{Channel}"; 
    50305055                push @return, $ret; 
    50315056            } 
     5057            foreach my $var ( keys %{ $passvar{ $hash_temporal{Uniqueid} } } ) { 
     5058                my $base64_var = encode_base64( $passvar{ $hash_temporal{Uniqueid} }{$var} ); 
     5059                $ret = "$canal|setvar|$var=$base64_var|$unico_id|$hash_temporal{Channel}"; 
     5060                push @return, $ret; 
     5061            } 
     5062            delete $passvar{ $hash_temporal{Uniqueid} }; 
    50325063        } 
    50335064 
     
    53915422                        log_debug( "$heading erasing datos{$uniqueid}", 256 ) if DEBUG; 
    53925423                        delete $datos{$uniqueid}; 
     5424                        delete $chanvar{$uniqueid}; 
     5425                        delete $passvar{$uniqueid}; 
    53935426 
    53945427                        if ( $cuantos == 0 ) { 
     
    55555588 
    55565589                            delete $datos{$uniqueid}; 
     5590                            delete $chanvar{$uniqueid}; 
     5591                            delete $passvar{$uniqueid}; 
    55575592                            log_debug( "$heading REMOVING datos { $uniqueid }", 256 ) if DEBUG; 
    55585593