Update addmailbox script (bug #404)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@1773 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
parent
b49cd7e053
commit
d49d485f4b
51
addmailbox
51
addmailbox
|
@ -1,20 +1,45 @@
|
|||
#!/bin/sh
|
||||
VMHOME=/var/spool/asterisk/vm
|
||||
clear
|
||||
VMHOME=/var/spool/asterisk/voicemail
|
||||
SNDHOME=/var/lib/asterisk/sounds
|
||||
echo -n "Enter mailbox number: "
|
||||
echo
|
||||
echo "Enter Voicemail Context of the mailbox you are creating."
|
||||
echo "The context is the value between the square brackets in"
|
||||
echo "the voicemail.conf file."
|
||||
echo "(DEFAULT: default)"
|
||||
echo -n "Voicemail Context: "
|
||||
read context
|
||||
echo
|
||||
echo "Enter the Mailbox number of the voicemail box you are creating."
|
||||
echo -n "Mailbox Number: "
|
||||
read mailbox
|
||||
mkdir -p ${VMHOME}/${mailbox}
|
||||
mkdir -p ${VMHOME}/${mailbox}/INBOX
|
||||
cat ${SNDHOME}/vm-theperson.gsm > ${VMHOME}/${mailbox}/unavail.gsm
|
||||
cat ${SNDHOME}/vm-theperson.gsm > ${VMHOME}/${mailbox}/busy.gsm
|
||||
cat ${SNDHOME}/vm-extension.gsm > ${VMHOME}/${mailbox}/greet.gsm
|
||||
|
||||
context=${context:-default}
|
||||
|
||||
if [ ! -e "${VMHOME}/${context}" ]
|
||||
then
|
||||
echo
|
||||
echo "New Voicemail context.."
|
||||
echo "Creating Voicemail context directory..."
|
||||
mkdir -p ${VMHOME}/${context}
|
||||
fi
|
||||
|
||||
echo
|
||||
echo "Creating Voicemail directory..."
|
||||
mkdir -p ${VMHOME}/${context}/${mailbox}
|
||||
echo "Creating INBOX..."
|
||||
mkdir -p ${VMHOME}/${context}/${mailbox}/INBOX
|
||||
echo "Creating Default greetings..."
|
||||
cat ${SNDHOME}/vm-theperson.gsm > ${VMHOME}/${context}/${mailbox}/unavail.gsm
|
||||
cat ${SNDHOME}/vm-theperson.gsm > ${VMHOME}/${context}/${mailbox}/busy.gsm
|
||||
cat ${SNDHOME}/vm-extension.gsm > ${VMHOME}/${context}/${mailbox}/greet.gsm
|
||||
nums=`echo $mailbox | sed 's/./ \0/g'`
|
||||
for x in $nums; do
|
||||
cat ${SNDHOME}/digits/${x}.gsm >> ${VMHOME}/${mailbox}/unavail.gsm
|
||||
cat ${SNDHOME}/digits/${x}.gsm >> ${VMHOME}/${mailbox}/busy.gsm
|
||||
cat ${SNDHOME}/digits/${x}.gsm >> ${VMHOME}/${mailbox}/greet.gsm
|
||||
cat ${SNDHOME}/digits/${x}.gsm >> ${VMHOME}/${context}/${mailbox}/unavail.gsm
|
||||
cat ${SNDHOME}/digits/${x}.gsm >> ${VMHOME}/${context}/${mailbox}/busy.gsm
|
||||
cat ${SNDHOME}/digits/${x}.gsm >> ${VMHOME}/${context}/${mailbox}/greet.gsm
|
||||
done
|
||||
|
||||
cat ${SNDHOME}/vm-isunavail.gsm >> ${VMHOME}/${mailbox}/unavail.gsm
|
||||
cat ${SNDHOME}/vm-isonphone.gsm >> ${VMHOME}/${mailbox}/busy.gsm
|
||||
cat ${SNDHOME}/vm-isunavail.gsm >> ${VMHOME}/${context}/${mailbox}/unavail.gsm
|
||||
cat ${SNDHOME}/vm-isonphone.gsm >> ${VMHOME}/${context}/${mailbox}/busy.gsm
|
||||
echo "Complete."
|
||||
|
||||
|
|
|
@ -1,20 +1,45 @@
|
|||
#!/bin/sh
|
||||
VMHOME=/var/spool/asterisk/vm
|
||||
clear
|
||||
VMHOME=/var/spool/asterisk/voicemail
|
||||
SNDHOME=/var/lib/asterisk/sounds
|
||||
echo -n "Enter mailbox number: "
|
||||
echo
|
||||
echo "Enter Voicemail Context of the mailbox you are creating."
|
||||
echo "The context is the value between the square brackets in"
|
||||
echo "the voicemail.conf file."
|
||||
echo "(DEFAULT: default)"
|
||||
echo -n "Voicemail Context: "
|
||||
read context
|
||||
echo
|
||||
echo "Enter the Mailbox number of the voicemail box you are creating."
|
||||
echo -n "Mailbox Number: "
|
||||
read mailbox
|
||||
mkdir -p ${VMHOME}/${mailbox}
|
||||
mkdir -p ${VMHOME}/${mailbox}/INBOX
|
||||
cat ${SNDHOME}/vm-theperson.gsm > ${VMHOME}/${mailbox}/unavail.gsm
|
||||
cat ${SNDHOME}/vm-theperson.gsm > ${VMHOME}/${mailbox}/busy.gsm
|
||||
cat ${SNDHOME}/vm-extension.gsm > ${VMHOME}/${mailbox}/greet.gsm
|
||||
|
||||
context=${context:-default}
|
||||
|
||||
if [ ! -e "${VMHOME}/${context}" ]
|
||||
then
|
||||
echo
|
||||
echo "New Voicemail context.."
|
||||
echo "Creating Voicemail context directory..."
|
||||
mkdir -p ${VMHOME}/${context}
|
||||
fi
|
||||
|
||||
echo
|
||||
echo "Creating Voicemail directory..."
|
||||
mkdir -p ${VMHOME}/${context}/${mailbox}
|
||||
echo "Creating INBOX..."
|
||||
mkdir -p ${VMHOME}/${context}/${mailbox}/INBOX
|
||||
echo "Creating Default greetings..."
|
||||
cat ${SNDHOME}/vm-theperson.gsm > ${VMHOME}/${context}/${mailbox}/unavail.gsm
|
||||
cat ${SNDHOME}/vm-theperson.gsm > ${VMHOME}/${context}/${mailbox}/busy.gsm
|
||||
cat ${SNDHOME}/vm-extension.gsm > ${VMHOME}/${context}/${mailbox}/greet.gsm
|
||||
nums=`echo $mailbox | sed 's/./ \0/g'`
|
||||
for x in $nums; do
|
||||
cat ${SNDHOME}/digits/${x}.gsm >> ${VMHOME}/${mailbox}/unavail.gsm
|
||||
cat ${SNDHOME}/digits/${x}.gsm >> ${VMHOME}/${mailbox}/busy.gsm
|
||||
cat ${SNDHOME}/digits/${x}.gsm >> ${VMHOME}/${mailbox}/greet.gsm
|
||||
cat ${SNDHOME}/digits/${x}.gsm >> ${VMHOME}/${context}/${mailbox}/unavail.gsm
|
||||
cat ${SNDHOME}/digits/${x}.gsm >> ${VMHOME}/${context}/${mailbox}/busy.gsm
|
||||
cat ${SNDHOME}/digits/${x}.gsm >> ${VMHOME}/${context}/${mailbox}/greet.gsm
|
||||
done
|
||||
|
||||
cat ${SNDHOME}/vm-isunavail.gsm >> ${VMHOME}/${mailbox}/unavail.gsm
|
||||
cat ${SNDHOME}/vm-isonphone.gsm >> ${VMHOME}/${mailbox}/busy.gsm
|
||||
cat ${SNDHOME}/vm-isunavail.gsm >> ${VMHOME}/${context}/${mailbox}/unavail.gsm
|
||||
cat ${SNDHOME}/vm-isonphone.gsm >> ${VMHOME}/${context}/${mailbox}/busy.gsm
|
||||
echo "Complete."
|
||||
|
||||
|
|
Reference in New Issue