Changeset 21

Show
Ignore:
Timestamp:
03/23/07 18:18:19 (2 years ago)
Author:
root
Message:

Fix voicemail count (ticket #1)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/op_server.pl

    r20 r21  
    21052105 
    21062106        if ( $canal =~ /=/ ) { 
     2107 
    21072108            # If its a trunk button, erase instances 
    21082109            erase_instances_for_trunk_buttons( $canalsesion, $canal, $server ); 
     
    43704371            $unico_id = $canal; 
    43714372            $canalid  = $canal . "-XXXX"; 
    4372             if ( defined( $hash_temporal{"Waiting"} ) ) { 
     4373            if ( defined( $hash_temporal{Waiting} ) ) { 
     4374 
    43734375                $estado_final = "voicemail"; 
    4374                 $texto        = $hash_temporal{"Waiting"}; 
    4375  
    4376                 #$texto        = 1; 
    4377                 if ( $texto eq "1" ) { 
    4378  
    4379                     # If it has new voicemail, ask for mailboxcount 
     4376                $texto        = $hash_temporal{Waiting}; 
     4377 
     4378                if ( $texto eq "0" ) { 
     4379 
     4380                    # If it does not have new voicemail, ask for mailboxcount to get old mails 
    43804381                    send_command_to_manager( "Action: MailboxCount\r\nMailbox: $hash_temporal{Mailbox}\r\n\r\n", 
    43814382                        $socket, 0, $astmanproxy_server ); 
    43824383                } 
     4384                else { 
     4385 
     4386                    # If it has new voicemail, look for the New and Old headers 
     4387                    if ( defined( $hash_temporal{New} ) ) { 
     4388                        my $nuevos = $hash_temporal{"New"}; 
     4389                        my $viejos = $hash_temporal{"Old"}; 
     4390                        push @return, "$canal|voicemailcount|&newold,$nuevos,$viejos|$unico_id-$server|$canal-XXXX"; 
     4391                    } 
     4392                    else { 
     4393                        send_command_to_manager( "Action: MailboxCount\r\nMailbox: $hash_temporal{Mailbox}\r\n\r\n", 
     4394                            $socket, 0, $astmanproxy_server ); 
     4395                    } 
     4396                } 
    43834397            } 
    43844398            else { 
     4399 
     4400                # This is the actual message count event 
    43854401                $estado_final = "voicemailcount"; 
    43864402                my $nuevos = $hash_temporal{"NewMessages"}; 
     
    59145930                            if ( !defined( $group_count{$interno} ) ) { 
    59155931                                $botonpermanenttext{$interno} = $dos; 
    5916                                 print "vino settext a digest permanent $interno = -$dos-\n"; 
    59175932                                push @respuestas, "$interno|settext|$dos"; 
    59185933                            } 
     
    61266141                                        $iniagent = $channel_to_agent{"$server^$canalsincontexto"}; 
    61276142                                    } 
    6128                                     log_debug( "$heading quehace2 corto y es agente, pushing settimer y settext to idle", 1 ) if DEBUG; 
     6143                                    log_debug( "$heading quehace2 corto y es agente, pushing settimer y settext to idle", 32 ) if DEBUG; 
    61296144                                    $botontimer{$interno}     = time(); 
    61306145                                    $botontimertype{$interno} = "IDLE"; 
     
    61396154                                else { 
    61406155                                    my $valip = ""; 
    6141                                     log_debug( "$heading quehace2 corto, no es agente, pongo timer en cero", 1 ) if DEBUG; 
     6156                                    log_debug( "$heading quehace2 corto, no es agente, pongo timer en cero", 32 ) if DEBUG; 
    61426157 
    61436158                                    push @mensajefinal, "$interno|settimer|0\@STOP";