SMS Server Tools 3
This site is hosted by Kekekasvi.com
 Menu
Basic information:
Additional information:
Support:
Get SMS Server Tools 3:
Additional Options

 Sponsored links

 Search
Custom Search

 Visitor locations
 
 SMS Server Tools 3 Community
Welcome, Guest. Please login or register. Sat May 25, 2024 11:17
SMSTools3 Community » Help and support Bottom

[answered] Multiple GSM config

  This topic is locked

Page:  1

Author Post
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

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.sh

Create 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.

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

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!

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.

  This topic is locked

Page:  1

SMSTools3 Community » Help and support Top

 
Time in this board is UTC.  

Privacy Policy   SMS Server Tools 3 Copyright © Keijo Kasvi.