* determine the master db node name to use
for ngcp-sync-db master-slave replication restoration
if the CENTRAL_DBHOST is set by default to db01 only.
if the current nodename ends with "a" then db01a is used,
otehrwise db01b is used as the master host. that is
to make sure that during the upgrade the correct "side"
is used to replicate the data from and avoid lossy
statements that break replication.
Change-Id: I1a51bd0d975390d9269ef5208ce8275f9e055a1f
(cherry picked from commit 1cfafba736)
* kamailio.voicemail_spool is not used in the replication
to the R/O instance
Change-Id: I83089a4b8b6be4ad968a73ff16409767297662b9
(cherry picked from commit 377381df5d)
* provisioning.voip_peer_rules triggers use internally
a join by IP address to insert/update entries in
kamailio.lcr_rule_target. in cases where there are 2 hosts
per peering group with the same IP address, the triggers
fail because they select duplicate peer hosts. to address
that the "lcr_rule_target join" in the relevant triggers
is adjusted to join the hosts tables by gw_name isntead,
since gw_name is guaranteed unique per peer group
(controlled by a unique key)
Change-Id: I36669efc22bb62ad34c57aac4d978435dbb26f0c
(cherry picked from commit b6d98d8464)
* ngcp.date_range_helper was created as replicated
but it was not replicated on PRO.
this up script recreates the table syncing it in the pair
Change-Id: I4259436701a686729cbbb4a8248feabfcf8054d3
(cherry picked from commit 11cee94917)
- currenty, there is only cdr.export_status and cdr.exported_at columns
to mark rows already written.
- to handle the AMA ticket export (and other exporters in the future), a
table "accounting.cdr_export_status" is introduced, defineing "streams".
for now there will be "defualt" (the good old cdr-exporter) and
"ama-simples" (for UPC AT)
- the table accounting.cdr_export_status_data stores individual vlaus
for "export_status" (unexported, ok, failed) and exported_at timestamp
per cdr and per cdr exort stream
- all cdr relation table triggers for emulating fk are refactored to be fast.
Change-Id: I52c3383f82ef841e7b18515dd7b73db42a43e2f9
(cherry picked from commit c070cb8feb)
to prevent a pontential foreign key error in susequent
alter table billing_fees_raw
..,
add unique key bfr_srcdestdir_idx (billing_profile_id, type,
match_mode, direction, source, destination),
..;
the key is turned into not-unique afterwards with 15449.up
Change-Id: I884adc442e48202fd0061fece400f5fcb6f892b5
(cherry picked from commit d5c306d372)
* addresses an issue with the foreign key cannot be
recreated as it relies on the lnp_providers table,
affected since MariaDB 10.1.37
Change-Id: I785fcae727e975839c710f327bd10a659384c39c
(cherry picked from commit 2234f05ddf)
* --init-replication is required now for the central-db
because it uses multiple sources and they need to be
readjusted after the data sync
Change-Id: I10c12d479dbe7d73e6e489d3aa9ab37b7216af54
(cherry picked from commit 422af529f0)
* '[% mail_from %]' is used for
fax_receive_ok_default_email instead
of the constant text
Change-Id: Ief3d342617b1d98a035b21337098571f5ae9d8cb
(cherry picked from commit 4523f70509)
* faxserver templates are migrated from
the faxserver.conf into the database
Change-Id: I1c85ccba7466a1260029c98e2f7edceaf5ff437a
(cherry picked from commit c944dd6892)
the proc now locks contract_id=1 to synchronize when
creating new contracts. (LOCK TABLE is n/a in procs)
note this would be also needed for update operations.
for the lock to work, it requires a proper isolation level.
Change-Id: Ie553532d2879905858a02d0bff22b94d74b44850
A typo in 15400_not_replicated.up script cause the initial select
to return a NULL id, introducing some wrong lines in voip_preferences_enum
table.
The new up script delete the previously introduced wrong lines and
insert the correct ones.
Change-Id: I4e321978e932f866eeaec2b57cdc3deb3a3a0f35
+ add "match_mode" column
+ refactor indexes, triggers, copy proc
+ get_billing_fee_id proc implementing the 4 match modes:
- regex_longest_pattern
- regex_longest_match
- prefix
- exact_destination
+ get_billing_fee proc returning intervals/rates as a
packed string for matching call-out fees and on/offpeak
for the given time. to be used in kamailio/AoC
Change-Id: I7799c5a1ab33bb433c231bd4049c977bcb19b684
* when peer group is changed for a peer rule
it is now correctly reflected in
kamailio.lcr_rule and kamailio.lcr_rule_target
Change-Id: I0a449a224874bd098a3d3c973958f812dbf78530
Allows to identify firmwares by a given tag, if the firmware consists
of multiple files and the phone fetches them by hardcoded names.
Change-Id: I5325895da642d306c92ab1e03264ba128cc295a6
to optimize the heavyweight fraud events query (and similar
places), the billing.billing_mappings is refactored into 2
new tables that will hold a scan-line rendered representation
of the former billing_mapping records known with their
(nullable) start and (nullable) stop cols.
accessing this new tables (eg. insert a billing mapping to
switch a contract's billing_profile, or query for the
contracts current billing profile) is not supposed to be
done explicitly, but by the stored sql proc provided:
- "billing.create_contract_billing_profile_network_from_package":
set/add a bunch of profiles from a profile package at once.
- "billing.get_billing_profile_by_*":
get a contract's billing profile id at the given epoch.
+ by_contract_id: customer or system contract id
+ by_uuid: subscriber uuid
+ by_peer_host_id: peer server id
- "billing.get_billing_profile_by_*_network":
get a contract's billing profile id for the given IPv4 or IPv6
string at the given epoch.
+ by_contract_id: customer or system contract id
+ by_uuid: subscriber uuid
+ by_peer_host_id: peer server id
The enhanced fraud queries can finally make use of a view that
can be used to get the current billing profile id:
- "billing.v_actual_billing_profiles":
View showing all contracts' billing_profile_id at the
current time. In contrast to the procs, the view can
be used nicely in joins of stmts.
15418.up also cover copying+transforming the existing records
in billing.billing_mappings. the old table and records are left
for now but are subject to be dropped soon. if new contracts
were created during the upgrade (although discouraged), the
transformation of not yet transformed contracts can be done by
simply re-executing
call billing.transform_billing_mappings();
Change-Id: Ib5ddd620b2b08ed7db4b6448a44931d37ea5b06a