diff options
author | Ted Trask <ttrask01@yahoo.com> | 2011-11-17 20:21:04 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2011-11-17 20:21:04 +0000 |
commit | 53067bd24fa8c8deef235512fbe6ef785283568b (patch) | |
tree | 8e1b82fa2aadc180b01200e7cff7a4d49b196a02 | |
parent | d8c114a57835732f52783a5d76b6eee0977717a1 (diff) | |
download | acf-freeswitch-vmail-53067bd24fa8c8deef235512fbe6ef785283568b.tar.bz2 acf-freeswitch-vmail-53067bd24fa8c8deef235512fbe6ef785283568b.tar.xz |
Fixed delete_user to delete the entry in voicemail_prefs and all recordings
-rw-r--r-- | vmail-model.lua | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/vmail-model.lua b/vmail-model.lua index 218f299..a7c318e 100644 --- a/vmail-model.lua +++ b/vmail-model.lua @@ -19,6 +19,7 @@ config.event_socket_ip = config.event_socket_ip or "127.0.0.1" config.event_socket_port = config.event_socket_port or "8021" config.event_socket_password = config.event_socket_password or "ClueCon" config.callback_command = config.callback_command or "originate {ignore_early_media=true,origination_caller_id_name='Voicemail',origination_caller_id_number='Voicemail'}sofia/gateway/asterlink.com/$1 &playback($2)" +local recording_path = "/var/lib/freeswitch/voicemail/" local env local con @@ -690,10 +691,15 @@ delete_user = function(username) -- Remove the user parameters sql = "DELETE FROM voicemail_values " .. generatewhereclause(nil, nil, nil, users[1].uid) runsqlcommand(sql) + -- Remove the user password + sql = "DELETE FROM voicemail_prefs " .. generatewhereclause(username) + runsqlcommand(sql) -- Remove the user sql = "DELETE FROM voicemail_users " .. generatewhereclause(nil, nil, nil, users[1].uid) runsqlcommand(sql) result = "Voicemail User Deleted" + -- Remove the greetings + fs.remove_directory(recording_path..(users[1].domain or config.domain).."/"..username) end if connected then databasedisconnect() end end) |