TT#9714 susbcriber first non-prim alias for edr records

-introduce deferred event record insertion, to span across
 update_subscriber_number and update_subadmin_sub_aliases
 calls by handing over a snapshot of aliases before number
 edit operations
-the snapshot is used to persist first_non_primary_alias_before
 event values
-it also is the preparation to derive number change events

apart from that, the following was noticed:
-fix: start_huntgroup was generated twice
-fix: when terminating a subs, the order of end events was
 not the reverse order of start_events
-POST /api/subscribers does not consider pbx alais selection
 of pilot pool aliases, while terminating the susbcriber does
 move back alaises to the pilot pool.

Change-Id: I092f4a21bed25503f48c47c253f1cae0729f43da
changes/38/10938/12
Rene Krenn 9 years ago
parent 1af6f1f1f1
commit 61a87b9c86

@ -13,6 +13,7 @@ use NGCP::Panel::Utils::DateTime;
use NGCP::Panel::Utils::Subscriber;
use NGCP::Panel::Utils::Preferences;
use NGCP::Panel::Utils::ProfilePackages qw();
use NGCP::Panel::Utils::Events qw();
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
use UUID;
@ -375,6 +376,8 @@ sub POST :Allow {
UUID::generate($uuid_bin);
UUID::unparse($uuid_bin, $uuid_string);
my @events_to_create = ();
my $event_context = { events_to_create => \@events_to_create };
$subscriber = NGCP::Panel::Utils::Subscriber::create_subscriber(
c => $c,
schema => $schema,
@ -382,6 +385,7 @@ sub POST :Allow {
params => $resource,
preferences => $preferences,
admin_default => 0,
event_context => $event_context,
);
if($resource->{status} eq 'locked') {
NGCP::Panel::Utils::Subscriber::lock_provisoning_voip_subscriber(
@ -408,7 +412,12 @@ sub POST :Allow {
customer => $customer,
subscriber => $subscriber,
);
NGCP::Panel::Utils::Events::insert_deferred(
c => $c,
schema => $schema,
events_to_create => \@events_to_create,
);
#ready for number change events here
} catch(DBIx::Class::Exception $e where { /Duplicate entry '([^']+)' for key 'number_idx'/ }) {
$e =~ /Duplicate entry '([^']+)' for key 'number_idx'/;
$c->log->error("failed to create subscriber, number $1 already exists"); # TODO: user, message, trace, ...

@ -30,6 +30,7 @@ use NGCP::Panel::Utils::ProfilePackages;
use NGCP::Panel::Utils::DeviceBootstrap;
use NGCP::Panel::Utils::Voucher;
use NGCP::Panel::Utils::ContractLocations qw();
use NGCP::Panel::Utils::Events qw();
use Template;
=head1 NAME
@ -842,6 +843,8 @@ sub subscriber_create :Chained('base') :PathPart('subscriber/create') :Args(0) {
if($c->stash->{billing_mapping}->billing_profile->prepaid) {
$preferences->{prepaid} = 1;
}
my @events_to_create = ();
my $event_context = { events_to_create => \@events_to_create };
$billing_subscriber = NGCP::Panel::Utils::Subscriber::create_subscriber(
c => $c,
schema => $schema,
@ -849,6 +852,7 @@ sub subscriber_create :Chained('base') :PathPart('subscriber/create') :Args(0) {
params => $form->values,
admin_default => 0,
preferences => $preferences,
event_context => $event_context,
);
NGCP::Panel::Utils::ProfilePackages::underrun_lock_subscriber(c => $c, subscriber => $billing_subscriber);
@ -869,6 +873,12 @@ sub subscriber_create :Chained('base') :PathPart('subscriber/create') :Args(0) {
subscriber => $billing_subscriber,
);
}
NGCP::Panel::Utils::Events::insert_deferred(
c => $c,
schema => $schema,
events_to_create => \@events_to_create,
);
#ready for number change events here
});
delete $c->session->{created_objects}->{domain};
@ -1356,6 +1366,8 @@ sub pbx_group_create :Chained('base') :PathPart('pbx/group/create') :Args(0) {
$preferences->{cloud_pbx_hunt_timeout} = $form->values->{pbx_hunt_timeout};
$preferences->{cloud_pbx_ext} = $form->values->{pbx_extension};
$preferences->{display_name} = ucfirst($form->values->{username});
my @events_to_create = ();
my $event_context = { events_to_create => \@events_to_create };
my $billing_subscriber = NGCP::Panel::Utils::Subscriber::create_subscriber(
c => $c,
schema => $schema,
@ -1363,13 +1375,15 @@ sub pbx_group_create :Chained('base') :PathPart('pbx/group/create') :Args(0) {
params => $form->values,
admin_default => 0,
preferences => $preferences,
event_context => $event_context,
);
NGCP::Panel::Utils::ProfilePackages::underrun_lock_subscriber(c => $c, subscriber => $billing_subscriber);
NGCP::Panel::Utils::Events::insert(
c => $c, schema => $schema, type => 'start_huntgroup',
subscriber => $billing_subscriber, old_status => undef,
new_status => $billing_subscriber->provisioning_voip_subscriber->profile_id,
NGCP::Panel::Utils::Events::insert_deferred(
c => $c,
schema => $schema,
events_to_create => \@events_to_create,
);
#ready for number change events here
$c->session->{created_objects}->{group} = { id => $billing_subscriber->id };
});
NGCP::Panel::Utils::Message::info(
@ -1477,6 +1491,11 @@ sub pbx_group_edit :Chained('pbx_group_base') :PathPart('edit') :Args(0) {
sn => $base_number->sn . $form->values->{pbx_extension},
};
}
my $aliases_before = NGCP::Panel::Utils::Events::get_aliases_snapshot(
c => $c,
schema => $schema,
subscriber => $sub,
);
NGCP::Panel::Utils::Subscriber::update_subscriber_numbers(
c => $c,
schema => $schema,
@ -1495,7 +1514,7 @@ sub pbx_group_edit :Chained('pbx_group_base') :PathPart('edit') :Args(0) {
sadmin => $c->stash->{pilot},
);
}
#ready for number change events here
});
NGCP::Panel::Utils::Message::info(
c => $c,

@ -696,7 +696,7 @@ sub preferences :Chained('base') :PathPart('preferences') :Args(0) {
foreach my $voicemail_greeting_type (qw/unavail busy/){
my $dir = NGCP::Panel::Utils::Subscriber::get_subscriber_voicemail_directory(c => $c, subscriber => $c->stash->{subscriber}, dir => $voicemail_greeting_type);
push @$vm_recordings_types,
$subscriber_vm_recordings->{$dir} ? {%{$subscriber_vm_recordings->{$dir}}, type => $voicemail_greeting_type }
$subscriber_vm_recordings->{$dir} ? {%{$subscriber_vm_recordings->{$dir}}, type => $voicemail_greeting_type }
: {greeting_exists => 0, type => $voicemail_greeting_type} ;
}
$c->stash->{vm_recordings_types} = $vm_recordings_types;
@ -953,7 +953,7 @@ sub preferences_callforward :Chained('base') :PathPart('preferences/callforward'
$params->{ringtimeout} = $ringtimeout;
$params->{destination}->{announcement_id} = $destination ? $destination->announcement_id : '';
}
my $cf_form;
if($cf_type eq "cft") {
$cf_form = NGCP::Panel::Form::SubscriberCFTSimple->new(ctx => $c);
@ -2588,20 +2588,6 @@ sub edit_master :Chained('master') :PathPart('edit') :Args(0) :Does(ACL) :ACLDet
$prov_subscriber->update($prov_params);
if(($prov_subscriber->profile_id // 0) != ($old_profile // 0)) {
my $type;
if(defined $prov_subscriber->profile_id && defined $old_profile) {
$type = "update_profile";
} elsif(defined $prov_subscriber->profile_id) {
$type = "start_profile";
} else {
$type = "end_profile";
}
NGCP::Panel::Utils::Events::insert(
c => $c, schema => $schema, subscriber => $subscriber,
type => $type, old => $old_profile, new => $prov_subscriber->profile_id
);
}
my $new_group_ids = defined $form->value->{group_select} ?
decode_json($form->value->{group_select}) : [];
NGCP::Panel::Utils::Subscriber::manage_pbx_groups(
@ -2636,6 +2622,12 @@ sub edit_master :Chained('master') :PathPart('edit') :Args(0) :Does(ACL) :ACLDet
$form->values->{lock} ||= 0; # update lock below
}
my $aliases_before = NGCP::Panel::Utils::Events::get_aliases_snapshot(
c => $c,
schema => $schema,
subscriber => $subscriber,
);
if(exists $form->params->{alias_select} && $c->stash->{pilot}) {
NGCP::Panel::Utils::Subscriber::update_subadmin_sub_aliases(
c => $c,
@ -2749,15 +2741,23 @@ sub edit_master :Chained('master') :PathPart('edit') :Args(0) :Does(ACL) :ACLDet
level => $form->values->{lock},
) if ($subscriber->provisioning_voip_subscriber);
#if($lock->first) {
# if ($form->values->{lock} == 0) {
# $lock->delete;
# } else {
# $lock->first->update({ value => $form->values->{lock} });
# }
#} elsif($form->values->{lock} > 0) {
# $lock->create({ value => $form->values->{lock} });
#}
if(($prov_subscriber->profile_id // 0) != ($old_profile // 0)) {
my $type;
if(defined $prov_subscriber->profile_id && defined $old_profile) {
$type = "update_profile";
} elsif(defined $prov_subscriber->profile_id) {
$type = "start_profile";
} else {
$type = "end_profile";
}
NGCP::Panel::Utils::Events::insert(
c => $c, schema => $schema, subscriber => $subscriber,
type => $type, old => $old_profile, new => $prov_subscriber->profile_id,
%$aliases_before,
);
}
#ready for number change events here
});
delete $c->session->{created_objects}->{group};
NGCP::Panel::Utils::Message::info(
@ -3045,10 +3045,10 @@ sub edit_voicebox :Chained('base') :PathPart('preferences/voicebox/edit') :Args(
my $greetingfile = delete $form->values->{'greetingfile'};
my $greeting_converted_ref;
try {
NGCP::Panel::Utils::Subscriber::convert_voicemailgreeting(
c => $c,
upload => $greetingfile,
filepath => $greetingfile->tempname,
NGCP::Panel::Utils::Subscriber::convert_voicemailgreeting(
c => $c,
upload => $greetingfile,
filepath => $greetingfile->tempname,
converted_data_ref => \$greeting_converted_ref );
} catch($e) {
NGCP::Panel::Utils::Message::error(

@ -138,4 +138,25 @@ has_field 'pilot_subscriber_profile_set_name' => (
required => 0,
);
has_field 'first_non_primary_alias_username_before' => (
type => 'Text',
label => 'The subscriber\'s non-primary alias with lowest id, before number updates during the operation.',
required => 0,
);
has_field 'first_non_primary_alias_username_after' => (
type => 'Text',
label => 'The subscriber\'s non-primary alias with lowest id, after number updates during the operation.',
required => 0,
);
has_field 'pilot_first_non_primary_alias_username_before' => (
type => 'Text',
label => 'The non-primary alias with lowest id of the subscriber\'s pilot subscriber, before number updates during the operation.',
required => 0,
);
has_field 'pilot_first_non_primary_alias_username_after' => (
type => 'Text',
label => 'The non-primary alias with lowest id of the subscriber\'s pilot subscriber, after number updates during the operation.',
required => 0,
);
1;

@ -66,6 +66,10 @@ sub hal_from_item {
$resource{pilot_subscriber_profile_set_id} = NGCP::Panel::Utils::Events::get_relation_value(c => $c, event => $item, type => 'pilot_subscriber_profile_set_id');
$resource{pilot_subscriber_profile_set_name} = NGCP::Panel::Utils::Events::get_tag_value(c => $c, event => $item, type => 'pilot_subscriber_profile_set_name');
$resource{first_non_primary_alias_username_before} = NGCP::Panel::Utils::Events::get_tag_value(c => $c, event => $item, type => 'first_non_primary_alias_username_before');
$resource{first_non_primary_alias_username_after} = NGCP::Panel::Utils::Events::get_tag_value(c => $c, event => $item, type => 'first_non_primary_alias_username_after');
$resource{pilot_first_non_primary_alias_username_before} = NGCP::Panel::Utils::Events::get_tag_value(c => $c, event => $item, type => 'pilot_first_non_primary_alias_username_before');
$resource{pilot_first_non_primary_alias_username_after} = NGCP::Panel::Utils::Events::get_tag_value(c => $c, event => $item, type => 'pilot_first_non_primary_alias_username_after');
my $hal = Data::HAL->new(
links => [

@ -617,6 +617,11 @@ sub update_item {
}
delete $resource->{email};
my $aliases_before = NGCP::Panel::Utils::Events::get_aliases_snapshot(
c => $c,
schema => $schema,
subscriber => $subscriber,
);
try {
NGCP::Panel::Utils::Subscriber::update_subscriber_numbers(
c => $c,
@ -680,9 +685,11 @@ sub update_item {
}
NGCP::Panel::Utils::Events::insert(
c => $c, schema => $schema, subscriber => $subscriber,
type => $type, old => $old_profile, new => $prov_subscriber->profile_id
type => $type, old => $old_profile, new => $prov_subscriber->profile_id,
%$aliases_before,
);
}
#ready for number change events here
NGCP::Panel::Utils::Subscriber::update_preferences(
c => $c,

@ -4,6 +4,18 @@ use Sipwise::Base;
use NGCP::Panel::Utils::DateTime qw();
sub insert_deferred {
my %params = @_;
my $c = $params{c};
my $schema = $params{schema} // $c->model('DB');
my $events_to_create = $params{events_to_create} // [];
while (my $event = shift @$events_to_create) {
insert(c => $c, schema => $schema,
%$event
);
}
}
sub insert {
my %params = @_;
my $c = $params{c};
@ -12,10 +24,14 @@ sub insert {
my $subscriber = $params{subscriber};
my $old = $params{old};
my $new = $params{new};
my $old_aliases = $params{old_aliases};
my $old_pilot_aliases = $params{old_pilot_aliases};
my $new_aliases = $params{new_aliases}; #to pass cleared aliases upon termination, as aliases are removed via trigger
my $new_pilot_aliases = $params{new_pilot_aliases};
#reload it:
#reload it usually:
$subscriber = $schema->resultset('voip_subscribers')->find({
id => $subscriber->id,
id => (defined $subscriber ? $subscriber->id : $params{subscriber_id}),
});
my $now_hires = NGCP::Panel::Utils::DateTime::current_local_hires;
@ -36,7 +52,7 @@ sub insert {
exported_at => undef,
});
save_e164(
save_voip_number(
schema => $schema,
event => $event,
number => $subscriber->primary_number,
@ -66,9 +82,114 @@ sub insert {
relations_rs => $relations_rs,
);
save_first_non_primary_alias(
schema => $schema,
event => $event,
(defined $old_aliases ? (aliases => $old_aliases) : (prov_subscriber => $prov_subscriber)),
types_prefix => '',
types_suffix => '_before',
now_hires => $now_hires,
tags_rs => $tags_rs,
);
save_first_non_primary_alias(
schema => $schema,
event => $event,
(defined $new_aliases ? (aliases => $new_aliases) : (prov_subscriber => $prov_subscriber)),
types_prefix => '',
types_suffix => '_after',
now_hires => $now_hires,
tags_rs => $tags_rs,
);
my $pilot_subscriber = _get_pilot_subscriber(
c => $c,
schema => $schema,
subscriber => $subscriber,
customer => $customer,
prov_subscriber => $prov_subscriber,
);
if ($pilot_subscriber) {
$event->create_related("relation_data", {
relation_id => $relations_rs->find({ type => 'pilot_subscriber_id' })->id,
val => $pilot_subscriber->id,
event_timestamp => $now_hires,
});
my $pilot_prov_subscriber = $pilot_subscriber->provisioning_voip_subscriber;
save_voip_number(
schema => $schema,
event => $event,
number => $pilot_subscriber->primary_number,
types_prefix => 'pilot_primary_number_',
now_hires => $now_hires,
tags_rs => $tags_rs,
relations_rs => $relations_rs,
);
save_subscriber_profile(
schema => $schema,
event => $event,
subscriber_profile => ($pilot_prov_subscriber ? $pilot_prov_subscriber->voip_subscriber_profile : undef),
types_prefix => 'pilot_subscriber_profile_',
now_hires => $now_hires,
tags_rs => $tags_rs,
relations_rs => $relations_rs,
);
save_subscriber_profile_set(
schema => $schema,
event => $event,
subscriber_profile_set => ($pilot_prov_subscriber ? $pilot_prov_subscriber->voip_subscriber_profile_set : undef),
types_prefix => 'pilot_subscriber_profile_set_',
now_hires => $now_hires,
tags_rs => $tags_rs,
relations_rs => $relations_rs,
);
save_first_non_primary_alias(
schema => $schema,
event => $event,
(defined $old_pilot_aliases ? (aliases => $old_pilot_aliases) : (prov_subscriber => $pilot_prov_subscriber)),
types_prefix => 'pilot_',
types_suffix => '_before',
now_hires => $now_hires,
tags_rs => $tags_rs,
);
save_first_non_primary_alias(
schema => $schema,
event => $event,
(defined $new_pilot_aliases ? (aliases => $new_pilot_aliases) : (prov_subscriber => $pilot_prov_subscriber)),
types_prefix => 'pilot_',
types_suffix => '_after',
now_hires => $now_hires,
tags_rs => $tags_rs,
);
}
}
sub _get_pilot_subscriber {
my %params = @_;
my ($c,
$schema,
$subscriber,
$customer,
$prov_subscriber,
$now_hires,
) = @params{qw/
c
schema
subscriber
customer
prov_subscriber
now_hires
/};
#now_hires
$schema //= $c->model('DB');
$now_hires //= NGCP::Panel::Utils::DateTime::current_local_hires;
$customer //= $subscriber->contract;
$prov_subscriber //= $subscriber->provisioning_voip_subscriber;
my $pilot_subscriber = undef;
my $bm_actual = get_actual_billing_mapping(c => $c,schema => $schema, contract => $customer, now => $now_hires);
if ($bm_actual->billing_mappings->first->product->class eq 'pbxaccount') {
my $pilot_subscriber;
if ($prov_subscriber and $prov_subscriber->is_pbx_pilot) {
$pilot_subscriber = $subscriber;
} else {
@ -78,48 +199,11 @@ sub insert {
join => 'provisioning_voip_subscriber',
})->first;
}
if ($pilot_subscriber) {
$event->create_related("relation_data", {
relation_id => $relations_rs->find({ type => 'pilot_subscriber_id' })->id,
val => $pilot_subscriber->id,
event_timestamp => $now_hires,
});
my $pilot_prov_subscriber = $pilot_subscriber->provisioning_voip_subscriber;
save_e164(
schema => $schema,
event => $event,
number => $pilot_subscriber->primary_number,
types_prefix => 'pilot_primary_number_',
now_hires => $now_hires,
tags_rs => $tags_rs,
relations_rs => $relations_rs,
);
save_subscriber_profile(
schema => $schema,
event => $event,
subscriber_profile => ($pilot_prov_subscriber ? $pilot_prov_subscriber->voip_subscriber_profile : undef),
types_prefix => 'pilot_subscriber_profile_',
now_hires => $now_hires,
tags_rs => $tags_rs,
relations_rs => $relations_rs,
);
save_subscriber_profile_set(
schema => $schema,
event => $event,
subscriber_profile_set => ($pilot_prov_subscriber ? $pilot_prov_subscriber->voip_subscriber_profile_set : undef),
types_prefix => 'pilot_subscriber_profile_set_',
now_hires => $now_hires,
tags_rs => $tags_rs,
relations_rs => $relations_rs,
);
}
}
return $pilot_subscriber;
}
sub save_e164 {
sub save_voip_number {
my %params = @_;
my ($schema,
$event,
@ -236,6 +320,83 @@ sub save_subscriber_profile_set {
}
}
sub save_first_non_primary_alias {
my %params = @_;
my ($schema,
$event,
$aliases,
$prov_subscriber,
$types_prefix,
$types_suffix,
$now_hires,
$tags_rs) = @params{qw/
schema
event
aliases
prov_subscriber
types_prefix
types_suffix
now_hires
tags_rs
/};
my $alias_username = undef;
if ($aliases) {
#my $alias = shift(sort { $a->{is_primary} <=> $b->{is_primary} || $a->{id} <=> $b->{id}; } @$aliases);
my $alias = $aliases->[0]; #expect the ary sorted
$alias_username = $alias->{username} if $alias;
} elsif ($prov_subscriber) {
my $alias = _get_aliases_sorted_rs($prov_subscriber)->first;
$alias_username = $alias->username if $alias;
}
if ($alias_username) {
$tags_rs //= $schema->resultset('events_tag');
$event->create_related("tag_data", {
tag_id => $tags_rs->find({ type => $types_prefix.'first_non_primary_alias_username'.$types_suffix })->id,
val => $alias_username,
event_timestamp => $now_hires,
});
}
}
sub _get_aliases_sorted_rs {
my $prov_subscriber = shift;
return $prov_subscriber->voip_dbaliases->search_rs({
is_primary => 0,
},{
#previously in ngcpcfg: #order_by => { -asc => ['is_primary', 'id'] },
order_by => { -asc => 'is_primary' },
});
}
sub get_aliases_snapshot {
my %params = @_;
my $c = $params{c};
my $schema = $params{schema} // $c->model('DB');
my @aliases = ();
my @pilot_aliases = ();
my $subscriber = $params{subscriber} // $schema->resultset('voip_subscribers')->find({
id => $params{subscriber_id},
});
my $prov_subscriber = $subscriber->provisioning_voip_subscriber;
foreach my $alias (_get_aliases_sorted_rs($prov_subscriber)->all) {
push(@aliases,{ $alias->get_inflated_columns });
}
my $pilot_subscriber = _get_pilot_subscriber(
c => $c,
schema => $schema,
subscriber => $subscriber,
prov_subscriber => $prov_subscriber,
);
if ($pilot_subscriber) {
my $pilot_prov_subscriber = $pilot_subscriber->provisioning_voip_subscriber;
foreach my $alias (_get_aliases_sorted_rs($pilot_prov_subscriber)->all) {
push(@pilot_aliases,{ $alias->get_inflated_columns });
}
}
return { old_aliases => \@aliases, old_pilot_aliases => \@pilot_aliases };
}
sub get_actual_billing_mapping {
my %params = @_;
my ($c,$schema,$contract,$now) = @params{qw/c schema contract now/};
@ -280,5 +441,3 @@ sub get_tag_value {
}
1;
# vim: set tabstop=4 expandtab:

@ -157,6 +157,7 @@ sub create_subscriber {
my $params = $params{params};
my $administrative = $params{admin_default};
my $preferences = $params{preferences};
my $event_context = $params{event_context} // {};
my $schema = $params{schema} // $c->model('DB');
my $reseller = $contract->contact->reseller;
@ -265,6 +266,13 @@ sub create_subscriber {
create_timestamp => NGCP::Panel::Utils::DateTime::current_local,
});
my $aliases_before = NGCP::Panel::Utils::Events::get_aliases_snapshot(
c => $c,
schema => $schema,
subscriber => $billing_subscriber,
);
$event_context->{aliases_before} = $aliases_before;
if(defined $params->{e164range} && ref $params->{e164range} eq "ARRAY") {
my @alias_numbers = ();
foreach my $range(@{ $params->{e164range} }) {
@ -352,19 +360,38 @@ sub create_subscriber {
}
if($prov_subscriber->profile_id) {
NGCP::Panel::Utils::Events::insert(
c => $c, schema => $schema, subscriber => $billing_subscriber,
type => 'start_profile', old => undef, new => $prov_subscriber->profile_id
);
my $events_to_create = $event_context->{events_to_create};
if (defined $events_to_create) {
push(@$events_to_create,{
subscriber_id => $billing_subscriber->id,
type => 'start_profile', old => undef, new => $prov_subscriber->profile_id,
%$aliases_before,
});
} else {
NGCP::Panel::Utils::Events::insert(
c => $c, schema => $schema, subscriber => $billing_subscriber,
type => 'start_profile', old => undef, new => $prov_subscriber->profile_id,
%$aliases_before,
);
}
}
if($prov_subscriber->is_pbx_group) {
NGCP::Panel::Utils::Events::insert(
c => $c, schema => $schema, subscriber => $billing_subscriber,
type => 'start_huntgroup', old => undef, new => $prov_subscriber->profile_id
);
my $events_to_create = $event_context->{events_to_create};
if (defined $events_to_create) {
push(@$events_to_create,{
subscriber_id => $billing_subscriber->id,
type => 'start_huntgroup', old => undef, new => $prov_subscriber->profile_id,
%$aliases_before,
});
} else {
NGCP::Panel::Utils::Events::insert(
c => $c, schema => $schema, subscriber => $billing_subscriber,
type => 'start_huntgroup', old => undef, new => $prov_subscriber->profile_id,
%$aliases_before,
);
}
}
return $billing_subscriber;
});
}
@ -1003,6 +1030,7 @@ sub update_subadmin_sub_aliases {
});
}
}
}
sub terminate {
@ -1013,36 +1041,48 @@ sub terminate {
my $schema = $c->model('DB');
$schema->txn_do(sub {
my $prov_subscriber = $subscriber->provisioning_voip_subscriber;
my @events_to_create = ();
my $aliases_before = NGCP::Panel::Utils::Events::get_aliases_snapshot(
c => $c,
schema => $schema,
subscriber => $subscriber,
);
my $aliases_after = { new_aliases => [] };
$aliases_after->{new_pilot_aliases} = [] if $prov_subscriber && $prov_subscriber->is_pbx_pilot;
if($prov_subscriber) {
foreach my $set ($prov_subscriber->voip_cf_destination_sets->all) {
my $autoattendant = check_dset_autoattendant_status($set);
if ($autoattendant) {
foreach my $map ($set->voip_cf_mappings->all) {
NGCP::Panel::Utils::Events::insert(
c => $c, schema => $schema,
subscriber => $subscriber, type => 'end_ivr',
);
push(@events_to_create,{
subscriber_id => $subscriber->id, type => 'end_ivr',
%$aliases_before,%$aliases_after,
});
}
}
}
}
if($prov_subscriber && $prov_subscriber->profile_id) {
NGCP::Panel::Utils::Events::insert(
c => $c, schema => $schema,
subscriber => $subscriber, type => 'stop_profile',
old => $prov_subscriber->profile_id, new => undef,
);
}
if($prov_subscriber && $prov_subscriber->is_pbx_group) {
$schema->resultset('voip_pbx_groups')->search({
group_id => $subscriber->provisioning_voip_subscriber->id,
})->delete;
NGCP::Panel::Utils::Events::insert(
c => $c, schema => $schema, type => 'end_huntgroup',
subscriber => $subscriber,
push(@events_to_create,{
type => 'end_huntgroup',
subscriber_id => $subscriber->id,
old => $prov_subscriber->profile_id, new => undef,
%$aliases_before,%$aliases_after,
});
}
if($prov_subscriber && $prov_subscriber->profile_id) {
push(@events_to_create,{
subscriber_id => $subscriber->id, type => 'stop_profile',
old => $prov_subscriber->profile_id, new => undef,
);
%$aliases_before,%$aliases_after,
});
}
if($prov_subscriber && !$prov_subscriber->is_pbx_pilot) {
my $pilot_rs = $schema->resultset('voip_subscribers')->search({
@ -1101,6 +1141,12 @@ sub terminate {
->delete;
}
}
NGCP::Panel::Utils::Events::insert_deferred(
c => $c,
schema => $schema,
events_to_create => \@events_to_create,
);
#ready for number change events here
$prov_subscriber->delete;
}

@ -64,16 +64,30 @@ $billing_profile_id =~ s/^.+\/(\d+)$/$1/;
$req = HTTP::Request->new('POST', $uri.'/api/subscriberprofilesets/');
$req->header('Content-Type' => 'application/json');
$req->content(JSON::to_json({
name => "subscriber_profile_set_".$t,
name => "subscriber_profile_1_set_".$t,
reseller_id => $reseller_id,
description => "subscriber_profile_set_description_".$t,
description => "subscriber_profile_1_set_description_".$t,
}));
$res = $ua->request($req);
is($res->code, 201, "POST test subscriberprofileset");
is($res->code, 201, "POST test subscriberprofileset 1");
$req = HTTP::Request->new('GET', $uri.'/'.$res->header('Location'));
$res = $ua->request($req);
is($res->code, 200, "fetch POSTed test subscriberprofileset");
my $subscriberprofileset = JSON::from_json($res->decoded_content);
is($res->code, 200, "fetch POSTed test subscriberprofileset 1");
my $subscriberprofile1set = JSON::from_json($res->decoded_content);
$req = HTTP::Request->new('POST', $uri.'/api/subscriberprofilesets/');
$req->header('Content-Type' => 'application/json');
$req->content(JSON::to_json({
name => "subscriber_profile_2_set_".$t,
reseller_id => $reseller_id,
description => "subscriber_profile_2_set_description_".$t,
}));
$res = $ua->request($req);
is($res->code, 201, "POST test subscriberprofileset 2");
$req = HTTP::Request->new('GET', $uri.'/'.$res->header('Location'));
$res = $ua->request($req);
is($res->code, 200, "fetch POSTed test subscriberprofileset 2");
my $subscriberprofile2set = JSON::from_json($res->decoded_content);
$req = HTTP::Request->new('GET', $uri.'/api/subscriberpreferencedefs/');
$res = $ua->request($req);
@ -88,17 +102,34 @@ foreach my $attr (keys %$subscriberpreferencedefs) {
$req = HTTP::Request->new('POST', $uri.'/api/subscriberprofiles/');
$req->header('Content-Type' => 'application/json');
$req->content(JSON::to_json({
name => "subscriber_profile_".$t,
profile_set_id => $subscriberprofileset->{id},
name => "subscriber_profile_1_".$t,
profile_set_id => $subscriberprofile1set->{id},
attributes => \@subscriber_profile_attributes,
description => "subscriber_profile_description_".$t,
description => "subscriber_profile_1_description_".$t,
}));
$res = $ua->request($req);
is($res->code, 201, "POST test subscriberprofile");
is($res->code, 201, "POST test subscriberprofile 1");
$req = HTTP::Request->new('GET', $uri.'/'.$res->header('Location'));
$res = $ua->request($req);
is($res->code, 200, "fetch POSTed test subscriberprofile");
my $subscriberprofile = JSON::from_json($res->decoded_content);
is($res->code, 200, "fetch POSTed test subscriberprofile 1");
my $subscriberprofile1 = JSON::from_json($res->decoded_content);
$req = HTTP::Request->new('POST', $uri.'/api/subscriberprofiles/');
$req->header('Content-Type' => 'application/json');
$req->content(JSON::to_json({
name => "subscriber_profile_2_".$t,
profile_set_id => $subscriberprofile2set->{id},
attributes => \@subscriber_profile_attributes,
description => "subscriber_profile_2_description_".$t,
}));
$res = $ua->request($req);
is($res->code, 201, "POST test subscriberprofile 2");
$req = HTTP::Request->new('GET', $uri.'/'.$res->header('Location'));
$res = $ua->request($req);
is($res->code, 200, "fetch POSTed test subscriberprofile 2");
my $subscriberprofile2 = JSON::from_json($res->decoded_content);
$req = HTTP::Request->new('POST', $uri.'/api/customercontacts/');
$req->header('Content-Type' => 'application/json');
@ -119,7 +150,7 @@ my %subscriber_map = ();
my %customer_map = ();
#goto SKIP;
{
{ #end_ivr:
my $customer = _create_customer(
type => "sipaccount",
);
@ -147,7 +178,7 @@ my %customer_map = ();
#$t = time;
#SKIP:
{
{ #end_ivr:
my $customer = _create_customer(
type => "sipaccount",
@ -218,7 +249,7 @@ my %customer_map = ();
}
{
{ #end_ivr:
my $customer = _create_customer(
type => "sipaccount",
);
@ -233,55 +264,220 @@ my %customer_map = ();
],
}});
_update_subscriber($subscriber, status => 'terminated');
_check_event_history("events generated terminating the susbcriber: ",$subscriber->{id},"%ivr",[
_check_event_history("events generated when terminating the subscriber: ",$subscriber->{id},"%ivr",[
{ subscriber_id => $subscriber->{id}, type => "start_ivr" },
{ subscriber_id => $subscriber->{id}, type => "end_ivr" },
]);
}
#SKIP:
{
#cloudpbx = 0 only
#{ #pilot_primary_number, primary_number:
#
# my $customer = _create_customer(
# type => "pbxaccount",
# );
# my $cc = "888";
# my $pilot_ac = undef; #'3'.(scalar keys %subscriber_map);
# my $pilot_sn = $t.(scalar keys %subscriber_map);
# my $pilot_subscriber = _create_subscriber($customer,
# primary_number => { cc => $cc, ac => $pilot_ac, sn => $pilot_sn },
# is_pbx_pilot => JSON::true,
# profile_id => $subscriberprofile1->{id},
# profile_set_id => $subscriberprofile1set->{id},
# );
# my $ac = undef; #'3'.(scalar keys %subscriber_map);
# my $sn = ($t+1).(scalar keys %subscriber_map);
# my $subscriber = _create_subscriber($customer,
# primary_number => { cc => $cc, ac => $ac, sn => $sn },
# profile_id => $subscriberprofile1->{id},
# profile_set_id => $subscriberprofile1set->{id},
# );
# #_update_subscriber($subscriber,
# _check_event_history("start_profile when creating a pbx pilot subscriber: ",$pilot_subscriber->{id},"start_profile",[
# { subscriber_id => $pilot_subscriber->{id}, type => "start_profile",
# subscriber_profile_id => $subscriberprofile1->{id}, subscriber_profile_name => $subscriberprofile1->{name},
# subscriber_profile_set_id => $subscriberprofile1set->{id}, subscriber_profile_set_name => $subscriberprofile1set->{name},
# primary_number_cc => $cc, primary_number_ac => $pilot_ac, primary_number_sn => $pilot_sn,
# pilot_subscriber_id => $pilot_subscriber->{id},
# pilot_subscriber_profile_id => $subscriberprofile1->{id}, pilot_subscriber_profile_name => $subscriberprofile1->{name},
# pilot_subscriber_profile_set_id => $subscriberprofile1set->{id}, pilot_subscriber_profile_set_name => $subscriberprofile1set->{name},
# pilot_primary_number_cc => $cc, pilot_primary_number_ac => $pilot_ac, pilot_primary_number_sn => $pilot_sn,
# },
# ]);
# _check_event_history("start_profile when creating a pbx subscriber: ",$subscriber->{id},"start_profile",[
# { subscriber_id => $subscriber->{id}, type => "start_profile",
# subscriber_profile_id => $subscriberprofile1->{id}, subscriber_profile_name => $subscriberprofile1->{name},
# subscriber_profile_set_id => $subscriberprofile1set->{id}, subscriber_profile_set_name => $subscriberprofile1set->{name},
# primary_number_cc => $cc, primary_number_ac => $ac, primary_number_sn => $sn,
# pilot_subscriber_id => $pilot_subscriber->{id},
# pilot_subscriber_profile_id => $subscriberprofile1->{id}, pilot_subscriber_profile_name => $subscriberprofile1->{name},
# pilot_subscriber_profile_set_id => $subscriberprofile1set->{id}, pilot_subscriber_profile_set_name => $subscriberprofile1set->{name},
# pilot_primary_number_cc => $cc, pilot_primary_number_ac => $pilot_ac, pilot_primary_number_sn => $pilot_sn,
# },
# ]);
#
#}
#SKIP:
{ #pilot_primary_number, primary_number, pilot_first_non_primary_alias, susbcriber_first_non_primary_alias:
my $customer = _create_customer(
type => "pbxaccount",
);
my $cc = "888";
my $pilot_ac = undef; #'3'.(scalar keys %subscriber_map);
my $pilot_sn = $t.(scalar keys %subscriber_map);
my $ac = 5; #'3'.(scalar keys %subscriber_map);
my $sn = $t.(scalar keys %subscriber_map);
my $pilot_aliases = [
{ cc => $cc, ac => $ac, sn => $sn.'0001' },
{ cc => $cc, ac => $ac, sn => $sn.'0002' },
#{ cc => $cc, ac => $ac, sn => $sn.'0003' },
#{ cc => $cc, ac => $ac, sn => $sn.'0004' },
#{ cc => $cc, ac => $ac, sn => $sn.'0005' },
];
my $pilot_subscriber = _create_subscriber($customer,
primary_number => { cc => $cc, ac => $pilot_ac, sn => $pilot_sn },
primary_number => { cc => $cc, ac => $ac, sn => $sn },
alias_numbers => $pilot_aliases,
profile_id => $subscriberprofile1->{id},
profile_set_id => $subscriberprofile1set->{id},
is_pbx_pilot => JSON::true,
profile_id => $subscriberprofile->{id},
profile_set_id => $subscriberprofileset->{id},
);
my $ac = undef; #'3'.(scalar keys %subscriber_map);
my $sn = ($t+1).(scalar keys %subscriber_map);
my $ext = '1';
my $aliases = [
{ cc => $cc, ac => $ac, sn => $sn.'0003' },
{ cc => $cc, ac => $ac, sn => $sn.'0004' },
];
my $subscriber = _create_subscriber($customer,
primary_number => { cc => $cc, ac => $ac, sn => $sn },
profile_id => $subscriberprofile->{id},
profile_set_id => $subscriberprofileset->{id},
pbx_extension => $ext,
alias_numbers => $aliases,
profile_id => $subscriberprofile1->{id},
profile_set_id => $subscriberprofile1set->{id},
);
#_update_subscriber($subscriber,
_check_event_history("events when creating a pbx pilot subscriber: ",$pilot_subscriber->{id},"start_profile",[
_check_event_history("start_profile when creating a pbx pilot subscriber w alias: ",$pilot_subscriber->{id},"start_profile",[
{ subscriber_id => $pilot_subscriber->{id}, type => "start_profile",
subscriber_profile_id => $subscriberprofile->{id}, subscriber_profile_name => $subscriberprofile->{name},
subscriber_profile_set_id => $subscriberprofileset->{id}, subscriber_profile_set_name => $subscriberprofileset->{name},
primary_number_cc => $cc, primary_number_ac => $pilot_ac, primary_number_sn => $pilot_sn,
subscriber_profile_id => $subscriberprofile1->{id}, subscriber_profile_name => $subscriberprofile1->{name},
subscriber_profile_set_id => $subscriberprofile1set->{id}, subscriber_profile_set_name => $subscriberprofile1set->{name},
primary_number_cc => $cc, primary_number_ac => $ac, primary_number_sn => $sn,
pilot_subscriber_id => $pilot_subscriber->{id},
pilot_subscriber_profile_id => $subscriberprofile->{id}, pilot_subscriber_profile_name => $subscriberprofile->{name},
pilot_subscriber_profile_set_id => $subscriberprofileset->{id}, pilot_subscriber_profile_set_name => $subscriberprofileset->{name},
pilot_primary_number_cc => $cc, pilot_primary_number_ac => $pilot_ac, pilot_primary_number_sn => $pilot_sn,
pilot_subscriber_profile_id => $subscriberprofile1->{id}, pilot_subscriber_profile_name => $subscriberprofile1->{name},
pilot_subscriber_profile_set_id => $subscriberprofile1set->{id}, pilot_subscriber_profile_set_name => $subscriberprofile1set->{name},
pilot_primary_number_cc => $cc, pilot_primary_number_ac => $ac, pilot_primary_number_sn => $sn,
first_non_primary_alias_username_before => undef,
first_non_primary_alias_username_after => $pilot_aliases->[0]->{cc}.$pilot_aliases->[0]->{ac}.$pilot_aliases->[0]->{sn},
pilot_first_non_primary_alias_username_before => undef,
pilot_first_non_primary_alias_username_after => $pilot_aliases->[0]->{cc}.$pilot_aliases->[0]->{ac}.$pilot_aliases->[0]->{sn},
},
]);
_check_event_history("events when creating a pbx subscriber: ",$subscriber->{id},"start_profile",[
_check_event_history("start_profile when creating a pbx extension subscriber w alias: ",$subscriber->{id},"start_profile",[
{ subscriber_id => $subscriber->{id}, type => "start_profile",
subscriber_profile_id => $subscriberprofile->{id}, subscriber_profile_name => $subscriberprofile->{name},
subscriber_profile_set_id => $subscriberprofileset->{id}, subscriber_profile_set_name => $subscriberprofileset->{name},
subscriber_profile_id => $subscriberprofile1->{id}, subscriber_profile_name => $subscriberprofile1->{name},
subscriber_profile_set_id => $subscriberprofile1set->{id}, subscriber_profile_set_name => $subscriberprofile1set->{name},
primary_number_cc => $cc, primary_number_ac => $ac, primary_number_sn => $sn.$ext,
pilot_subscriber_id => $pilot_subscriber->{id},
pilot_subscriber_profile_id => $subscriberprofile1->{id}, pilot_subscriber_profile_name => $subscriberprofile1->{name},
pilot_subscriber_profile_set_id => $subscriberprofile1set->{id}, pilot_subscriber_profile_set_name => $subscriberprofile1set->{name},
pilot_primary_number_cc => $cc, pilot_primary_number_ac => $ac, pilot_primary_number_sn => $sn,
first_non_primary_alias_username_before => undef,
first_non_primary_alias_username_after => $aliases->[0]->{cc}.$aliases->[0]->{ac}.$aliases->[0]->{sn},
pilot_first_non_primary_alias_username_before => $pilot_aliases->[0]->{cc}.$pilot_aliases->[0]->{ac}.$pilot_aliases->[0]->{sn},
pilot_first_non_primary_alias_username_after => $pilot_aliases->[0]->{cc}.$pilot_aliases->[0]->{ac}.$pilot_aliases->[0]->{sn},
},
]);
my $new_aliases = [
{ cc => $cc, ac => $ac, sn => $sn.'0005' },
{ cc => $cc, ac => $ac, sn => $sn.'0006' },
];
_update_subscriber($subscriber,
alias_numbers => $new_aliases,
profile_id => $subscriberprofile2->{id},
profile_set_id => $subscriberprofile2set->{id},
);
_check_event_history("update_profile when updating a pbx extension subscriber w alias: ",$subscriber->{id},"update_profile",[
{ subscriber_id => $subscriber->{id}, type => "update_profile",
subscriber_profile_id => $subscriberprofile2->{id}, subscriber_profile_name => $subscriberprofile2->{name},
subscriber_profile_set_id => $subscriberprofile2set->{id}, subscriber_profile_set_name => $subscriberprofile2set->{name},
primary_number_cc => $cc, primary_number_ac => $ac, primary_number_sn => $sn.$ext,
pilot_subscriber_id => $pilot_subscriber->{id},
pilot_subscriber_profile_id => $subscriberprofile1->{id}, pilot_subscriber_profile_name => $subscriberprofile1->{name},
pilot_subscriber_profile_set_id => $subscriberprofile1set->{id}, pilot_subscriber_profile_set_name => $subscriberprofile1set->{name},
pilot_primary_number_cc => $cc, pilot_primary_number_ac => $ac, pilot_primary_number_sn => $sn,
first_non_primary_alias_username_before => $aliases->[0]->{cc}.$aliases->[0]->{ac}.$aliases->[0]->{sn},
first_non_primary_alias_username_after => $new_aliases->[0]->{cc}.$new_aliases->[0]->{ac}.$new_aliases->[0]->{sn},
pilot_first_non_primary_alias_username_before => $pilot_aliases->[0]->{cc}.$pilot_aliases->[0]->{ac}.$pilot_aliases->[0]->{sn},
pilot_first_non_primary_alias_username_after => $pilot_aliases->[0]->{cc}.$pilot_aliases->[0]->{ac}.$pilot_aliases->[0]->{sn},
},
]);
my $new_pilot_aliases = [
{ cc => $cc, ac => $ac, sn => $sn.'0003' },
{ cc => $cc, ac => $ac, sn => $sn.'0004' },
];
_update_subscriber($pilot_subscriber,
alias_numbers => $new_pilot_aliases,
profile_id => $subscriberprofile2->{id},
profile_set_id => $subscriberprofile2set->{id},
);
_check_event_history("update_profile when updating a pbx pilot subscriber w alias: ",$pilot_subscriber->{id},"update_profile",[
{ subscriber_id => $pilot_subscriber->{id}, type => "update_profile",
subscriber_profile_id => $subscriberprofile2->{id}, subscriber_profile_name => $subscriberprofile2->{name},
subscriber_profile_set_id => $subscriberprofile2set->{id}, subscriber_profile_set_name => $subscriberprofile2set->{name},
primary_number_cc => $cc, primary_number_ac => $ac, primary_number_sn => $sn,
pilot_subscriber_id => $pilot_subscriber->{id},
pilot_subscriber_profile_id => $subscriberprofile2->{id}, pilot_subscriber_profile_name => $subscriberprofile2->{name},
pilot_subscriber_profile_set_id => $subscriberprofile2set->{id}, pilot_subscriber_profile_set_name => $subscriberprofile2set->{name},
pilot_primary_number_cc => $cc, pilot_primary_number_ac => $ac, pilot_primary_number_sn => $sn,
first_non_primary_alias_username_before => $pilot_aliases->[0]->{cc}.$pilot_aliases->[0]->{ac}.$pilot_aliases->[0]->{sn},
first_non_primary_alias_username_after => $new_pilot_aliases->[0]->{cc}.$new_pilot_aliases->[0]->{ac}.$new_pilot_aliases->[0]->{sn},
pilot_first_non_primary_alias_username_before => $pilot_aliases->[0]->{cc}.$pilot_aliases->[0]->{ac}.$pilot_aliases->[0]->{sn},
pilot_first_non_primary_alias_username_after => $new_pilot_aliases->[0]->{cc}.$new_pilot_aliases->[0]->{ac}.$new_pilot_aliases->[0]->{sn},
},
]);
_update_subscriber($subscriber, status => 'terminated');
_check_event_history("stop_profile when terminating a pbx extension subscriber w alias: ",$subscriber->{id},"stop_profile",[
{ subscriber_id => $subscriber->{id}, type => "stop_profile",
subscriber_profile_id => $subscriberprofile2->{id}, subscriber_profile_name => $subscriberprofile2->{name},
subscriber_profile_set_id => $subscriberprofile2set->{id}, subscriber_profile_set_name => $subscriberprofile2set->{name},
primary_number_cc => $cc, primary_number_ac => $ac, primary_number_sn => $sn.$ext,
pilot_subscriber_id => $pilot_subscriber->{id},
pilot_subscriber_profile_id => $subscriberprofile2->{id}, pilot_subscriber_profile_name => $subscriberprofile2->{name},
pilot_subscriber_profile_set_id => $subscriberprofile2set->{id}, pilot_subscriber_profile_set_name => $subscriberprofile2set->{name},
pilot_primary_number_cc => $cc, pilot_primary_number_ac => $ac, pilot_primary_number_sn => $sn,
first_non_primary_alias_username_before => $new_aliases->[0]->{cc}.$new_aliases->[0]->{ac}.$new_aliases->[0]->{sn},
first_non_primary_alias_username_after => undef,
pilot_first_non_primary_alias_username_before => $new_pilot_aliases->[0]->{cc}.$new_pilot_aliases->[0]->{ac}.$new_pilot_aliases->[0]->{sn},
#would be this:
#pilot_first_non_primary_alias_username_after => $new_pilot_aliases->[0]->{cc}.$new_pilot_aliases->[0]->{ac}.$new_pilot_aliases->[0]->{sn},
#but since api termination always returns aliases to the pilot:
pilot_first_non_primary_alias_username_after => $new_aliases->[0]->{cc}.$new_aliases->[0]->{ac}.$new_aliases->[0]->{sn},
},
]);
_update_subscriber($pilot_subscriber, status => 'terminated');
_check_event_history("stop_profile when terminating a pbx pilot subscriber w alias: ",$pilot_subscriber->{id},"stop_profile",[
{ subscriber_id => $pilot_subscriber->{id}, type => "stop_profile",
subscriber_profile_id => $subscriberprofile2->{id}, subscriber_profile_name => $subscriberprofile2->{name},
subscriber_profile_set_id => $subscriberprofile2set->{id}, subscriber_profile_set_name => $subscriberprofile2set->{name},
primary_number_cc => $cc, primary_number_ac => $ac, primary_number_sn => $sn,
pilot_subscriber_id => $pilot_subscriber->{id},
pilot_subscriber_profile_id => $subscriberprofile->{id}, pilot_subscriber_profile_name => $subscriberprofile->{name},
pilot_subscriber_profile_set_id => $subscriberprofileset->{id}, pilot_subscriber_profile_set_name => $subscriberprofileset->{name},
pilot_primary_number_cc => $cc, pilot_primary_number_ac => $pilot_ac, pilot_primary_number_sn => $pilot_sn,
pilot_subscriber_profile_id => $subscriberprofile2->{id}, pilot_subscriber_profile_name => $subscriberprofile2->{name},
pilot_subscriber_profile_set_id => $subscriberprofile2set->{id}, pilot_subscriber_profile_set_name => $subscriberprofile2set->{name},
pilot_primary_number_cc => $cc, pilot_primary_number_ac => $ac, pilot_primary_number_sn => $sn,
#would be this:
#$new_pilot_aliases->[0]->{cc}.$new_pilot_aliases->[0]->{ac}.$new_pilot_aliases->[0]->{sn},
#but since api termination always returns aliases to the pilot:
first_non_primary_alias_username_before => $new_aliases->[0]->{cc}.$new_aliases->[0]->{ac}.$new_aliases->[0]->{sn},
first_non_primary_alias_username_after => undef,
pilot_first_non_primary_alias_username_before => $new_aliases->[0]->{cc}.$new_aliases->[0]->{ac}.$new_aliases->[0]->{sn},
pilot_first_non_primary_alias_username_after => undef,
},
]);

Loading…
Cancel
Save