* subscriberadmin and subscriber can now use /api/mailtofaxsettings
* adapt item_rs query for subscriberadmin and subscriber so that
subscriberadmin can have access to all 'own' subscribers
Change-Id: If8e768c5c06bc4e5f0a6ef9d15e19f542d8b6a4d
* if Accept: applicaton/json header is provided for API
request - the response's Content-Type header is set to
application/json. The return content in this case is preserved
as HAL but it's helpful for the clients that only expect
aplication/json response Content-Type
Change-Id: I8c60da4df7d639f45953d8ace699a59fefc88ddf
* consider as the "same number" if old/new primary numbers are empty
(undefined in the database as if a primary number exists at least cc
and sn are mandatory).
* check for new primary number "cc" existence when preparing comparsion
to the existing primary number, as some clients may send an object
value with null cc+ac+sn.
Change-Id: I810cda7d7aa07f2d7e46dbca099bc327ef7b4963
creating or updating subscriber (-aliases) will
modify the allowedcli (acli) preference, if the
auto_allow_cli config option is set. the primary
number will also be part of the acli list.
when specifying ?create_primary_acli=false or
?create_primary_acli=0, the primary alias will
no longer be added to acli.
Change-Id: I4641e2b973de2afe2e36805140b1546cac2a699a
This new flag controls wether the CF is processed as usual
(flag with value 0, default) or generates a 302 redirect message
back to the caller (flag with value 1).
The implementation cover both the UI and the API.
Change-Id: Idf945262e17de0d77bb612101d268fd6ea7a309e
s/paramaters/parameters/
s/wihout/without/
s/If it mathes/If it matches/
s/ in in / in /
s/the the/the/ (note: fixes translation issue which was introduced with
commit 2b7a1a33 and fixed in 072e897c for the original, but missed
for the german translation)
Change-Id: I4186bf3f42b1fac11bb7d7fe801f860d2d59adc1
* POST /api/subscribers/ invoke lock_provisioning_voip_subscriber()
before underrun_lock(), so that if the subscriber is about
to be locked due to customer balance costs, the
lock_provisioning_lock_subscriber() invocation will not unlock it
back straight after
Change-Id: I55020f844c9aa76df2e2f057a88b2ae7c9ebbfcc
* billing fees relation was rendering all associated billing fees
and that was causing huge data sets to be returned if a billing
zones had many fees, now instead a single link is returned
/api/billingfees/?billing_zone_id=:id. this is also on par
with other links like /api/billingfees/:id
Change-Id: Iabb7afb3bf43abf9a22c71750d45a1962a7f16ec
Using API is possibile to edit an existing subscriber and set
status: active and lock: 2.
It is instead impossbile to create a new subscriber with the same
configuration because the 'lock' param is not taken into account.
The only way to properly setup lock level it is to set the status
to 'locked' and this is in fact wrong.
The fix address this issue and allow now to create a new subscriber
with status: active and lock: 2.
Change-Id: Id18e40bc001c5a7de30f5d148231bda93a3b1b3d
* Entites logic is used for GET/POST/PUT/PATCH/DELETE
* Utils::CallForwards::check_destinations() do not obfuscate
destinations that are returned in the response as all
logged data is obfuscated anyways
Change-Id: Ia79f9e236c966410e2640d719c3a7f5784cc4c2a
* additional $c->has_errors checks for post/patch/put/delete to
cover all possible expected called inherited methods scenarios
and returns.
Change-Id: I0e09ba62bcaa51d582315d9cbb672a4cf11bacf0
* /api/cftimesets now fully use Entities/EntitiesItem
* EntitiesItem: delete(): fix delete_item() expression processing
* Entities/EntitiesItem: post/put/patch/delete: go to TX_END
in scenarios where after a method call (e.g. update_item()) there
is a normal return from the function but errors in $c->error, so
that they are also caught correctly
Change-Id: I3bef409ded590796c2bba4f30acd28b02e99065b
* clear errors in Controller::API::Root::end so that they are
not interfere with generated ones
* API::error(): add $c->stash->{is_api_error_response} = 1
to track it in log_response()
* API::log_response(): distinguish and correctly correct errors
for cases when is_api_response == 1 and also when there were
$c->error('error') calls in the code, to log them correctly
in both cases
Change-Id: Id922b8219832c1b99815d9d608309035b9b25cff
* the error produced by item_id_is_valid() is returned instead of
a new one is generated
* fix incorrect expression on delete_item() in delete()
Change-Id: Ic8e4e24c70bbcd99ec414d901eb2842ee39ae7de
* fix resultset when user role is reseller so that reseller_id
is joined correctly and a db error is not produced anymore.
Change-Id: I2a1b357037d983f23770bb59519fc2cb8b68a7e4
* $c->error array now contains the $message as the first element
instead, so that it's possible to obtain all the error data in
the code when fetching it from @{$c->error}. the first element
is not logged in the error log.
* api_response $c->response_body part is now stored in MSG= and
possible errors / other log data is now stored in LOG= to:
- reduce amount of log lines when an API error response occurs
from 2 to 1
- the message part usually contains either HTTP response
message (e.g. Internal Server Error) or a validation message
string, so it belongs to the MSG= part of the log line, where
as the internal log data is more related to the LOG= part
- both MSG= and LOG= parts are escaped for GDPR related obfuscation
* Utils::Messag::info(): $msg is now also obfuscated if it's detected
as a reference (also because logging is moved for the API part to
$msg), as well as truncated for possible new-line char and
white-spaces.
Change-Id: I3b670b2251ec3060037ed6863f18d95975120b8d
* the following changes resolve an issue where $now in Role/Contracts
resource_from_item appeared as an object and failed subsequent
logic:
- hal_from_contract is renamed to hal_from_item to match correctly
the parent method
- call hal_from_item and pass $now string there correctly as $params
{ now => $now }
Change-Id: I5c02d5f7df5d9000550505ad120b9531f87e8d65
* Role/Entities*: POST/PUT/PATCH/DELETE methods changes:
- support deadlock detection and transaction retry
(2 retry attempts at the moment)
- improve transaction control, use local $guard
instead of saving the ref to $c->stash, as in that
case it went out of scope too late and also reported
an error message into the log about abnormal $guard out
of scope interruption
- move all non transaction related code outside
of the scope
- add error handling when methods such as update_item,
and a like do not return the expected data, instead of
simply going out of scope and resulting in an uncontrolled
reply
* Role/API:
- rework transaction control:
+ get_transaction_control() is renamed to start_transaction()
to better reflect what it does
+ complete_transaction() is renamed to commit_transaction()
+ remove unused %params arg
+ pass $guard into commit_transaction() instead of having it
stored as $c->stash->{transaction_guard) that caused the $guard
ref to be destroyed much late than expected
(there was also a typo as transaction_quard,
which is not relevant anymore with the changes
+ add check_deadlock() that is invoked when an exception is caught
or an $c->errors contain an error, and if the error message
represents a transaction error, the transaction block is
re-invoked via "goto TX_START"
- rework error():
+ it now accepts args as following:
($self, $c, $code, $message, @errors)
# code -> returned as HTTP code in the reply
# message -> returned as HTTP message in the reply
# errors -> contain errors for internal logging, last element often contains a DBIx exception
+ populates all @errors into $c->error so they are available on
demend in the code via $c->error or $c->last_error
+ $c->log->error is not invoked now as the errors become printed
in log_response()
- log_response() now prints collected errors from $c->error correctly
as a separate log line, that is alike to the other api logs so that
those can be looked up by the request's tx_id, also all errors are
now printed only into api.log
* Adjust all $self->error() calls in catch($e) to include $e as the last
argument, as well as the duplicate $c->log->error is removed from
those ocassions
* Remove all $c->log->error() calls as they are replaced with either
$self->error() (that logs it correctly into api.log) or
$c->error('err') that also adds it correctly into api.log
* API::CallForwards: rework to use Entities/EntitiesItem
* API::Contracts: rework POST to use Entities
* API::PeeringGroups: rework POST to use Entities
* API::SubscriberRegistrations: rework POST to use Entities
* API::RewriteRuleSets: improve create_item() functionality
* Utils/Message: add 'api_retry' log type
* $c->session->{api_request_tx_id} is changed to
$c->stash->{api_request_tx_id} because sometimes the session
ref is different and a different tx_id becomes used
Change-Id: I633ce7a8047b1bf00a2f6889003088edf0825dcd
* POST /api/headerrules now supports either 'set_id' or 'subscriber_id'.
When 'subsriber_id' is specified, a subscriber assigned header rule
set is automatically created if it does not exist, as well as
automatically removed when its last header rule is deleted.
* It is now possible to directly GET and DELETE /api/headerrules/:id
where :id is a subscriber assigned header rule.
* It is now possible to directly GET and DELETE /api/headerrulesets/:id
where :id is a subscriber assigned header rule set.
* Improve /api/headerrules data validation and duplicate header rule
detection.
* It is now possible to expand by /api/headerrules/?expand=set_id field
Change-Id: I681bc61c2eed47a8e54847f07f31134f643930c2
* if the primary numner during /api/subscribers update request is
unchanged, the primary number processing related logic is not invoked,
as otherwise it's a redundant and in some cases (pilot subscriber)
time consuming operation.
Change-Id: I4cbb0387011f5241fcbdaab1efbb0d4a5caa2143
all api query param filters that were harmonized to "wildcard"
also appended leading+trailing wildcard (this was from the original
idea to make adminUI and legacy panel search behave the same).
Change-Id: I017473b84f2844d14a11b4ec8b437df5335c24d0
this filter is another spot, where leading/trailing wildcards
were added unintentionally, during harmonization.
Change-Id: Id23114f8e7ebca018ad222e35b39d8260f1da92f
* socket field is changed to text for the API endpoint as by default
in the LocationEntry form that is used by the UI the field is
a prebuilt options list that comes from config.yml extra_sockets,
and that severely limits the usage for the API.
Change-Id: I71ee1f77dbf458c12655f840282375cee62b7534
* if no balance is found for the provided period a 422
error is returned:
showdetails => $c->loc('period start=[_1] end=[_2].', $stime, $etime),
error => 'Could not find active balance.',
httpcode => HTTP_UNPROCESSABLE_ENTITY,
instead of a 500 server because of access to undefined $balance value
Change-Id: Icccb9f253d117327641b6803ac0d2cdb09cf030f
in case the DB shows discrepancy because of missing
primary provisioning.voip_dbaliases records, align with
legacy panel behaviour and also take the restapi
aliases list from voip_numbers, instead of voip_dbaliases.
.. while trying to keep the performance gain from
https://gerrit.mgm.sipwise.com/c/ngcp-panel/+/65086.
Change-Id: Ibd7f8c8bc6a39ae2c31b4e8818080674ab77d66c
* /api/rewriterules PATCH, DELETE methods used the generic
transaction, which conflicted with the xmlrpc reload command.
* own_transaction_control was only set for PUT and now also
extended to PATCH, DELETE to ensure that dialplan_sip_reload()
is called properly after $guard->commit.
Change-Id: I7313b4f6d1f6699bf38ae34749c5383a3943f61d
with the change to harmonize wildcard symbols % and *
to * in query param filters across all restapi rails,
only
- /api/subscribers?alias=
- /api/subscribers?pbx_extension=
- /api/subscribers?primary_number=
- /api/pbxdevices?pbx_extension=
are supposed to include implicit leading an trailing
wildcards.
panel UI uses trailing wildcard by default everywhere,
and so should the databales of the new Admin UI.
external_id were used to support patterns, but must
not include a trailing wildcard in rest API, as this
can break logic that rely on unique api request results.
we now therefore no longer append wildcards in particular to:
- /api/voicemails?folder=
- /api/voicemailgreetings?type=
- /api/subscribers?subscriber_external_id=
- /api/subscribers?customer_external_id=
- /api/subscribers?display_name=
- /api/subscribers?domain=
- /api/profilepackages?profile_name=
- /api/profilepackages?network_name=
- /api/pbxdevices?display_name=
- /api/faxserversettings?name_or_password=
Change-Id: I40ef1912d7224a56c6d14619d258c70e447ab23d
the /api/callists rail supports the "call_id" query parameter to match calls with a callid prefix. this filter also adds an implicity ordering ORDER BY length(call_id) ASC, 'start_time' ASC.
the /api/callists api rail also requires the query parameter "susbcriber_id", which renders a (fast) compound SQL query to list matching incoming (query1) and outgoing calls (query2) using UNION ALL (instead of a slow OR query).
query1 UNION ALL query2
this is supported by the https://metacpan.org/pod/DBIx::Class::Helper::ResultSet::SetOperations module, which however generates invalid SQL syntax if query1 or query2 contains an ORDER BY.
this is exactly what caused the 500 error of the customer who applied both "call_id" and "susbcriber_id" parameter in the request at the same time.
... ORDER BY length(call_id) ASC, `start_time` ASC UNION ALL SELECT `me`.`id`...
the error happens randomly, because query parameters are stored in a hash (which by definition has no deterministic order of the entries). when the "call_id" parameter is applied at last, it worked as expected.
so the issue can be adressed by strictly ordering the UNION ALL result, and prohibit ORDER BY in query1 and query1. the latter was added already with commit b2dfe28eed, and could be hotfixed.
however, the ORDER BY of "call_id" query param is lost, and should be properly handled by forcing strict ordering of how query parameters are applied.
the fix will introduce paramater ordering according to their order of definition in the code.
Change-Id: I165d341b5c20e9bb750bd1fba88c836b393e80bd
* get_handlers_rs() is renamed into get_file_handles() and
reworked from an indented 'from' resultset into 2 separate
resultsets, one fetching all the handles and another one
files for the sound set, it is now returned as an array with the
similar data. Reason for this rework is the deprecated use of
'from', that resulted in a lot of warnings in panel-fcgi.log:
DBIx::Class::SQLMaker::ClassicExtensions::_join_condition():
ResultSet {from} structures with conditions not conforming to the
SQL::Abstract::Classic syntax are deprecated: you either need to
stop abusing {from} altogether, or express the condition properly
using the { -ident => ... }
* adjust file_handles data key names to better follow the
naming conventions and readability, e.g.: groupname -> group_name,
fileid -> file_id
Change-Id: Ia91c9104c0b4dc79ee5bc359eb0b6e035e56ef3e
* the expected csv fields are as following:
- /api/resellerphonebookentries/?reseller_id=1
name,number
- /api/customerphonebookentries/?customer_id=1
name,number
- /api/subscriberphonebookentries/?subscriber_id=1
name,number,shared
- /api/resellerphonebookentries/
name,number,reseller_id
- /api/customerphonebookentries/
name,number,contract_id
- /api/customerphonebookentries/
name,number,shared,subcriber_id
(note: the fields are taken from the leftmost side
as the minimum required fields, so if one provides as:
- /api/resellerphonebookentries/?reseller_id=1
name,number,reseller_id
this line will be uploaded and columns after 'number' are
ignored in this case.
this is for convenience if you have a prepared upload
for different customers/resellers for instance, you can
upload it under one customer/reseller when needed
* user access scope is now validated, e.g.:
resellers cannot upload phonebook entries to another resellers,
etc.
* fix csv upload for /api/customerphonebookentries/?customer_id=1
Change-Id: I970ac36fdb8b366adff15515a48d296e8abeff13
* {"values:", ["value1", "value2"]} is not accepted by
/api/headerruleconditions
* the previous behaviour of {"values": [{"value": "value1"},{"value":
"value2"}]} is preserved
Change-Id: I7d9540d20ed0ecbb2712f1905a7d9e6f7af7e06d
* add global expand by rwr_set_id field
* adjust rwr_set_id, rule_id in Condition and Action forms
to have correct type (as they were inherited as Hidden)
Change-Id: Id2529c67919b496303cee24da2a2c63f22df23e9
- all standard LIKE search are migrated
- will avoid LIKE unless a pattern (* wildcard) is
used as a search term. this encourage db index
usage, will be faster
- supports wildcard escape sequence \\*
- harmonize swagger UI descriptions of filters
Change-Id: Iea155871c9be6c284e6970a562d4e6af73fedc4b
filtering an Entity-Attribute-Value model cannot be done as
simple conjunctions, but requires either INTERSECT set
operation, or joining the same table multiple times.
Change-Id: I5ce1ae1ece9406b6610487654f09d768a233b122
* all reseller_id-number entries are checked for POST
* reseller_id-number pairs that != item->id are checked for PUT/PATCH
Change-Id: I93a8b7fe22ed63d2d84e2d45291981d09b4af156
various api rails will need to support ?caller= and ?callee=
url query parameters.
since this involves SQL queries against potentially large
database tables, special care is taken with wildcard search
to prevent slow queries:
- the ?wildcards=true query parameter has to be specified
to accept search patterns that contain wildcard symbols,
so wildcards are not accepted by default.
WARNING: a search string with a leading wildcard will always
force a *slow* full db table scan!
- the * symbol is used as a wildcard symbol
- \ (backslash) is used as escape character to search for
a literal '*'
Change-Id: Ie6065b0cfa883f7963e1dc8259fffea9a1edfdfe
the conversation list now supports ?caller= and ?callee=
url query parameters.
since this involves SQL queries against potentially large
database tables, special care is taken with wildcard search
to prevent slow queries:
- the ?wildcard=true query parameter has to be specified
to accept search patterns that contain wildcard symbols,
so wilddcards are not accepted by default.
WARNING: a search string with a leading wildcard will always
force a *slow* full db table scan!
- the * symbol is used as a wildcard symbol
- \ (backslash) is used as escape character to search for
a literal '*'
Change-Id: I792d2ea9c649c69c4b5cc98076097cb96467d4bc
Both the parameters 'www_admin.api_embedded_forcearray' and
'www_admin.api_links_forcearray' were created long time ago
to have API backward compatible.
But the consistency of the returned values is a priority,
so we have to get rid of this option and keep the behavior
of the current default:
* always return an array
* always return lisk as an array
Change-Id: I75dccbf3b641a7e3c7f948c020cf2ebeb8a59065
The commit extends what done already in e15e40423 allowing the
subscribers to get the soundgroups and soundhandles using API.
This is necessary for some CSC features like the selection of
the Custom Announcement to play after Call Forward.
Change-Id: I40d57d1efdc107c64fe3efafd9e87d1403c4d124
* filtering by package_id with an incorrect search db query (non-existing
field) caused a 500 error
* package_id filter is renamed into profile_package_id to correspond
to the response field
* fix profile_package_id db search query
Change-Id: Ia93e0662172dd89e85572717cbb99a2ed51eb3a7
The 'duration' field is reported in the documentation as 'number'
but in fact it is a string, for example: "0:00:16.495".
In the commit the definition of the parameter is changed from
PosInteger to Text
Change-Id: I317006f5bbb5c4b7ffea0abe29dc0b175d8f95e6
while the api is strict with expecting NULL values,
we now tolerate '' (empty string) for topup and underrun
lock level values.
Change-Id: I77357f0d1152b5af43e39389f8d4d4f3e0b81b2a
In case a susbcriber or subscriber admin get the conversation list
using the API, the caller is not properly anonymized when clir is
set to 1. This is a big security hole.
With the fix, the caller is authomatically anonymized.
Of course, administrators and resellers can still see the
original caller number.
Change-Id: I9bc676718e38ae1d462f43176e4c6611528f7e54
* /api/phonebookentries is now split into 3 parts
* /api/resellerphonebookentries
* /api/customerphonebookentries
* /api/subscriberphonebookentries
main reason is because there are 3 different contexts (tables)
that in the end return "id" which is also a resource identifier
and it is not unique because the contexts handle their own ids,
another reason is to simplify code and access definitions, as well
as to have solid and easy representation.
* /api/resllerphonebookentries
* can be accessed by 'admin', 'reseller' roles
* /api/customerphonebookentries
* can be accessed by 'admin', 'reseller', 'subscriberadmin' roles
* fix contract_id field to be correctly represented as 'customer_id'
* /api/subscriberphonebookentries
* can be accessed by 'admin', 'reseller', 'subscriberadmin',
'subscriber' roles
* add 'shared' query filter
* all the new endpoints
* no more required query param fields
* customer_id is now optional query parameter filter
* add valid/existing resource checks for POST/PATCH/PUT ops
* add correct auto filtering based on the user's role
* various major code simplifications, fixes and code style improvements
* csv download now also allows query param filters to be applied
* fix documentation
Change-Id: I735df96b7a7e18006a46b82a4fcc603e400ad9e6
* allowed_ngcp_types check is now correct in the
Controller:API::Root::GET
* also fix allowed roles check
Change-Id: I2446d7377d2a1ef152560bfb2799bb9debd0f34b
* as now all profile preferences should be visible for admin users,
the excessive _check_profile() filtering is removed, as well
as it improves the performance due to less sql queries (was 1 extra query
per preference). the preferences based on attributes are correctly
filtered for subscriber and subscriberadmin 'roles'.
Change-Id: Ifaa8c7de1f73d07fce3ef0df725a01f1c5d5d80c
invoices support call direction for the summary and zone
costs, however the detailed call list (available to customer
invoices only) always shows *source* costs and zone details.
this is fixed accordingly. in&out call directions implies a
slow OR query, and is not supported, as noted in the
documentation.
Change-Id: Ib4a8a8f535a9f170b1f3ca9a6b9be36c033d439e
* URI that comes from c.req.uri must be escaped as Catalyst
provides c.req.uri unescaped.
* new Catalyst::NGCP::Plugin::EscapeURI with escape_uri()
function
* new NGCP::Panel::Utils::Generic::escape_uri() that uses
URI::Escape::uri::escape_utf8()
* c.req.uri and c.req.path occurrences in layout/body.tt are now
escaped with c.escape_uri()
Change-Id: Id0483fa6e570a0ff8db84b1d470caf5405cc0886
* when a new rewrite rule is created and the priority attribute
is not specified, only the first rewrite rule of the same rewrite
rule set is set as 50, and the following are as:
"MAX(priority) of the same rewrite rule set"+1
Change-Id: I1f1ae275e00918a34a625409987f21044b3b940f
* Max subscribers can now be defined in the Reseller contract
* Max subscribers is now shown in int Reseller's "Reseller Contract"
Details (with an indictaion of how many subscribers are created
out of the defined max subscribers, as well as when the limit
is reached (similar to the Customer's Details page)
* Add reseller subscribers count checks on the UI Create Subscriber
page
* Add reseller subscribers count checks in /api/contracts POST/PUT
* Prevent max_subscribers definition for Peering contracts in
/api/contracts POST/PUT
Change-Id: I1561d4eb7da5b1a0a0c99acabd18d2a9cd98dec7
This field controls a behavior upon cancelling unsuccessful legs:
- terminate legs with CANCEL (default way)
- terminate legs with BYE
Change-Id: I2ff5c758c319714f0e6636db8b8ba5c0fd495e1f
* secret_key can not be correctly set/updated and unset
* last_secret_key_modify behaviour is changed, if "secret_key"
is provided in the data, the value is updated, otherwise
it points to the last time when the key was updated (or unset)
Change-Id: Ib6d7f78d4e93240ac36750fc1685f1c4c765bf55
* as changes to sound sets and sound files cause
internal triggers + SP to be invoked, the gap
locking should be reduced to avoid possible
deadlocks, hence READ COMMITTED transaction
isolation level is used for all sound sets
and sound files change operations.
* fix a condition that caused an evaluation error
when both old_parent_id and parent_id are undef.
Change-Id: I7e69a0a0e5878c03b086977933315e532aaa2a29
* address an issue where get_form() logic did not return
any $form value because of the if ($params) block was
falsely used.
Change-Id: I77f03ac7914c1b4a8f072269cf2c98b99657fa52
* NCOS Levels and NCOS Sets now have expose_to_customer
option (boolean). If enabled, the NCOS Level/Set can
be seen and used by Customers in their and their subscribers'
preferences
* NCOS Levels and NCOS Sets with expose_to_customer = 0 (default)
are not visible anymore to subscribers.
* API GET /api/ncoslevels is now accessible by 'subscriberadmin' role
and returns a list of NCOS Levels that belong to the same reseller
and with expose_to_customer = 1 (fields are limited to
id,name,description).
* When NCOS Level is expose_to_customer is set from 1 to 0, all
assigned ncos preferences for contracts and subscribers are that
contain the NCOS Level are removed.
Change-Id: Id7c444b4a0834939a128179ded6670705258519b
A reseller was not able to edit a phonebook entry unless it
specified the reseller_id. This should not be required since
the reseller could not know it.
Change-Id: I347c676e291659e9a8b2a97632531dc7b06e055a
This commit forces the creation of reseller_id preference
whenever a new subscriber is created in the same fashion of
the already existing preference account_id.
Change-Id: I8cc2b3b65e0e7a81e72452a3840fdd3540146968
subscriberadmin is now be able to get, edit and delete registrations
of the other subscribers belonging to the same customer.
This is necessary to extend the CSC features and give the PBX
administrator more flexibility in device configuration.
Change-Id: If83c1adb9af6590111c14800d83fb7d1eafaa9d3
From the very origin of the AA module the link used in panel
to create/edit the AA slots were '/preferences/speeddial/edit'.
This is wrong and most probably coming from a copy and paste of
the speeddial feature.
The commit fix the link and it is now chaged to the following
'/preferences/autoattendant/edit'.
Change-Id: I095b433cad78fb0175b0551fcfdea85815f73cdf
* timezone names are converted to their links, and if a link
is found (means that the current name is deprecated), it's
validated and stored as the link.
Change-Id: I6348659178400a96eaadd70f79b792c4fa25d7d4
When calling a PATCH or PUT API on a peering group or
outbound rule the reload of the kamailio lcr module was
triggered before the update of the database, thus the
kamailio status was not updated.
Change-Id: I59ed863c85219e62d6f5b5a2af80db8ef952844c
We have to support new preference for:
- `create_peer_registration`
- `update_peer_registration`
- `delete_peer_registration`
If there is no `peer_auth_registrar_server` value provided,
then use a realm value instead.
Change-Id: I39d3a917c9f11c1d4cfa0781fe5a3cee11d9eeea
When the subscriber preferences API is called by a subscriber
admin of a normal (not PBX) customer, then some values are
removed from the output. In all the other cases those values
are instead returned.
This fix let expose the profile_id, domain_id, status and
webpassword to all the types of subscribers because necessary
in the CSC context.
Change-Id: I629475e7f51d747a55ebfbc44232fb94a54fed06
* clear_audio_cache is now invoked also from:
- when a sound file is added (to reflect use_parent/potential child
sets)
- when a parent is changed for a sound set (to reflect current
and potential child sets)
- when a sound set is removed (to reflect potential child sets)
* clear_audio_cache() is reworked
- clear_audio_cache() now calls virtual_child_sound_sets to
fetch all potentially affected child sound sets and also
clears audio cache for them. if the amount of fetched
sound_sets is greater than 10000 then the the whole audio
cache is invalidated
* _clear_audio_cache_service() is reworked
- supports/expects a list of sound sets and sends them
as a string with ':' separator
- if both sound handle and sound sets are provided it calls
clearFiles (so that only the specific sound handle is cleared)
- if only sound sets are provided it calls clearSets (so that
all of the cached files beloning to the sets are removed)
- if none of the above are provided it calls clearAll to invalidate
the whole cache
Change-Id: Ie85f208e27183e88665803b93bb16d7de8e3d7ac
* try/catch is used for send_email() to catch MTA exception
if the delivery cannot be done
* the email delivery error cause is stored in the panel.log
file
Change-Id: I351b01309ee576b0818610d5ed927874ae2d0822
additional variables for the new_subscriber mail
template:
username
password
webusername
webpassword
cc
ac
sn
Change-Id: I8deadee11b162ef66e9f210d20bca11aa747c18f
* $c->user->id was wrongly used in the advanced cfs selection and
now changed to $prov_subscriber->id to filter it regardless of the
user editing the cfs
Change-Id: I8fa65bbce625d4b21dbb620a1f92919ed7fe2a88
* subscriberadmin can only delete items that belong to the same
contract_id, otherwise 'read-only' forbidden error is returned
Change-Id: I3ef2716039626bc1b208a5c7af06cf87f69cad73
* uses prefix 'me.' for query types search_eq and search_like
in the where condition to avoid ambiguity if the search_rs
has joins that with the same column names
Change-Id: I90fef80970aa4415480b00bbed2fb9fbee1f1ccc
while provisioning.voip_preference_enums.default_val
is supposed to be a flag variable, it is NULL for
some prefs.
we prevent a 500 error when editing such value in this
case now.
Change-Id: Idc5e0f1f0de93f9d0b6645982025c8b45bae1ec4
* /api/billingprofiles PUT/PATCH reseller_id for "reseller" roles is forced
to the user one, to address an issue when reseller_id becomes
required on PUT/PATCH
Change-Id: I3fa556c5db5556c75bf481d18b51df6c400a1944
* API now has own GroupAPI form with the correct fields for API
* db/form field name conversion is moved to the newly added
resource_from_item() and process_form_resource() functions
* simplify code for GET/POST/PUT/PATCH operations
Change-Id: I99b76801a2894c8a4821513186796627db728189
* /api/soundsets new parent_name field
* /api/soundfiles now allow POST to be done without the upload,
for cases when an empty record needs to be added to define
"use_parent" behaviour
* improve sems audio cache clear on sound files change, now
sems instances that are not available (not running/request timeout)
are skipped instead of raising an error
Change-Id: I83af2ee2fd3672ab35cf330464ace68416ab52be
* in a scenario when a sound set was "edited" and then
a new one created, in the creation dialog the previously
edited sound set was missing in the list of available parents
Change-Id: I8d7652a9f7f881be6d700dc4f6cf77dc426261e7
The pre-call announcements and the ringback tone
are not under the subscriber administrator control.
This make difficult for PBX customers to modify those
announcements.
Due to that now all the announcement's handle are exposed
also to contract soundsets.
Change-Id: Ie6c98a6a6ed4de18b267bd553f33afc9eb72f995
* sound sets can now use other sound sets as parents, in this
case if a sound is missing for a sound set, it's taken from
the parent one if it exists there, chained parents are also
supported with the available sound files "accumulated" across
them.
* add "expose_to_customer" field to sound sets, it enables exposing
system sound sets to customers so they can be used as a parent or
assigned to the 'sound_set' preference by 'subscriberadmin'.
* add "use_parent" field to sound set files, it's true by default
(for existing or missing sound files) and if set to 0, then parents
are not used for this particular sound file.
* use_parent column is hidden on the UI if a sound set does not have a
parent assigned
* improve sound set handles list on the UI
- Upload is renamed to Add
- empty record are shown in the filename column as localised "(empty)"
and Edit/Delete action buttons
* API /api/soundsets new 'parent_id' field, default null
* API /api/soundfiles new 'use_parent' field, default 1
* API /api/soundsets new 'expose_to_customer' field, default 0
* API /api/soundsets customer_id field now contains the customer id
for 'subscriberadmin' role and 'null' if it's a system sound set
* system sound sets with expose_to_customer == 1 and within the same
reseller are now visible to 'subscriberadmin' on the UI and via the
API in read-only mode, same with the sound files that belong to the
sound set. If a system sound set expose_to_customer is set back to 0,
this sound set is automatically removed from all contract sound sets
where it was assigned as a parent as well as from all subscriber
'sound_set' preferences.
* contract_sound_set|sound_set preference API updates now have tigher
checks for contract_id and also if the system sound set is exposed
to the customer and belongs to the same reseller
Change-Id: I4908fd15e9c224d4c30794ceb8dae1b444bbf56a
a 500 error results when specifying the RewriteRule
"description" filter because of ambigous field names.
Change-Id: I9c0a9f6c84ec62fca4c77ce904fb07c4dadef13b
This commit forces the reload of the lcr gw table not only for proxy
but also for lb. This is necessary to get lcr counters data structure
updated every time we have an add or del through web interface of the
list of gateways.
Change-Id: Ic25bdf916346965962c19164cffc4c48bf2aef7d
Deletion of a disabled peer was not working because
panel was trying to get the correspondant ID from the
LCR table, while the entry is not there because peer
was in fact disabled.
To fix it an additional check has been added to
evaluate if the peer is enabled or not at the moment
of the deletion.
Change-Id: I3c488a8711c5f7b486b6c0a3950738fb8689bb07
In case device is provisioned with lines that use the
external_number feature, then the provisioning system
uses the pilot subscriber username instead.
This because the external_number is not properly
passed to the provisioning templates.
Change-Id: I48e494b303db318d504578f10e8b44aa9b64ddc5
* preferences form with enum values now set the default one as
selected if no preference is set yet.
* disable autocomplete for the preferences table fields. this
addresses Firefox using incorrect selected values even though
the correct data is sent by the server.
Change-Id: I6865eec05c085b89e651b125a7f35724859ccbc2
The feature is not used and most probably not working
at all since we don't support the jitsi client anymore.
Change-Id: I2ce4c56e30d604ea840a44b09021d14937777159
The 'enable_t38' preference was added long time ago to
provision of phones that support fax services with t38.
We don't support those devices since long time.
Additionally the preference creates confusion with real
subscriber feature of enable t38 for mailtofax/faxtomail
service.
Due to those reason the preference can be removed.
Change-Id: Ib9f4f37354a62ad59ba8c5b63ae476142b36e717
* detect WAV GSM 6.10 format and provide
sox with the correct type 'gsm'/'sndfile' as otherwise
it fails to detect it
* use Capture::Tiny instead of IPC::Simple for better capture
(out,err,rc)
* mp3/ogg decoding fixes to reflect the GSM 6.10 possible formats
Change-Id: I79c5657543ccc4741efb3bdd56d7a0a37f251a4c
to better fit the usecase of *updating* subscribers, we
make the contract and contract_contact sections no longer
mandatory.
Change-Id: If3c34f2cd3a5201cf7da2729369fd6b1003f1a80
* API: GET collection returns only distinct cf sets
* UI: inherited cf sets are now shown in the advanced view
and having suffix '(inherited)' to distinguish them from the
own ones as they are not available in the "Manage Sets" edit
dialog.
Change-Id: Ifd8c1a46fcb4c2c66f8f63268a1e91b80792c216
* the UI field device edit form now contains a checkbox
that, when checked, replaces the subscriber devices dropdown
with an input text (only [0-9#*] chars are allowed)
* aligned the related script code to automatically detect and handle
switching between the sub number / target_number
Change-Id: I70ae5cf5bb81f5953d25a760fbf0efe6c418f6cb
* subscriber role can now GET call forward sets that
does not belong to the user but used in call forwards
assigned to the user
* the user can only GET the sets but cannot update/delete them
(403 Forbidden is raised in case of attempt)
Change-Id: I391b802d962f4bbeae991e3046ac3f132a19edb6