MT#7899 API: clear audio cache on sound file mod.

gjungwirth/voicemail_number
Andreas Granig 11 years ago
parent 51aa065d94
commit 3a9d043d40

@ -14,6 +14,7 @@ use HTTP::Status qw(:constants);
use File::Temp qw(tempfile);
use NGCP::Panel::Form::Sound::FileAPI;
use NGCP::Panel::Utils::Sounds;
use NGCP::Panel::Utils::Sems;
sub transcode_data {
my ($self, $c, $from_codec, $resource) = @_;
@ -174,6 +175,16 @@ sub update_item {
}
$resource->{handle_id} = $handle->id;
given($handle->group->name) {
when([qw/calling_card/]) {
NGCP::Panel::Utils::Sems::clear_audio_cache($c, "appserver", $set->id, $handle->name);
}
when([qw/pbx music_on_hold/]) {
my $service = $set->contract_id ? "pbx" : "appserver";
NGCP::Panel::Utils::Sems::clear_audio_cache($c, $service, $set->id, $handle->name);
}
}
if($resource->{handle} eq 'music_on_hold' && !$set->contract_id) {
$resource->{codec} = 'PCMA';
$resource->{filename} =~ s/\.[^.]+$/.pcma/;

@ -15,6 +15,8 @@ sub dispatch {
my ($self, $c, $target, $all, $sync, $body) = @_;
my $schema = $self->schema;
$c->log->info("dispatching to target $target, all=$all, sync=$sync");
$c->log->debug("dispatching body $body");
my $hosts;
if ($target =~ /^%TG%/) {

Loading…
Cancel
Save