MT#64020 fix 15797 to avoid restoring valid peer prefs

* this fix addresses voip_peer_preferences default values
  restoration in 15797 and it from now on only restores missing
  default values for preferences that do not have peer_pref
  with non default value NULL, so that scenarios where a
  preference does not exists in voip_peer_preference because
  it was manually selected by the customer with the value NULL
  so it does not exists in voip_peer_preferences for that reason.

Change-Id: I83ee3294cab896679575187066a3960818dc2f77
(cherry picked from commit 5b840a69e7)
mr12.5
Kirill Solomko 4 weeks ago committed by Marco Capetta
parent b644a5eb61
commit 57be50bf22

@ -48,4 +48,11 @@ SELECT ph.id, p.id, pe.value
JOIN voip_peer_hosts ph
LEFT OUTER JOIN voip_peer_preferences pp ON pp.attribute_id = p.id AND ph.id = pp.peer_host_id
WHERE p.peer_pref = 1 AND pe.peer_pref = 1 AND pe.default_val = 1 AND pe.value IS NOT NULL
AND pp.value IS NULL;
AND pp.value IS NULL
AND NOT EXISTS (
SELECT id FROM voip_preferences_enum pn
WHERE pn.preference_id = p.id
AND pn.peer_pref = 1
AND pn.default_val = 0
AND pn.value IS NULL
LIMIT 1);

Loading…
Cancel
Save