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 Apr 20, 2024 01:04
SMSTools3 Community » Help and support Bottom

[answered] Two modems(devices) with one as fallback

  This topic is locked

Page:  1

Author Post
Member
Registered:
May 2009
Hello to all,

We are using smstools3 as a main component of our infrastructure. Great piece of software!

Now I have a question. We have to IP-Based Multitech Multimodems and we would like to use one of them (GSM1) as primary device because we have a large sms account on it.

The second device (GSM2) should only be used if the first try to send a sms via GSM1 fails. (different Provider, small sms account).

Is it possible to create such a configuration?

Edit: Or is by default always GSM1 used if there is no provider configuration? This would be perfect, but I could not found a hint in the documentation about it.

Thanks and kind regards,

Mario


« Last edit by notbuu on Wed May 27, 2009 08:35, 181 months ago. »
Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
If no provider configuration is used, both modems will serve the same queue and which one finds a message first, will send it.

Fallback device configuration needs queues and eventhandler script:

Smsd.conf global section:

eventhandler = /usr/local/bin/smsd_eventhandler

[queues]
GSM1 = /var/spool/sms/GSM1
GSM2 = /var/spool/sms/GSM2

[providers]
GSM1 = 0,1,2,3,4,5,6,7,8,9,s
GSM2 = 0

Smsd.conf modem sections:

[GSM1]
queues = GSM1

[GSM2]
queues = GSM2


With this kind of configuration GSM1 is used to send all messages (which are not specifically targeted to GSM2).

When sending fails, eventhandler script is called with "FAILED" as a first argument. Eventhandler code can check if a message was not already tried to send using GSM2, and if it was not, message can be moved back to the spooler with Queue: GSM2 header.

For example:
#!/bin/bash

if [ "$1" = "FAILED" ]; then

  # Check if there was Queue defined:
  queue=`formail -zx Queue: < $2`

  if [ "x$queue" != "xGSM2" ]; then

    # Was not already handled using GSM2.

    # Create a new message file:
    FILE=`mktemp /tmp/send_XXXXXX`

    # Copy a message and insert a Queue: header:
    formail -f -I "Queue: GSM2" < $2 > $FILE

    # Move message back to the spooler:
    FILE2=`mktemp /var/spool/sms/outgoing/send_XXXXXX`
    mv $FILE $FILE2

  fi
fi
 
'bash' Syntax Highlight powered by GeSHi


Note that smsd itself does not support large sms account. It supports modems with AT command set. I'm not sure about your Multitech device, doest it offer AT command interface for the IP based large account? (I assume that it does not, but have to ask, because this kind of interface would be interesting for many users).

Member
Registered:
May 2009
Topic owner
Wow great!

I will try this configuration. With "large SMS" account I mean a normal AT modem with a sim card with a special monthly charge. This allows us to send 10k sms for cheap.

Kind regards,

Mario

  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.