mariadb does not support variable referals in correlated
subqueries if the nesting depth is 2 or beyond.
so in short: below works ->
select
(select
count(*)
from table1
where id = root.id
) as cnt
from table2 as root;
... while this not unfortunately:
select
(select
count(1)
from (select
1
from table1
where id = root.id
LIMIT 1001) as q
) as cnt_limited
from table2 as root;
this can be solved by declaring the topical subqueries
in dedicated user-defined functions, so involved
panel/api parts will load quickly even with millions of
subscribers.
Change-Id: If96603cb4115259d719297af46c5bc7c10aadf76
(cherry picked from commit 52b3341599)
(cherry picked from commit d7b14a892e)
there is an issue with a cornercase of resolving
domain preferences allowed_ips overloads. the cursor
loop of the proc therefor now gets proper statemachine
logic.
Change-Id: Ieeacc4d7c8a931c6e9f0f8087b2a05112f78c675
(cherry picked from commit 73a55b33ae)
rationale:
-ipv6 allowed_ip adresses were not yet supported in kamailio
-the current ipv4 allowed_ip check has bad performance
this change introduces a new UDF to check the UA ip against
allowed_ip and man_allowed_ip preferences in a fast and
convenient way, ie.:
SELECT provisioning.ip_is_allowed(
<subscriber_uuid>,
<ipv4_or_ipv6_address>
);
the check is based on range queries supported by indexes,
following the proven approach we already use for roaming/
billing_networks.
it requires to transfrom IPnet values of existing data into
numerical representation of the network start (network) and
end (broadcast) addresses.
mariadb does not support arithmetic or bitwise operation
for varbinary or numerical values larger than bigint, which
is required to calculate network and broadcast adresses.
the change therefore provides an own implementation for
large integer operations. it works with hex string
representations, which fits the existing mariadb "hex()",
"unhex()" and "inet6_aton/ntoa()" functions.
Change-Id: I9dbaa769252babf168243167c061f035f0f43242
(cherry picked from commit 7c1453e460)
All "transcode" preferences are listed as type "0" in the DB except for
DTMF and CN which are listed as "1". The LUA/Kamailio scripts fail to
include tyoe "1" preferences in the list of flags given to rtpengine.
Change the type to "0" to fix.
Change-Id: I38f0d9f1394e07b190f1bd196ac85f456017ae6f
(cherry picked from commit 531cc5c14d)
The format of Android push tokens is a free-form binary string of up to
4096 bytes. Currently the tokens are under 256 bytes long, but we expand
the DB field anyway to be future-proof. Unfortunately MySQL doesn't
allow keys that long, so we have to restrict the field to 3072 bytes.
Further add an auto-increment integer primary key to make InnoDB happy.
Change-Id: Ic664d47b80f751397ec51688d8f399da06eac176
(cherry picked from commit 31527c2281)
fee matching works in 2 attempts:
1. try to find a fee matching <user@domain>
2. if none found, try to find a fee matching <user>
the billing_profile record will get a new field
"ignore_domain". if set to "1", step#1 above
should be skipped.
see commit id 1af70b
Change-Id: I4b05112db52afbf6f4369711ad946ff1070260ca
(cherry picked from commit 38b64c7d86)
The additional column in necessary to get which is the username
of the subscriber associated to a particular device_id.
It is mostly used for presence status because kamailio has
to trigger presence based on the subscriber and not on
the device.
Change-Id: I881ea1e54c8b0e9635e9ceb96ed60ac8792bf50e
Add new prompt (sound handle): aa_timeout to "pbx" group
in provisioning.voip_sound_handles table.
Change-Id: I24dece40996c1b982fa8b71fd132ab02374c7ded
Move the under the new section the announce handles:
* announce_before_call_setup
* announce_before_cf
* announce_before_recording
* announce_to_callee'
Change-Id: I698dd74a5b8c7f94253bf1763ebb533a41f0ba07
Replace the special character 'μ' (lowercase Greek Mu) with latin 'u' in
a word ‘u-Law’ inside the label and description of 'transcode_PCMU'
voip_preferences attribute. This is for compatibility with xgettext
programs and the Crowdin platform.
Change-Id: I3ffde8a4cb0a57d36e559d88bb2cd9740bc6dbef
* v_subscriber_cfs represents all callforwards per subscriber uuid
to be used in call forward related selects
Change-Id: I7cbdcf5454c616f0116abbcba4a1625efa80d8da
Adding the source_last_hih field for the cdrs, this field will be used
to store the last history info header of the incoming invite if present.
Change-Id: I6549e69da4bd47b76c7365ece3a9507abdcf733c
This reverts commit b8107d2653.
Reason for revert: upscript conflicts with ngcpapply helper script
Change-Id: I04dfb82ef0c4851d53efa432efb37e44ce37926e
This upscript will do the following:
- the domains/peers where the selection is on default are migrated to ext
- default entry removed from domains/peers
- new default selection for domain/peers is ext
- The "default" entry has been renamed for subscribers to "use domain default"
Change-Id: I7e5d6f48f6c4aaf4db0e33abf4a3f3d58c446c82
* defines the format of emergency_location_object field
* set cirpack as default since that was the original format
* add PIDF-LO for implementing TR Notruf
Change-Id: Ifcac50b7147f7233d42e1abea75c6cfc1d59f604
* voip_preferences 'type' can be 2, means' blob'
* voip_preferences data_type enum add: 'blob'
* 4 new tables:
- voip_dom_preferences_blob
- voip_usr_preferences_blob
- voip_contract_preferences_blob
- voip_peer_preferences_blob
(they are innodb page compressed)
* triggers on insert/delete on these tables
cause the 'value' field of the related
voip_usr/dom/contract/peer_preferences table to
be updated with the id of the record, required
for kamailio to find the related blob record without
replicating the blob data
* procedure for adding a new blob entry:
1. insert into voip_usr_preferences with the empty value
2. insert into voip_usr_preferences_blob
3. the voip_usr_preferences value will be automatically updated
with the id of the created blob record
Change-Id: I9330613f50de20bc098a94f3fc28cfd4b3ad3c68
Added new usr_preferences with attribute = "no_404_fallback"
This option will enable/disable the user to disable 404 fallback when the callee UAc
replies with a 404 not found.
Change-Id: I414014e920f8f0fbd690b8b3551b0afbed5c6625
* with MariaDB 10.5 REFERENCES syntax in the CREATE TABLE
column definition now creates automatic foreign keys.
That causes duplicate foreign keys, one manually defined
in the CREATE TABLE/ALTER TABLE statements and one that is
automatically created with _ibfk_<int> suffix. Therefore,
the REFERENCE syntax in the column definition is removed,
as all of those REFERENCEs are covered by the FOREIGN KEY
ones.
Change-Id: I969a8d3d31d680c0e7f15c1cfb31e8c2abe6eb74
* this table is in the provisioning database and is used
to add additional location mappings for terminated calls on a
subscriber instead of the 'location_from_subscriber' preference
* 'location_from_subscriber' preference data is migrated into
the new table
Change-Id: I92726e765c51e87c4d815d01161d8866fe58ef9c
* this new view accumulates possible auth data
containing both subscrber usernames and devices
(aliases with is_devid=1)
* this view is used in subscriber auth and the proxy
code to fetch registered devices not only by
subscriber username but also by the device
Change-Id: Ic4e2596ad461c70acf34cf75a2590640813ec2ca
* Switch all 'redirect_sipwise' and 'profile_sipwise'
to 'redirect_ale' bootstrap method
* Remove them from enum
Change-Id: I394d5926c75a3784cb0fecff983ff3cfd3a889a5