From a0183b2f75a772366336671a818707df3dc04e79 Mon Sep 17 00:00:00 2001 From: Iordan Iordanov Date: Sat, 9 Mar 2013 22:52:53 +0000 Subject: - added beep.gsm - now escaping special characters in pbx-asterisk - changed location of voicemail temp stuff and log file - changed pbx-send-voicemail to use base64 instead of uuencode - added many missing dependencies - now allowing ip addresses as well as hostnames for external host - constrained # seconds to ring to positive integers - specifying externrefresh in sip.conf template - fixed voicemail (sending recordings, recording new greeting, instructions) - Implemented callback --- .../luci-pbx-voicemail/luasrc/model/cbi/pbx-voicemail.lua | 15 +++++++++------ .../root/etc/pbx-voicemail/pbx-move-greeting | 6 ++++++ .../root/etc/pbx-voicemail/pbx-send-voicemail | 10 +++++----- 3 files changed, 20 insertions(+), 11 deletions(-) create mode 100755 applications/luci-pbx-voicemail/root/etc/pbx-voicemail/pbx-move-greeting (limited to 'applications/luci-pbx-voicemail') diff --git a/applications/luci-pbx-voicemail/luasrc/model/cbi/pbx-voicemail.lua b/applications/luci-pbx-voicemail/luasrc/model/cbi/pbx-voicemail.lua index 62320609a..9ff2ed97f 100644 --- a/applications/luci-pbx-voicemail/luasrc/model/cbi/pbx-voicemail.lua +++ b/applications/luci-pbx-voicemail/luasrc/model/cbi/pbx-voicemail.lua @@ -64,20 +64,23 @@ savepath = s:option(Value, "global_save_path", translate("Local Storage Director option only if you know what you are doing.")) savepath.optional = true -if nixio.fs.access("/etc/pbx-voicemail/greeting.WAV") then +if nixio.fs.access("/etc/pbx-voicemail/recordings/greeting.gsm") then m1 = s:option(DummyValue, "_m1") m1:depends("enabled", "yes") m1.default = "NOTE: Found a voicemail greeting. To check or change your voicemail greeting, dial *789 \ - and the system will play your current message. You have 5 seconds to hangup, otherwise a \ - new recording will begin and your old message will be overwritten. Hang up or press # to \ - stop recording. When you press #, the system will play back the new recording." + and the system will play back your current greeting. After that, a long beep will sound and \ + you can press * in order to record a new message. Hang up to avoid recording a message. \ + If you press *, a second long beep will sound, and you can record a new greeting. \ + Hang up or press # to stop recording. When # is pressed the system will play back the \ + new greeting." else m1 = s:option(DummyValue, "_m1") m1:depends("enabled", "yes") m1.default = "WARNING: Could not find voicemail greeting. Callers will hear only a beep before \ - recording starts. To record a greeting, dial *789 and record a greeting after the beep. \ + recording starts. To record a greeting, dial *789, and press * after the long beep. \ + If you press *, a second long beep will sound, and you can record a new greeting. \ Hang up or press # to stop recording. When # is pressed the system will play back the \ - recording." + new greeting." end diff --git a/applications/luci-pbx-voicemail/root/etc/pbx-voicemail/pbx-move-greeting b/applications/luci-pbx-voicemail/root/etc/pbx-voicemail/pbx-move-greeting new file mode 100755 index 000000000..21fe69414 --- /dev/null +++ b/applications/luci-pbx-voicemail/root/etc/pbx-voicemail/pbx-move-greeting @@ -0,0 +1,6 @@ +#!/bin/sh + +if [ -f "/tmp/voicemail/greeting.gsm" ] +then + mv /tmp/voicemail/greeting.gsm /etc/pbx-voicemail/recordings/ +fi diff --git a/applications/luci-pbx-voicemail/root/etc/pbx-voicemail/pbx-send-voicemail b/applications/luci-pbx-voicemail/root/etc/pbx-voicemail/pbx-send-voicemail index adfded231..ba639d01a 100755 --- a/applications/luci-pbx-voicemail/root/etc/pbx-voicemail/pbx-send-voicemail +++ b/applications/luci-pbx-voicemail/root/etc/pbx-voicemail/pbx-send-voicemail @@ -19,10 +19,10 @@ # # # Thanks to http://www.zedwood.com for providing an excellent example of how to -# properly assemble an email message with a uuencoded attachment. +# properly assemble an email message with a base64 encoded attachment. # -LOGFILE=/tmp/last_sent_voicemail.log +LOGFILE=/tmp/voicemail/last_sent_voicemail.log # Redirect standard error and standard output to a log file. rm -f "$LOGFILE" @@ -58,8 +58,8 @@ REPLY="do-not-reply@pbx" SUBJECT="Voicemail from $CALLERID, $DATE, $TIME" MSGBODY="$CALLERID has left voicemail for you on $DATE at $TIME." MIMETYPE="audio/wav" -TMP1="/tmp/tmpemail1.$$"; -TMP2="/tmp/tmpemail2.$$"; +TMP1="/tmp/voicemail/tmpemail1.$$"; +TMP2="/tmp/voicemail/tmpemail2.$$"; BOUNDARY="`date +%s | md5sum | awk '{print $1}'`" FILENAME="voicemail-$DATE-$TIME.WAV" @@ -97,7 +97,7 @@ append_to_file $TMP2 "" # Cat everything together and pass to msmtprc to send out. ( cat $TMP1 - cat "$ATTACHMENT" | uuencode --base64 /dev/stdout | sed -e '1,1d' -e '$d' + cat "$ATTACHMENT" | base64 cat $TMP2 ) | msmtp -t -C /etc/pbx-msmtprc # Clean up email temp files. -- cgit v1.2.3