diff --git a/lib/NGCP/Panel/Controller/API/NumbersItem.pm b/lib/NGCP/Panel/Controller/API/NumbersItem.pm index 7478adcacd..f1c6b22afa 100644 --- a/lib/NGCP/Panel/Controller/API/NumbersItem.pm +++ b/lib/NGCP/Panel/Controller/API/NumbersItem.pm @@ -35,9 +35,6 @@ sub pre_process_form_resource { if (!exists $resource->{is_devid} && defined $item->voip_dbalias) { $resource->{is_devid} = $item->voip_dbalias->is_devid; } - if (!exists $resource->{devid_alias} && defined $item->voip_dbalias) { - $resource->{devid_alias} = $item->voip_dbalias->devid_alias; - } return 1; } @@ -109,15 +106,9 @@ sub update_item_model { (); } else { # otherwise keep number - if (!defined $_->voip_dbalias) { - $c->log->debug("+++ no oldsub dbalias for sn " . $_->sn); - } else { - $c->log->debug("+++ oldsub dbalias for sn " . $_->sn . " is " . ($_->voip_dbalias->devid_alias//"undef")); - } { e164 => { cc => $_->cc, ac => $_->ac, sn => $_->sn, is_devid => (defined $_->voip_dbalias ? $_->voip_dbalias->is_devid : 0), - devid_alias => (defined $_->voip_dbalias ? $_->voip_dbalias->devid_alias : undef), } }; } @@ -142,16 +133,9 @@ sub update_item_model { # filter number we're about to remove (); } else { - # otherwise keep number - if (!defined $_->voip_dbalias) { - $c->log->debug("+++ no newsub dbalias for sn " . $_->sn); - } else { - $c->log->debug("+++ newsub dbalias for sn " . $_->sn . " is " . ($_->voip_dbalias->devid_alias//"undef")); - } { e164 => { cc => $_->cc, ac => $_->ac, sn => $_->sn, is_devid => (defined $_->voip_dbalias ? $_->voip_dbalias->is_devid : 0), - devid_alias => (defined $_->voip_dbalias ? $_->voip_dbalias->devid_alias : undef), } }; } @@ -162,7 +146,6 @@ sub update_item_model { push @{ $newalias }, { e164 => { cc => $item->cc, ac => $item->ac, sn => $item->sn, is_devid => $resource->{is_devid} // 0, - devid_alias => $resource->{devid_alias}, } }; diff --git a/lib/NGCP/Panel/Field/AliasNumber.pm b/lib/NGCP/Panel/Field/AliasNumber.pm index 98c4b2e03e..70c1591f75 100644 --- a/lib/NGCP/Panel/Field/AliasNumber.pm +++ b/lib/NGCP/Panel/Field/AliasNumber.pm @@ -29,26 +29,10 @@ has_field 'is_devid' => ( order => 98, element_attr => { rel => ['tooltip'], - title => ['When selected, a call to this alias number is only sent to registered devices indicating either the alias number or the optional alternative device id during registration in the Display-Name.'] + title => ['When selected, it is possible to register with the alias and recieve calls directed to the alias only'] }, ); -has_field 'devid_alias' => ( - type => 'Text', - required => 0, - maxlength => 127, - label => 'Alternative Device ID', - do_label => 1, - do_wrapper => 1, - wrapper_class => [qw/hfh-rep-field/], - order => 99, - element_attr => { - rel => ['tooltip'], - title => ['An optional device id to be configured on a phone, which is associated with this alias number (e.g. "softphone").'] - }, -); - - has_field 'rm' => ( type => 'RmElement', value => 'Remove', @@ -59,7 +43,7 @@ has_field 'rm' => ( has_block 'fields' => ( tag => 'div', class => [qw/modal-body/], - render_list => [qw/e164 is_devid devid_alias/ ], + render_list => [qw/e164 is_devid/ ], ); diff --git a/lib/NGCP/Panel/Field/E164Alias.pm b/lib/NGCP/Panel/Field/E164Alias.pm index 909bdb7abc..811463ba50 100644 --- a/lib/NGCP/Panel/Field/E164Alias.pm +++ b/lib/NGCP/Panel/Field/E164Alias.pm @@ -13,22 +13,7 @@ has_field 'is_devid' => ( order => 98, element_attr => { rel => ['tooltip'], - title => ['When selected, a call to this alias number is only sent to registered devices indicating either the alias number or the optional alternative device id during registration in the Display-Name.'] - }, -); - -has_field 'devid_alias' => ( - type => 'Text', - required => 0, - maxlength => 127, - label => 'Alternative Device ID', - do_label => 1, - do_wrapper => 1, - wrapper_class => [qw/hfh-rep-field/], - order => 99, - element_attr => { - rel => ['tooltip'], - title => ['An optional device id to be configured on a phone, which is associated with this alias number (e.g. "softphone").'] + title => ['When selected, it is possible to register with the alias and recieve calls directed to the alias only'] }, ); diff --git a/lib/NGCP/Panel/Form/Number/SubadminAPI.pm b/lib/NGCP/Panel/Form/Number/SubadminAPI.pm index 9355903ea9..cd916739fc 100644 --- a/lib/NGCP/Panel/Form/Number/SubadminAPI.pm +++ b/lib/NGCP/Panel/Form/Number/SubadminAPI.pm @@ -48,20 +48,9 @@ has_field 'is_devid' => ( type => 'Boolean', element_attr => { rel => ['tooltip'], - title => ['When selected, a call to this alias number is only sent to registered devices indicating either the alias number or the optional alternative device id during registration in the Display-Name.'] + title => ['When selected, it is possible to register with the alias and recieve calls directed to the alias only'] }, ); -has_field 'devid_alias' => ( - type => 'Text', - required => 0, - maxlength => 127, - element_attr => { - rel => ['tooltip'], - title => ['An optional device id to be configured on a phone, which is associated with this alias number (e.g. "softphone").'] - }, -); - - 1; # vim: set tabstop=4 expandtab: diff --git a/lib/NGCP/Panel/Role/API/Numbers.pm b/lib/NGCP/Panel/Role/API/Numbers.pm index d72fb1804b..0f83df2e72 100644 --- a/lib/NGCP/Panel/Role/API/Numbers.pm +++ b/lib/NGCP/Panel/Role/API/Numbers.pm @@ -44,8 +44,8 @@ sub _item_rs { 'me.subscriber_id' => { '!=' => undef }, 'subscriber.status' => { '!=' => 'terminated' }, },{ - '+select' => [\'if(me.id=subscriber.primary_number_id,1,0)','voip_dbalias.is_devid','voip_dbalias.devid_alias'], - '+as' => ['is_primary','is_devid','devid_alias'], + '+select' => [\'if(me.id=subscriber.primary_number_id,1,0)','voip_dbalias.is_devid'], + '+as' => ['is_primary','is_devid'], join => ['subscriber', 'voip_dbalias'], }); if($c->user->roles eq "admin") { @@ -89,10 +89,8 @@ sub post_process_hal_resource { } if ($item->voip_dbalias) { $resource->{is_devid} = bool $item->voip_dbalias->is_devid; - $resource->{devid_alias} = $item->voip_dbalias->devid_alias; } else { $resource->{is_devid} = JSON::false; - $resource->{devid_alias} = undef; } return $resource; } diff --git a/lib/NGCP/Panel/Role/API/Subscribers.pm b/lib/NGCP/Panel/Role/API/Subscribers.pm index c65c4724f2..a420aec17c 100644 --- a/lib/NGCP/Panel/Role/API/Subscribers.pm +++ b/lib/NGCP/Panel/Role/API/Subscribers.pm @@ -116,7 +116,6 @@ sub resource_from_item { compare($resource{primary_number}, $alias)); if (defined $n->voip_dbalias) { $alias->{is_devid} = bool $n->voip_dbalias->is_devid; - $alias->{devid_alias} = $n->voip_dbalias->devid_alias; } push @{ $resource{alias_numbers} }, $alias; } diff --git a/lib/NGCP/Panel/Utils/Subscriber.pm b/lib/NGCP/Panel/Utils/Subscriber.pm index fb9966cd2e..2f5aab10ab 100644 --- a/lib/NGCP/Panel/Utils/Subscriber.pm +++ b/lib/NGCP/Panel/Utils/Subscriber.pm @@ -1503,9 +1503,6 @@ sub update_subscriber_numbers { if (exists $alias->{is_devid} && !exists $alias->{e164}->{is_devid}) { $alias->{e164}->{is_devid} = delete $alias->{is_devid}; } - if (exists $alias->{devid_alias} && !exists $alias->{e164}->{devid_alias}) { - $alias->{e164}->{devid_alias} = delete $alias->{devid_alias}; - } my $dbalias = $prov_subs->voip_dbaliases->find({ username => $cli, @@ -1514,7 +1511,6 @@ sub update_subscriber_numbers { $dbalias->update({ is_primary => 0, is_devid => $alias->{e164}->{is_devid} // 0, - devid_alias => $alias->{e164}->{devid_alias}, }); } else { $dbalias = $prov_subs->voip_dbaliases->create({ @@ -1522,7 +1518,6 @@ sub update_subscriber_numbers { domain_id => $prov_subs->domain->id, is_primary => 0, is_devid => $alias->{e164}->{is_devid} // 0, - devid_alias => $alias->{e164}->{devid_alias}, }); } if(defined $acli_pref) { @@ -1921,7 +1916,6 @@ sub prepare_alias_select { e164 => { cc => $num->cc, ac => $num->ac, sn => $num->sn }, $num->voip_dbalias ? ( is_devid => $num->voip_dbalias->is_devid, - devid_alias => $num->voip_dbalias->devid_alias, ) : (), }; unless($unselect) { diff --git a/share/templates/subscriber/master.tt b/share/templates/subscriber/master.tt index 258bb2af88..7d821f7a83 100644 --- a/share/templates/subscriber/master.tt +++ b/share/templates/subscriber/master.tt @@ -114,7 +114,7 @@ [% FOR num IN subscriber.voip_numbers.all -%] [% NEXT IF num.id == subscriber.primary_number.id -%] - [% num.cc %] [% num.ac %] [% num.sn %] [% IF num.voip_dbalias.is_devid %] [% num.voip_dbalias.devid_alias.length ? "(" _ num.voip_dbalias.devid_alias _ ")" : "" %] [% END %]
+ [% num.cc %] [% num.ac %] [% num.sn %] [% IF num.voip_dbalias.is_devid %][% END %]
[% END -%]