TT#8878 end_ivr event upon terminating a susbcriber

Change-Id: I69b72ed18174eed19bb41c3a9b78f680aa1c0ee4
changes/62/10862/1
Rene Krenn 8 years ago
parent ab375e637b
commit 05eb8f6ec1

@ -1014,6 +1014,19 @@ sub terminate {
my $schema = $c->model('DB');
$schema->txn_do(sub {
my $prov_subscriber = $subscriber->provisioning_voip_subscriber;
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',
);
}
}
}
}
if($prov_subscriber && $prov_subscriber->profile_id) {
NGCP::Panel::Utils::Events::insert(
c => $c, schema => $schema,

@ -218,6 +218,27 @@ my %customer_map = ();
}
{
my $customer = _create_customer(
type => "sipaccount",
);
my $subscriber = _create_subscriber($customer,
primary_number => { cc => 888, ac => '3'.(scalar keys %subscriber_map), sn => $t },
);
my $call_forwards = set_callforwards($subscriber,{ cfu => {
destinations => [
{ destination => "5678" },
{ destination => "autoattendant", },
],
}});
_update_subscriber($subscriber, status => 'terminated');
_check_event_history("events generated terminating the susbcriber: ",$subscriber->{id},"%ivr",[
{ subscriber_id => $subscriber->{id}, type => "start_ivr" },
{ subscriber_id => $subscriber->{id}, type => "end_ivr" },
]);
}
#SKIP:
{

Loading…
Cancel
Save