Subscriber administrators should be able to configure the
preferences of each single provisioned device. Due to that
this commit set expose_to_customer=1 for all the preferences
flagged with fielddev_pref=1.
Change-Id: Ifdc4e32212aa2e948d41bcf019bf1051be6b7c7d
* get_db_schema() now issues a commit after selects to cleanup
any pending ngcp.db_schema row locks as otherwise applying
an .up script that modifies ngcp.db_schema (usually applied outside
of the connection handle by invoking 'mysql' command) causes
wait locks.
Change-Id: Ie0557a1a7648baeba2ec6ded3665c51667877101
By mistake in commit 7aab6d290d the new 'rcv_display/np_display'
option was added to the 'outbound_from_user' and 'outbound_pai_user'
preferences instead of 'outbound_from_display' and 'outbound_pai_display'.
This fix revert previous addition and add it to the correct preference.
Change-Id: Ifed659b22dbde621fbf366092268e6416e9ad4ba
This new column will be used to store a flag (value 0 or 1) that
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).
Updating also the 'v_subscriber_cfs' VIEW to add thhis new column.
Change-Id: I74e53a526810f0145e305b90c3c3bd56cf91bc61
This will add support to both 'outbound_from_display' and
'outbound_pai_display' for a new method called 'rcv_display/np_display'.
This will allow to use the received display name if available
and the network provided one as fallback.
Change-Id: Iab0335c73ea6aba883b111645abec17bfede9386
* release column is going to contain the ngcp release
version when an .up script is applied and also used
with --mode down --to-release mrX.X.X to automatically
downgrade releases to a specific version
Change-Id: I8750646eee6076bc343a0c05e5c85c137458ef92
* Add `value` to the uda_idx, to reduce/eliminate gap locs and deadlocks from
the API /api/subscribers update scenarios
Change-Id: I62feb07c4df1675771b93e2a29a2aa126a14d34a
* with --mode=down and --to-revision, the revisions are now downgraded
to, and excluding --to-revision (before they included --to-revision,
which is incorrect because downgrades to
package version X.Y, usually do that to the specified package version
Change-Id: I6f250e47f130fc050cbed65d7945a58cde3341a1
* voip_phost_crepl_trig: enum default preferences are now always
created regardless of the enabled state, otherwise that led
to peering servers to be created without their default
not null enum preferences in voip_peer_preferences.
* fix missing not null enum preferences for peering servers
Change-Id: If8cecb5570ba876643207931ecab1e42a994a2fe
* Instead of using "set foreign_key_checks=0" before
altering voicemail_spool voicemail_users tables the
foreign key voicemail_spool.`v_s_mailboxuser_ref` is
dropped instead and re-created after the alter table operations
(same lines where "set foreign_key_checks=0" and "set
foreign_key_checks=1" were respectively.
* That addresses the changed behavior with MariaDB 10.11.6
where "alter table" statements the change columns involved
in a foreign key and potentially causing data loss are prohibited
even with "set foreign_key_checks=0".
* This change is only valid for new deployments and databases
with already applied 6425.up are not affected.
Change-Id: I2f2a85ca9f9f7d15058f41f5d8eaaec23ec501fa
Add support for on demand recording allowing now 4
different configuration types for the 'record_call'
preference:
* 0 = never record
* 1 = always record
* 2 = on-demand record (initially disabled)
* 3 = on-demand record (initially enabled)
Peers cannot use the on-demand recording
Change-Id: I17db074ea7cd690493eb48faa335ef2bfd3a0603
* update_sound_set_handle_parents() procedure is redesigned
to avoid "insert into select from" statements as they cause
gap locks when run concurrently and access the same index
rows.
*** WAITING FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 6594 page no 6 n bits 56 index parent_id_idx
of table `provisioning`.`voip_sound_sets` trx id 400852
lock mode S locks rec but not gap waiting
the "insert into select from" statements are reworked:
the "select from/with recursive" parts are now declared cursors
and the data is inserted inside the opened cursor loop (if any).
this way the selects are not causing exclusive gap locks.
Change-Id: I35ec28a33ecca42de898e67a2709eda4364e5f95
* node_state variable is now correctly checked
in the 'if' expression
* improve node state check output
Change-Id: Ie5da62cccf11e9c21cf43918670bf82c3cc2feb4
* --force-ro-db-sync runs ngcp-sync-db on the Carrier
proxy nodes regardless if at least one not_replicated script
was applied. This option is mutually exclusive with --skip-ro-db-sync
* rename config.db_local_socket into config.db_ro_socket
* when ro_sync_db() is invoked, privileges for the sipwise user
are updated (was only in automated mode). This is simplify
the usage as password for the sipwise user can potentially be
changed in the constants.yml (or different master database is
imported).
Change-Id: Ie21ff5a663a504082535834ec309c78857b6e911
This commit introduces a list of tables required
by the mod_callcenter module of the FS:
- `kamailio.queues` - custom table which is meant
for usage by our internal http(s) gateway
- `kamailio.agents` - table taken from the upstream
- `kamailio.members` - table taken from the upstream
- `kamailio.tiers` - table taken from the upstream
Database `kamailio` will be used to store tables,
since traditionally other components such as voicemail
server or SEMS are using it as well for storing own tables.
Hence, there is no need to create new database for FS.
P.S.: Master upstream sources of the `mod_callcenter`
were used to get the SQL schemas.
Change-Id: Id88f5b6f8d6dd3f5681034e080a763c9beaba1cf
* on CE platforms there is only one node assumed and therefore,
ngcp-update-db-schema should run there as expected
Change-Id: Iea9a75d34d77fa282585b365e50d221ca6c60528
* r/o database synchronisation, if run in the automated mode
sets grants for the sipwise user credentials taken from
/etc/mysql/sipwise_extra.conf and does it via the socket
/run/mysql/mysqld2.sock, that is because ngcp-sync-db
does not work via socket and there can be a condition when
no connections are allowed yet via tcp to the database.
* minor docstring typo fix
Change-Id: I536bca36320fdb6aa7ee8832ef50870c0dd5e9a1
presentity messages in kamailio.presentity are volatile,
so we copy them to a accounting table for later CDR export.
this cannot be done in mediator, since the presentity message
is emitted after the call has ended.
Change-Id: I6571023664694fef8ae4a071f658960032879c5c
The jenkins uses DB_BASE variable which is path to db.git repo. So if
this variable is set - we need to use db_scripts from this path.
Change-Id: If7af8a38890f7d5da95effeb4bec2b0c7e2ab920
* set session wait_timeout to 600 seconds
* in batch mode also the following session vars are set:
- net_read_timeout = 600
- net_write_timeout = 600
Change-Id: Ie774f7b5776d07e5c424d0391a5a5ddf4af2d98d
* config._run_cmd_mysql_options now includes -u db_host
-P db_port options to match the pymysql connection behaviour
Change-Id: I81955f4382c485acb17e123cfa42e27601171d05
* --db-scripts-dir option enables override of the
default database scripts directory location
* docstring a bit more compact formatting
* apply_revisions(): improve non-existing directory
detection and error output
Change-Id: Ic1d74244244df6406fb9a9258b7c36b971497513
When we add the peering server into dispatcher table,
we need to set his flags column to 8, in order to enable
the probing, and keep flags 0 in the other internal
dispatcher entries (lb,sems,asterisk).
Also we have to update all current 'flags' values in
dispathcer for peering server (with setid=100) with the
new value 8.
Change-Id: Ie8c07639b49dcf8963459bfe1c3cabc12233c6a4
* it's not a responsiblity of the script to start/stop
any external services and therefore, mariadb start
is removed
Change-Id: I220ebab7764a7016b15e6f08a8ac5ae01fe08523
* new command line option --db-defaults-conf-file
* new command line option --db-connect-method
* connect_db(): improve socket or config selection
* add mysql connect method as mysql command line options when
run_cmd('mysql' ...) is invoked, so that the mysql console connection
matches the pymysql connection
Change-Id: Ice8ff1e79c133d634f3de5bce204c7889f69b42d
* add new command line option --db-socket that overrides
the default socket file location
* MYSQL_SOCKET env is now considered as the socket file location
replacement, only if there is no --db-socket option set
* config.skip_sync_db is renamed into config.skip_ro_db_sync to
be consistent with the command line option
Change-Id: I4f113cdc8ad430f17ce022cdbbceef44e769857d
* ngcp-update-db-schema is rewritten in python. that simplifies
the code, as well as enables flexibility and more complex features
support, as well as performance improvements
* full strict mypy compliant
* flake8 compliant
* google docstring complied
* add .down scripts support
* add docstring full documentation
* add mypy, isort, flake8 checks during build phase
* add command line arguments that support --to-revision, to stop
.up/.down scripts execution when it reaches a certain revision
* better support for ngcp-sync-db
* preserve AUTOMATED_INSTALL_MODE and SKIP_SYNC_DB env vars support
for backward compatibility, in the future it is recommented to
switch to the existing (--automated, --skip-ro-sync-db) options
* experimental batch mode support where instead of applying changes
one by one, they are accumulated into a file along with db_schema
revision tracking changes and applied at once
Change-Id: I4632393d52d1a60c945b4d87a779f1a073ed9a5f
There are 2 .up scripts that modify voip_allowed_ip_groups.ipnet
15702.up - modifies it to varchar(43)
15710.up - modifies it to varchar(46)
Because in 15710.up was backported into mr9.5 but is missing in mr10.5,
existing upgrades from mr9.5 -> mr10.5 apply 15702 after 15710.up,
effectively downgrading the column to varchar(46).
This .up script fixes the scenario and also the .down script modifies
the column also to varchar(46) to respect the previous 15710.up the
sets it to varchar(46), so to achieve the consistent state.
Change-Id: If14917ef437de3abf46b1900f68c9cc3a9a4b947
Expose peer_auth_registrar_server to usr_pref to align
the subscriber remote authentication to the peering
authentication.
Change-Id: Ib65b9b40b70dc9eb122411e27793c1f6ecb8dfc5
announce_conn_type defines what type of connection
to use in case of CF to Office-Hours or Early Rejects.
If set to 'early' the announcement is played with early
media (183).
If set to 'established' the announcement is played
after a 200 OK.
Change-Id: Idef2577f566b63ebd9f91c7c120a1761d88bf217
With current set of options (which are quite similar to the ones in
/etc/mysql/my.cnf) db script db_scripts/diff/15787.up renames the index
name of voip_preferences_enum.preference_id to pref_id_fk.
So to fix this problem and prevent any further ones - copy existing
/etc/mysql/my.cnf and modify it for dedicated instance.
Change-Id: I9311c12d0d3f0bf0e5a28a40790dd6908a92f32a