@ -2270,16 +2270,17 @@ sub update_voicemail_number {
return ;
return ;
}
}
sub vmnotify {
sub vmnotify {
my ( % params ) = @ _ ;
my ( % params ) = @ _ ;
my ( $ c , $ voicemail) = @ params { qw( c voicemail ) } ;
my ( $ c , $ cli, $ uuid ) = @ params { qw( c cli uuid ) } ;
#1.although method is called after delete - DBIC still can access data in deleted row
#1.although method is called after delete - DBIC still can access data in deleted row
#2.amount of the new messages should be selected after played update or delete, of course
#2.amount of the new messages should be selected after played update or delete, of course
my $ data = { $ voicemail - > get_inflated_columns } ;
my $ data = {
$ data - > { cli } = $ voicemail - > mailboxuser - > provisioning_voip_subscriber - > username ;
cli = > $ cli ,
$ data - > { uuid } = $ voicemail - > mailboxuser - > provisioning_voip_subscriber - > uuid ;
uuid = > $ uuid
} ;
$ data - > { context } = 'default' ;
$ data - > { context } = 'default' ;
$ data - > { old_messages } = 0 ;
$ data - > { old_messages } = 0 ;
$ data - > { new_messages } = 0 ;
$ data - > { new_messages } = 0 ;
@ -2306,17 +2307,19 @@ sub vmnotify{
my @ cmd = ( 'ngcp-vmnotify' , @$ data { qw/context cli uuid new_messages old_messages/ } ) ;
my @ cmd = ( 'ngcp-vmnotify' , @$ data { qw/context cli uuid new_messages old_messages/ } ) ;
my $ output = capturex ( [ 0 .. 3 ] , @ cmd ) ;
my $ output = capturex ( [ 0 .. 3 ] , @ cmd ) ;
$ c - > log - > debug ( "cmd=" . join ( " " , @ cmd ) . "; output=$output;" ) ;
$ c - > log - > debug ( "cmd=" . join ( " " , @ cmd ) . "; output=$output;" ) ;
return ;
return ;
}
}
sub mark_voicemail_read {
sub mark_voicemail_read {
my ( % params ) = @ _ ;
my ( % params ) = @ _ ;
my $ c = $ params { c } ;
my $ c = $ params { c } ;
my $ voicemail = $ params { voicemail } ;
my $ voicemail = $ params { voicemail } ;
my $ dir = $ voicemail - > dir ;
my $ dir = $ voicemail - > dir ;
$ dir = ~s/INBOX$/Old/ ;
$ dir = ~s/INBOX$/Old/ ;
$ voicemail - > update ( { dir = > $ dir } ) ;
$ voicemail - > update ( { dir = > $ dir } ) ;
return ;
return ;
}
}