Changeset 30
- Timestamp:
- 04/24/07 01:55:18 (2 years ago)
- Files:
-
- trunk/op_server.pl (modified) (42 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/op_server.pl
r29 r30 1507 1507 my $contextoboton = $key; 1508 1508 if ( $contextoboton =~ m/\@/ ) { 1509 ( $contextoboton) = split( /\@/, $contextoboton, 2 );1509 (undef, $contextoboton) = split( /\@/, $contextoboton, 2 ); 1510 1510 $contextoboton =~ tr/a-z/A-Z/; 1511 1511 } … … 1525 1525 my $contextoboton = $key; 1526 1526 if ( $contextoboton =~ m/\@/ ) { 1527 ( $contextoboton) = split( /\@/, $contextoboton, 2 );1527 (undef, $contextoboton) = split( /\@/, $contextoboton, 2 ); 1528 1528 $contextoboton =~ tr/a-z/A-Z/; 1529 1529 } … … 1562 1562 my $contextoboton = $key; 1563 1563 if ( $contextoboton =~ m/\@/ ) { 1564 ( $contextoboton) = split( /\@/, $contextoboton, 2 );1564 (undef, $contextoboton) = split( /\@/, $contextoboton, 2 ); 1565 1565 $contextoboton =~ tr/a-z/A-Z/; 1566 1566 } … … 1581 1581 my $contextoboton = $key; 1582 1582 if ( $contextoboton =~ m/\@/ ) { 1583 ( $contextoboton) = split( /\@/, $contextoboton, 2 );1583 (undef, $contextoboton) = split( /\@/, $contextoboton, 2 ); 1584 1584 $contextoboton =~ tr/a-z/A-Z/; 1585 1585 } … … 1797 1797 } 1798 1798 log_debug( "$heading contexto $contexto", 32 ) if DEBUG; 1799 my ( $nada, $ses ) = separate_session_from_channel($canalsesion);1799 my ( undef, $ses ) = separate_session_from_channel($canalsesion); 1800 1800 $sesion = $ses; 1801 1801 } … … 1946 1946 $canalglobal =~ s/IAX2\[(.*)@(.*)\]/IAX2\[$1\]/g; 1947 1947 1948 my ( $nada, $contexto ) = split( /\&/, $canal );1948 my ( undef, $contexto ) = split( /\&/, $canal ); 1949 1949 if ( !defined($contexto) ) { $contexto = ""; } 1950 1950 … … 1993 1993 } 1994 1994 1995 my ( $nada1, $contexto1 ) = split( /\&/, $nroboton );1995 my ( undef, $contexto1 ) = split( /\&/, $nroboton ); 1996 1996 if ( !defined($contexto1) ) { $contexto1 = ""; } 1997 1997 … … 2009 2009 my @linkbotones = find_panel_buttons( $canal1, $canalsesion, $server ); 2010 2010 foreach my $cual (@linkbotones) { 2011 my ( $nada2, $contexto2 ) = split( /\&/, $cual );2011 my ( undef, $contexto2 ) = split( /\&/, $cual ); 2012 2012 if ( !defined($contexto2) ) { $contexto2 = ""; } 2013 2013 if ( $contexto1 eq $contexto2 ) { … … 2476 2476 $server = $server_original; 2477 2477 $canalfinal = ""; 2478 my ( $nada, $contexto ) = split( "\&", $_ );2478 my ( undef, $contexto ) = split( "\&", $_ ); 2479 2479 if ( !defined($contexto) ) { $contexto = ""; } 2480 2480 if ( $contexto ne "" ) { $contexto = "&" . $contexto; } … … 2564 2564 $canalfinal = ""; 2565 2565 2566 my $nada1 = "";2567 2566 my $contextemp = ""; 2568 2567 my %contextosencontrados; 2569 2568 for my $val (@canales) { 2570 ( $nada1, $contextemp ) = split( "&", $val );2569 ( undef, $contextemp ) = split( "&", $val ); 2571 2570 if ( !defined($contextemp) ) { $contextemp = ""; } 2572 2571 $contextosencontrados{"&$contextemp"} = 1; … … 3034 3033 #TalkTime: 557 3035 3034 #Reason: agent 3036 my ( $canal, $nada) = separate_session_from_channel( $hash_temporal{Channel} );3035 my ( $canal, undef ) = separate_session_from_channel( $hash_temporal{Channel} ); 3037 3036 request_queue_status( $socket, $canal ); 3038 3037 my @respuestas = set_queueobject( $server, $canal, "status", 1 ); … … 3210 3209 my $dorigen = ""; 3211 3210 my $ddestino = ""; 3212 my $dnada = "";3213 3211 $remote_callerid{$key} = $hash_temporal{"CallerID"}; 3214 3212 $remote_callerid_name{$key} = $hash_temporal{"CallerIDName"}; … … 3220 3218 # so we can map outgoing calls to Agent buttons 3221 3219 # It will only work after the agent receives at least one call 3222 ( $dorigen, $dnada) = separate_session_from_channel( $hash_temporal{'Source'} );3223 ( $ddestino, $dnada) = separate_session_from_channel( $hash_temporal{'Destination'} );3220 ( $dorigen, undef ) = separate_session_from_channel( $hash_temporal{'Source'} ); 3221 ( $ddestino, undef ) = separate_session_from_channel( $hash_temporal{'Destination'} ); 3224 3222 if ( exists( $channel_to_agent{"$server^$dorigen"} ) ) { 3225 3223 my $agente = $channel_to_agent{"$server^$dorigen"}; … … 3264 3262 my $valor = ""; 3265 3263 $estado_final = "astdb"; 3266 ( $canal, my $nada) = separate_session_from_channel( $hash_temporal{"Channel"} );3264 ( $canal, undef ) = separate_session_from_channel( $hash_temporal{"Channel"} ); 3267 3265 $canalid = $hash_temporal{"Channel"} . "-XXXX"; 3268 3266 my $clave = $hash_temporal{"Family"}; … … 3312 3310 # XXXX It will have to store this value internally in future version 3313 3311 # to avoid polling asterisk every time 3314 ( $canal, my $nada) = separate_session_from_channel( $hash_temporal{"Channel"} );3312 ( $canal, undef ) = separate_session_from_channel( $hash_temporal{"Channel"} ); 3315 3313 $texto = $hash_temporal{"IP"}; 3316 3314 my $serv = $hash_temporal{"Server"}; … … 3328 3326 my $color = ""; 3329 3327 my $state = ""; 3330 ( $canal, my $nada) = separate_session_from_channel( $hash_temporal{"Channel"} );3328 ( $canal, undef ) = separate_session_from_channel( $hash_temporal{"Channel"} ); 3331 3329 $color = $hash_temporal{"Color"}; 3332 3330 $state = $hash_temporal{"State"}; … … 3336 3334 } 3337 3335 elsif ( $evento eq "foppopup" ) { 3338 ( $canal, my $nada) = separate_session_from_channel( $hash_temporal{"Channel"} );3336 ( $canal, undef ) = separate_session_from_channel( $hash_temporal{"Channel"} ); 3339 3337 my $url = $hash_temporal{"URL"}; 3340 3338 my $target = $hash_temporal{"Target"}; … … 3347 3345 } 3348 3346 elsif ( $evento eq "refreshqueue" ) { 3349 ( $canal, my $nada) = separate_session_from_channel( $hash_temporal{"Channel"} );3347 ( $canal, undef ) = separate_session_from_channel( $hash_temporal{"Channel"} ); 3350 3348 3351 3349 # Turns off led of the agent that generated the refresh … … 3397 3395 # so we populate some internal structures. If not, its a fake 3398 3396 # callbacklogin from the show agents cli command 3399 ( $canal, my $nada) = separate_session_from_channel( $datos{$unico_id}{Channel} );3397 ( $canal, undef ) = separate_session_from_channel( $datos{$unico_id}{Channel} ); 3400 3398 $canal =~ tr/a-z/A-Z/; 3401 3399 } … … 3579 3577 3580 3578 # This catches a live real Agentlogin event 3581 ( my $canalreal, my $nada) = separate_session_from_channel( $datos{$unico_id}{Channel} );3579 ( my $canalreal, undef ) = separate_session_from_channel( $datos{$unico_id}{Channel} ); 3582 3580 $canalreal =~ tr/a-z/A-Z/; 3583 3581 $channel_to_agent{"$server^$canalreal"} = "Agent/$texto"; … … 4038 4036 } 4039 4037 elsif ( $evento eq "meetmemute" || $evento eq "meetmeunmute" ) { 4040 my ( $canal, $nada) = separate_session_from_channel($canalid);4038 my ( $canal, undef ) = separate_session_from_channel($canalid); 4041 4039 $estado_final = $evento; 4042 4040 push @return, "$canal|$evento||$unico_id|$canalid"; … … 4114 4112 my $originate = "no"; 4115 4113 my $mute_other_party = "no"; 4116 my $nada = "";4117 4114 my $contexto = ""; 4118 4115 … … 4317 4314 } 4318 4315 4319 my ( $canal1, $nada1) = separate_session_from_channel($canaleja);4316 my ( $canal1, undef ) = separate_session_from_channel($canaleja); 4320 4317 push @return, "$canal1|unsetlink|$canal|$unico_id|$canalid"; 4321 4318 $evento = ""; … … 4553 4550 if ( $nuevo_nombre =~ /<ZOMBIE>/ ) { 4554 4551 log_debug( "$heading $nuevo_nombre, asterisk bug, sometimes misses the hangup, so we fake it", 64 ) if DEBUG; 4555 my ( $canalnuevo, $nada) = separate_session_from_channel($nuevo_nombre);4552 my ( $canalnuevo, undef ) = separate_session_from_channel($nuevo_nombre); 4556 4553 push @return, "$canalnuevo|corto||$unico_id|$nuevo_nombre"; 4557 4554 } … … 4597 4594 4598 4595 if ( defined($canalcambiado) ) { 4599 my ( $canalito, $nada) = separate_session_from_channel($canalcambiado);4596 my ( $canalito, undef ) = separate_session_from_channel($canalcambiado); 4600 4597 push @return, "$canalito|$estado_final|$nuevo_nombre|$unico_id|$canalcambiado"; 4601 ( $canalito, $nada) = separate_session_from_channel($nuevo_nombre);4598 ( $canalito, undef ) = separate_session_from_channel($nuevo_nombre); 4602 4599 push @return, "$canalito|$estado_final|$canalcambiado|$unico_id|$nuevo_nombre"; 4603 4600 $canal = $canalito; … … 4777 4774 $estado_final = "meetmeuser"; 4778 4775 $texto = $hash_temporal{Usernum} . "," . $hash_temporal{Meetme}; 4779 my ( $chan1, $nada1) = separate_session_from_channel( $hash_temporal{Channel} );4776 my ( $chan1, undef ) = separate_session_from_channel( $hash_temporal{Channel} ); 4780 4777 push @return, "$hash_temporal{Meetme}|setlink|$hash_temporal{Channel}||$hash_temporal{Channel}"; 4781 4778 push @return, "$chan1|setlink|$hash_temporal{Meetme}||$hash_temporal{Channel}"; … … 4895 4892 $texto = "&parked," . $hash_temporal{'Exten'} . "&"; 4896 4893 $estado_final = "ocupado3"; 4897 my ( $canal, $nada) = separate_session_from_channel( $hash_temporal{'Channel'} );4894 my ( $canal, undef ) = separate_session_from_channel( $hash_temporal{'Channel'} ); 4898 4895 my $textid = ""; 4899 4896 my $timeout = ""; … … 5323 5320 } 5324 5321 @mensajes = procesa_bloque( $blaque, $socket, $astmanproxy_server ); 5322 5325 5323 foreach my $mensaje (@mensajes) { 5326 5324 if ( defined($mensaje) && $mensaje ne "" ) { … … 5489 5487 && $quehace !~ /^unsetlink/ ) 5490 5488 { 5491 my ( $nada, $elcontexto ) = split( /\&/, $canal );5489 my ( undef, $elcontexto ) = split( /\&/, $canal ); 5492 5490 if ( !defined($elcontexto) ) { $elcontexto = ""; } 5493 5491 if ( $elcontexto ne "" ) { … … 5522 5520 5523 5521 $interno = $buttons{"$server^$canal"}; 5524 5525 5522 if ( !defined($interno) ) { 5526 5523 $interno = $buttons{"-1^$canal"}; … … 5568 5565 5569 5566 log_debug( "$heading IF quehace = SETLINK", 256 ) if DEBUG; 5570 my ( $nada1, $contexto1 ) = split( /\&/, $canal );5567 my ( undef, $contexto1 ) = split( /\&/, $canal ); 5571 5568 if ( !defined($contexto1) ) { $contexto1 = ""; } 5572 5569 my $listabotones = ""; … … 5581 5578 my @linkbotones = find_panel_buttons( $canal1, $dos, $server ); 5582 5579 foreach (@linkbotones) { 5583 my ( $nada2, $contexto2 ) = split( /\&/, $_ );5580 my ( undef, $contexto2 ) = split( /\&/, $_ ); 5584 5581 if ( !defined($contexto2) ) { $contexto2 = ""; } 5585 5582 if ( $contexto1 eq $contexto2 ) { … … 5728 5725 "$heading Y es distinto al ultimo estado $laststatus{$interno} ne $estadoboton{$interno}", 256 ) 5729 5726 if DEBUG; 5730 } 5727 } 5731 5728 5732 5729 # Conserva el callerid anterior … … 5822 5819 } 5823 5820 $estadoboton{$interno} = "busy|${buttontext}"; 5824 5825 5821 } 5826 5822 } … … 6058 6054 6059 6055 if ( defined( $cambiaron{$interno} ) && $cambiaron{$interno} == 1 ) { 6060 log_debug( "$heading pushing respuestas $interno|$quehace2|$dos", 256 ) if DEBUG;6061 6056 6062 6057 # Discard events that we dont want to send … … 6070 6065 if ( $quehace2 ne "" ) { 6071 6066 push @respuestas, "$interno|$quehace2|$dos"; 6072 6073 # print "push $quehace2 en $interno quehace2\n"; 6074 } 6067 log_debug( "$heading pushing respuestas $interno|$quehace2|$dos", 256 ) if DEBUG; 6068 } 6075 6069 } 6076 6070 } … … 6088 6082 if ( $quehace2 eq "settimer" ) { 6089 6083 my $tiempo = $dos; 6090 my $ nada= "";6084 my $timer_type = ""; 6091 6085 if ( $tiempo =~ /\@/ ) { 6092 ( $tiempo, $ nada) = split( /\@/, $tiempo );6086 ( $tiempo, $timer_type ) = split( /\@/, $tiempo ); 6093 6087 } 6094 if ( $ nadane "" ) {6095 $botontimertype{$interno} = $ nada;6096 $ nada = "\@" . $nada;6088 if ( $timer_type ne "" ) { 6089 $botontimertype{$interno} = $timer_type; 6090 $timer_type = "\@" . $timer_type; 6097 6091 } 6098 6092 $botontimer{$interno} = time() - $tiempo; 6099 push @mensajefinal, "$interno|settimer|$tiempo$ nada";6093 push @mensajefinal, "$interno|settimer|$tiempo$timer_type"; 6100 6094 } 6101 6095 … … 7015 7009 if ( $accion =~ /^contexto\d+/ ) { 7016 7010 7017 my ( $nada, $contextoenviado ) = split( /\@/, $datosflash );7011 my ( undef, $contextoenviado ) = split( /\@/, $datosflash ); 7018 7012 7019 7013 if ( defined($contextoenviado) ) { … … 7766 7760 my $canalid = shift; 7767 7761 my $member = ""; 7768 my $nada = "";7769 7762 my $showagents = 0; 7770 7763 … … 7776 7769 } 7777 7770 else { 7778 ( $member, $nada) = separate_session_from_channel($canalid);7771 ( $member, undef ) = separate_session_from_channel($canalid); 7779 7772 } 7780 7773 } … … 8116 8109 my $interno = ""; 8117 8110 my $estado = ""; 8118 my $nada = "";8119 8111 my $conference = 0; 8120 8112 my $usernum = 0; … … 8865 8857 $cola->{$id}{QUEUE} . "=" 8866 8858 . $cola->{$id}{POSITION} 8867 . "| state|busy|"8859 . "|ocupado|[$clidtext]|" 8868 8860 . $cola->{$id}{QUEUE} . "-" 8869 8861 . $cola->{$id}{SERVER} . "|$id"; 8870 push @return_ocupado, $cola->{$id}{QUEUE} . "| state|busy|" . $cola->{$id}{QUEUE} . "-" . $cola->{$id}{SERVER} . "|$id";8862 push @return_ocupado, $cola->{$id}{QUEUE} . "|ocupado|[$clidtext]|" . $cola->{$id}{QUEUE} . "-" . $cola->{$id}{SERVER} . "|$id"; 8871 8863 push @return_ocupado, 8872 8864 $cola->{$id}{QUEUE} . "|settimer|0\@STOP|" . $cola->{$id}{QUEUE} . "-" . $cola->{$id}{SERVER} . "|$id"; 8873 push @return_ocupado,8874 $cola->{$id}{QUEUE} . "="8875 . $cola->{$id}{POSITION}8876 . "|settextnopermanente|[$clidtext]|"8877 . $cola->{$id}{QUEUE} . "-"8878 . $cola->{$id}{SERVER} . "|$id";8879 8865 } 8880 8866 }
