Phrases: Save phrases xml and delete phrases from memcache after converting to/from base64 in app_defaults.

IVR: Using phrase greetings, DTMF tones now captured and executed, but only after playback completes (uses session:variable).  Still searching for a better solution.
This commit is contained in:
Nate Jones
2015-04-28 17:24:32 +00:00
parent db21ca20f1
commit 75f8cb0a9e
3 changed files with 66 additions and 12 deletions

View File

@@ -17,7 +17,7 @@
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2012
Portions created by the Initial Developer are Copyright (C) 2008-2015
the Initial Developer. All Rights Reserved.
Contributor(s):
@@ -148,6 +148,27 @@ if ($domains_processed == 1) {
unset($sql, $prep_statement, $result, $row);
}
//save the xml to the file system if the phrase directory is set
require_once "resources/functions/save_phrases_xml.php";
save_phrases_xml();
//delete the phrase from memcache
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
if ($fp) {
//get phrase languages
$sql = "select distinct phrase_language from v_phrases order by phrase_language asc ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_ASSOC);
//delete memcache var
foreach ($result as $row) {
$switch_cmd .= "memcache delete languages:".$row['phrase_language'];
$switch_result = event_socket_request($fp, 'api '.$switch_cmd);
}
unset($sql, $prep_statement, $result, $row);
}
unset($fp);
}
?>