SMS Server Tools 3
 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. The forum is currently read-only, but will open soon. Fri Nov 22, 2024 04:44
SMSTools3 Community » Help and support Bottom

[answered] multiple applications, modems and providers

  This topic is locked

Page:  1

Author Post
Member
Registered:
Dec 2009
Location: Netherlands
Operating system name and version: Ubuntu 9.10 (Karmic Koala)
Version of smsd: 3.1.3
Smsd installed from: package repository
Name and model of a modem / phone:
Interface: USB

Dear All,

First of all, many thanks for this application. It has really helped me for the last couple of months. In fact, things have been going so well I'm about to add other modems to connect more applications to SMS.

My situation:
- 2 applications
- 2 providers with NO interconnection

Each application has its own numbers (1 number per provider).

Question 1:

Till now i only had 1 application, so using [queues] and [providers], things were straightforward. But now i have 2 applications and i need to know how to configure smstools so i can use 1 smstools setup with 2 (and maybe later more) applications while (per application) still choosing the right modem and provider.

Choosing the right modem is easy using Queue: in the sms file, but once i do that i can't sort per Provider anymore. Of course i could do that in my applications, but i'd rather leave all that to smstools.

Question 2:
I use USB modems plugged in an USB hub, is there a correct way to ensure the devicenames (/dev/ttyUSB1 etc) keep referring to the same modem after a reboot?

Question 3:
What is the purpose of the directories in the [queues] section? Are they only for outgoing messages? And why can't i just use the normal outgoing/ dir?

Thanks in advance for any insights,

IvS

Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
Thank's for the feedback.

IvS wrote
Question 1:

Till now i only had 1 application, so using [queues] and [providers], things were straightforward. But now i have 2 applications and i need to know how to configure smstools so i can use 1 smstools setup with 2 (and maybe later more) applications while (per application) still choosing the right modem and provider.

Choosing the right modem is easy using Queue: in the sms file, but once i do that i can't sort per Provider anymore. Of course i could do that in my applications, but i'd rather leave all that to smstools.

There is no configuration option for different provider for each application.

While still defining providers and queues as you have done, you could create a custom checkhandler which will do the sorting. This overrides the internal sorting, but can handle (for example) Application: header.

It could be something like this:

#!/bin/bash

# Check if it's already queued:
queue=`formail -zx "Queue:" < "$1"`
if [ "x$queue" == "x" ]; then
  queue=`formail -zx "Provider:" < "$1"`
fi

echo "queue: $queue"
if [ "x$queue" == "x" ]; then

  application=`formail -zx "Application:" < "$1"`
  to=`formail -zx "To:" < "$1"`

  case "$application" in

    "Application_1" )

      key="35840"
      if [[ "$to" == $key* ]]; then
        queue="SONERA1"
      else
        key="35846"
        if [[ "$to" == $key* ]]; then
          queue="ELISA1"
        fi
      fi
      ;;

    "Application_2" )

      key="35840"
      if [[ "$to" == $key* ]]; then
        queue="SONERA2"
      else
        key="35846"
        if [[ "$to" == $key* ]]; then
          queue="ELISA2"
        fi
      fi
      ;;

  esac

  if [ "x$queue" != "x" ]; then
    tmp=`mktemp /tmp/smsd_checkhandler_XXXXXX`
    cp "$1" $tmp
    formail -f -I "Queue: $queue" < $tmp > "$1"
    unlink $tmp
  fi

fi

exit 0
 
 
'bash' Syntax Highlight powered by GeSHi


In the case of number portability, if you have a database of customers containing their numbers and operators, you can use the eventhandler to check it too and apply a correct provider.

IvS wrote
Question 2:
I use USB modems plugged in an USB hub, is there a correct way to ensure the devicenames (/dev/ttyUSB1 etc) keep referring to the same modem after a reboot?

It's called udev. I do not use it myself, so I cannot give instructions how to configure rules. However, I know that it's used in large setups and it's working. Google knows how to set it up ;).

IvS wrote
Question 3:
What is the purpose of the directories in the [queues] section? Are they only for outgoing messages? And why can't i just use the normal outgoing/ dir?

Those directories store outgoing messages until a modem process sends them. Usually, all outgoing message files should be created into the outgoing directory. Main process of smsd checks this directory periodically and spools messages to the queues. The checkhandler is executed before the message file is spooled. Different directory for each queue is used because otherwise processes should read the headers any time when files are handled. If all files are in the same directory, this will take a long time if there are lot of files.

Member
Registered:
Dec 2009
Location: Netherlands
Topic owner
Hi Keke,

Thanks for your response.

I had already decided to do the provider sorting in my application(s) and set the correct Queue before writing the message in the outgoing/ folder. That way smsd doesn't have to do provider sorting anymore.
By the way, is it possible to leave the [providers] section out?

Yes, I'm using udev right now :)
Is is possible (maybe something for a new feature) to make smsd just scan for all attached modems and use their simcards IMEI/tel numbers to tell them apart? That would make it easier to swap modems/simcards and make an smsd config more portable.

Something else, I've noticed it takes about 5 seconds to send an sms (i think that's normal because it's even in the FAQ). It would be great if this time could be improved, but i have to admit i have no idea about the difficulties involved.

Thanks again for this great piece of software!

Iwan

Member
Registered:
Dec 2009
Location: Netherlands
Topic owner
oops, i forgot to ask something :)

Apart from adding Queue: to the message file, is there another way to specify which modem to use for sending the message? Preferably one which allows me to drop the [queues] section altogether?

Thnx again

Iwan

Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
IvS wrote
Is is possible (maybe something for a new feature) to make smsd just scan for all attached modems and use their simcards IMEI/tel numbers to tell them apart? That would make it easier to swap modems/simcards and make an smsd config more portable.

There is an undocumented identity setting which can be used swap modems. This however only works with fixed device names. For example if ports are /dev/ttyUSB0 and /dev/ttyUSB1, this feature can swap modems using IMSI or IMEI as an identification. This feature does not search ports. Smstools has no built-in scanning for all available modems, because usually this is not needed and scanning varies by the environments. (Smstools runs on any Unix and on Windows).

Scanning can be inserted to the startup script which can modify the configuration, if necessary.

IvS wrote
Something else, I've noticed it takes about 5 seconds to send an sms (i think that's normal because it's even in the FAQ). It would be great if this time could be improved, but i have to admit i have no idea about the difficulties involved.

Sending time cannot be improved as it's depended on the GSM network.

IvS wrote
Apart from adding Queue: to the message file, is there another way to specify which modem to use for sending the message? Preferably one which allows me to drop the [queues] section altogether?

Currently modems can be specified only with queues.

Probably some Modem: header could be used to specify the modem, but still there must be queue directories defined and existing. Only the definition of Providers could be left out. This does not help very much. However, if there are queues defined, providers could default to "0,1,2,3,4,5,6,7,8,9,s". I have to think about this kind of change.

Member
Registered:
Dec 2009
Location: Netherlands
Topic owner
Ok,

thanks for the prompt response! Everything works quite ok with udev and Queue, so i guess none of the above is that important anymore :D

I have another problem, but for clarity I've started a new topic for that.

Ivs

PS. is it possible to donate using a creditcard? I haven't used paypal in years.

Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
Ok, I will not change the headers.

IvS wrote
PS. is it possible to donate using a creditcard? I haven't used paypal in years.

Sorry, I do not have such kind of option.

  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.