|
|
|
|
@ -69,12 +69,25 @@ sub sub_list :Chained('/') :PathPart('subscriber') :CaptureArgs(0) {
|
|
|
|
|
$c->stash->{subscribers_rs} = $c->model('DB')->resultset('voip_subscribers')->search({
|
|
|
|
|
'me.status' => { '!=' => 'terminated' },
|
|
|
|
|
});
|
|
|
|
|
unless($c->user->is_superuser) {
|
|
|
|
|
if($c->user_in_realm('reseller')) {
|
|
|
|
|
$c->stash->{subscribers_rs} = $c->stash->{subscribers_rs}->search({
|
|
|
|
|
'contact.reseller_id' => $c->user->reseller_id,
|
|
|
|
|
},{
|
|
|
|
|
join => { 'contract' => 'contact'},
|
|
|
|
|
});
|
|
|
|
|
} elsif($c->user_in_realm('subscriber') || $c->user_in_realm('subscriberadmin')) {
|
|
|
|
|
$c->stash->{subscribers_rs} = $c->stash->{subscribers_rs}->search({
|
|
|
|
|
'username' => $c->user->username
|
|
|
|
|
},{
|
|
|
|
|
join => { 'contract' => 'contact'},
|
|
|
|
|
});
|
|
|
|
|
if($c->config->{features}->{multidomain}) {
|
|
|
|
|
$c->stash->{subscribers_rs} = $c->stash->{subscribers_rs}->search({
|
|
|
|
|
'domain.domain' => $c->user->domain->domain,
|
|
|
|
|
},{
|
|
|
|
|
join => 'domain'
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$c->stash->{dt_columns} = NGCP::Panel::Utils::Datatables::set_columns($c, [
|
|
|
|
|
@ -242,14 +255,24 @@ sub create_list :Chained('sub_list') :PathPart('create') :Args(0) :Does(ACL) :AC
|
|
|
|
|
sub base :Chained('sub_list') :PathPart('') :CaptureArgs(1) {
|
|
|
|
|
my ($self, $c, $subscriber_id) = @_;
|
|
|
|
|
|
|
|
|
|
$c->log->debug(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>> base");
|
|
|
|
|
|
|
|
|
|
unless($subscriber_id && $subscriber_id->is_integer) {
|
|
|
|
|
$c->flash(messages => [{type => 'error', text => 'Invalid subscriber id detected'}]);
|
|
|
|
|
NGCP::Panel::Utils::Message->error(
|
|
|
|
|
c => $c,
|
|
|
|
|
error => "subscriber id '$subscriber_id' is not an integer",
|
|
|
|
|
desc => "Invalid subscriber id detected",
|
|
|
|
|
);
|
|
|
|
|
NGCP::Panel::Utils::Navigation::back_or($c, $c->uri_for('/subscriber'));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
my $res = $c->stash->{subscribers_rs}->find({ id => $subscriber_id });
|
|
|
|
|
unless(defined $res) {
|
|
|
|
|
$c->flash(messages => [{type => 'error', text => 'Subscriber does not exist'}]);
|
|
|
|
|
NGCP::Panel::Utils::Message->error(
|
|
|
|
|
c => $c,
|
|
|
|
|
error => "subscriber id '$subscriber_id' does not exist",
|
|
|
|
|
desc => "Subscriber does not exist",
|
|
|
|
|
);
|
|
|
|
|
NGCP::Panel::Utils::Navigation::back_or($c, $c->uri_for('/subscriber'));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -1469,6 +1492,8 @@ sub load_preference_list :Private {
|
|
|
|
|
sub master :Chained('base') :PathPart('details') :CaptureArgs(0) {
|
|
|
|
|
my ($self, $c) = @_;
|
|
|
|
|
|
|
|
|
|
$c->log->debug(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>> master");
|
|
|
|
|
|
|
|
|
|
$c->stash->{calls_dt_columns} = NGCP::Panel::Utils::Datatables::set_columns($c, [
|
|
|
|
|
{ name => "source_user", search => 1, title => "Caller" },
|
|
|
|
|
{ name => "destination_user", search => 1, title => "Callee" },
|
|
|
|
|
@ -2160,6 +2185,8 @@ sub ajax_captured_calls :Chained('master') :PathPart('callflow/ajax') :Args(0) {
|
|
|
|
|
sub voicemail :Chained('master') :PathPart('voicemail') :CaptureArgs(1) {
|
|
|
|
|
my ($self, $c, $vm_id) = @_;
|
|
|
|
|
|
|
|
|
|
$c->log->debug(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>> voicemail");
|
|
|
|
|
|
|
|
|
|
my $rs = $c->model('DB')->resultset('voicemail_spool')->search({
|
|
|
|
|
mailboxuser => $c->stash->{subscriber}->uuid,
|
|
|
|
|
id => $vm_id,
|
|
|
|
|
@ -2179,6 +2206,8 @@ sub voicemail :Chained('master') :PathPart('voicemail') :CaptureArgs(1) {
|
|
|
|
|
sub play_voicemail :Chained('voicemail') :PathPart('play') :Args(0) {
|
|
|
|
|
my ($self, $c) = @_;
|
|
|
|
|
|
|
|
|
|
$c->log->debug(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>> play_voicemail");
|
|
|
|
|
|
|
|
|
|
my $file = $c->stash->{voicemail};
|
|
|
|
|
my $recording = $file->recording;
|
|
|
|
|
my $data;
|
|
|
|
|
|