Functions | |
string | Send (type mobile, type message) |
send out SMS | |
Variables | |
string | SMSGWY = UNKNOWN |
variable used as the smtp eMail address of the mail2sms gateway | |
string | SMSDB = UNKNOWN |
variable used as the smtp eMail address of the BID server on the SMS database host |
variable | string NAME = DEFAULT | set NAME DEFAULT |
variable | array NAME = DEFAULT | array set NAME DEFAULT |
procedure | string NAME ( type ARG1, ... ) | proc NAME {ARG1 ...} |
procedure | string NAME ( optional ARG1=DEF1, ... ) | proc NAME {{ARG1 DEF1} ...} |
lib/libSMS.tcl
is available with: package require sms ?1.0?
The SMS workflow was designed as a filter between the SMS sending application and the mail2sms gateway to provide a mobile-number lookup service. The mail2sms gateway is not part of the workflow and have to be already available. The format of the mail2sms gateway eMail requires the mobile-number as the subject and the sms-message as the body. The interface to your local mail2sms gateway can be customized by modifying the file lib/libSMS.tcl .
The SMS workflow has the following components relative to the root directory of the BID server:
location | type | description |
---|---|---|
lib/libSMS.tcl | package | main config file with the definition of the SMS sending procedure sms::Send and the configuration parameter sms::SMSDB and sms::SMSGWY . |
plugins/sms/db-write.tcl | service | write name key and mobile value into the database on sms::SMSDB host. If the current host is not sms::SMSDB host than forward the service to the sms::SMSDB host. |
plugins/sms/db-delete.tcl | service | delete name key from the database. If the current host is not sms::SMSDB host than forward the service to the sms::SMSDB host. |
plugins/sms/db-read.tcl | service | read name key from the database and call the sms::Send procedure to send out message. This service can only be called on sms::SMSDB host. |
tests/sms.test | test-unit | quality test-unit used to perform various tests on the sms-workflow. This file is only available in the distribution directory of the BID server. |
plugins/test/sms.tcl | test-service | quality test-service used together with tests/sms.test to perform various tests on the sms-workflow. This file is only available in the distribution directory of the BID server. |
In addition two public services are available to add and delete mobile numbers from the database:
sms/db-write name mobile | write the name key with mobile value into the database on the host sms::SMSDB |
sms/db-delete name | delete the name key from the database on the host sms::SMSDB |
a service is called using the my-service@other data subject of the mime header and the arguments encoded using the ParseBody body syntax.
example:
sms/db-write
service using the UNIX command-line tool mailx
. mailx -s sms/db-write@mail bid@server <<EOF ><name:support-mobile ><mobile:123-456-789 EOF
sms::Send lookup@support-mobile "ALARM: the main server is down"
string sms::Send | ( | type | mobile, | |
type | message | |||
) |
send out SMS
mobile | the mobile number or a text to do the database lookup | |
message | the SMS message to send |
lookup@
prefix than forward the service to the sms::SMSDB host to do a mobile-number lookup first otherwise the service will be directly forwarded to the email2sms server
string sms::SMSGWY = UNKNOWN |
variable used as the smtp eMail address of the mail2sms gateway
user@hostname
string sms::SMSDB = UNKNOWN |
variable used as the smtp eMail address of the BID server on the SMS database host