Skip to content

Commit

Permalink
fix extension migration queries
Browse files Browse the repository at this point in the history
  • Loading branch information
Stell0 committed May 20, 2024
1 parent c1872d3 commit d0b8ee1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions freepbx/initdb.d/migration.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,22 +47,22 @@
$db->commit();

# set rtp_symmetric to no in freepbx sip table
$sql = "UPDATE `asterisk`.`sip` SET `data` = 'no' WHERE `keyword` = 'rtp_symmetric' WHERE `id` IN ($qm_string)";
$sql = "UPDATE `asterisk`.`sip` SET `data` = 'no' WHERE `keyword` = 'rtp_symmetric' AND `id` IN ($qm_string)";
$stmt = $db->prepare($sql);
$stmt->execute(array_column($res, 'extension'));

# set rewrite_contact to no in freepbx sip table
$sql = "UPDATE `asterisk`.`sip` SET `data` = 'no' WHERE `keyword` = 'rewrite_contact' WHERE `id` IN ($qm_string)";
$sql = "UPDATE `asterisk`.`sip` SET `data` = 'no' WHERE `keyword` = 'rewrite_contact' AND `id` IN ($qm_string)";
$stmt = $db->prepare($sql);
$stmt->execute(array_column($res, 'extension'));

# set force_rport to no in freepbx sip table
$sql = "UPDATE `asterisk`.`sip` SET `data` = 'no' WHERE `keyword` = 'force_rport' WHERE `id` IN ($qm_string)";
$sql = "UPDATE `asterisk`.`sip` SET `data` = 'no' WHERE `keyword` = 'force_rport' AND `id` IN ($qm_string)";
$stmt = $db->prepare($sql);
$stmt->execute(array_column($res, 'extension'));

# set transport to udp in freepbx sip table
$sql = "UPDATE `asterisk`.`sip` SET `data` = '0.0.0.0-udp' WHERE `keyword` = 'transport' WHERE `id` IN ($qm_string)";
$sql = "UPDATE `asterisk`.`sip` SET `data` = '0.0.0.0-udp' WHERE `keyword` = 'transport' AND `id` IN ($qm_string)";
$stmt = $db->prepare($sql);
$stmt->execute(array_column($res, 'extension'));
}
Expand Down

0 comments on commit d0b8ee1

Please sign in to comment.