Author |
Post |
|
#1 Sat Sep 25, 2010 11:26, 176 months ago.
|
Member
Registered: Sep 2010
Location: Biella, Italy
|
Operating system name and version: Debian Lenny Version of smsd: 3.1.3 Smsd installed from: sources Name and model of a modem / phone: Motorola MC35i Interface: USB Hello, I need to configure multiple GSM Box and I don't know how to set different incoming, outgoing, failed and sent directory for each GSM box connected to the system...how can I do it? I can only set the queques but it's not enough... I use 3 different web appplication that need to send sms via sms3tools but any application is completely independent from the other and I have to manage in different way the sms that are sent or received. Anybody can help me? Thanks Mediam71 - Softplace.it --------------------- _______________ ----------------------------- Mediam71
|
|
#2 Sat Sep 25, 2010 12:33, 176 months ago.
|
Administrator
Registered: May 2009
Location: Jyväskylä, Finland
|
Queue sorting will handle outgoing messages, as you have already done. For other message types you need to define and create an eventhandler script. In the global part of smsd.conf, define: eventhandler = /usr/local/bin/smsd_eventhandler.shCreate the script with the following content and make it executable for smsd: #!/bin/bash
BASEDIR="/var/spool/sms"
# Convert type to lowercase: type=$(echo $1 | tr A-Z a-z)
# Change "received" to "incoming": [ "$type" == "received" ] && type="incoming"
# Get the name of a modem: modem=$(formail -zx Modem: < $2)
# Build the name of a directory: dir="${BASEDIR}/${type}_${modem}"
# Create the directory if necessary: ! [ -d "$dir" ] && mkdir "$dir"
if [ "$1" == "SENT" ]; then # Move sent file using it's own name: mv "$2" "$dir" else # Create an unigue name for other message files: filename=$(mktemp "${dir}/${modem}.XXXXXX") mv "$2" "${filename}" fi
exit 0 'bash' Syntax Highlight powered by GeSHi The script automatically creates directories under /var/spool/sms: incoming_GSM1, failed_GSM2, sent_GSM3 and so on. If in your system there is no formail available, install the procmail package.
|
|
#3 Sat Sep 25, 2010 16:35, 176 months ago.
|
Member
Registered: Sep 2010
Location: Biella, Italy
Topic owner
|
Thank you very much, I will try and tell you if it works! Bye Mediam71 - Softplace.it ---------------------- _______________ ----------------------------- Mediam71
|
|
#4 Thu Oct 07, 2010 13:15, 175 months ago.
|
Member
Registered: Aug 2010
Location: Port-au-prince, Haiti
|
Hello there, Thanks for sharing those infos.Then, what i need me is to know how i can modify this eventhandler to catch a file in the directory of a user and put it in the outgoing queue? I am using the a computer with linux installed on(ubuntu server 9.10).In the other hand ho can i make the eventhandler executable for smsd? Best regards!
|
|
#5 Thu Oct 07, 2010 16:39, 175 months ago.
|
Administrator
Registered: May 2009
Location: Jyväskylä, Finland
|
masterxunil wrote Then, what i need me is to know how i can modify this eventhandler to catch a file in the directory of a user and put it in the outgoing queue?
If you do not need anything more than you wrote, just start the script with: #!/bin/bash
filename=$(mktemp "/var/spool/sms/outgoing/userfile.XXXXXX") cp "/home/user/directory/file" "${filename}" 'bash' Syntax Highlight powered by GeSHi But I assume that this is not enough for your system. You could clarify your requirement  and show what kind of a setup you currently have. masterxunil wrote In the other hand ho can i make the eventhandler executable for smsd?
Run chmod 755 /path/to/eventhandler. This is the easiest way, but of course you may want to use user/group permissions for those executables. Some Unix tutorials will explain how permissions work, if you are not familiar with them.
|