|
SYS-CON.TV Webcasts
Comments
Did you read today's front page stories & breaking news?
SYS-CON.TV
|
Top Links You Must Click On
Sysadmin Installing a text-messaging gateway on Debian
Part 10 in our 'Linux for peanuts' series, we serve QuickPage for the first time with Debian's fresh Potato!
By: Colin Mattoon
Jan. 17, 2002 12:00 AM
(LinuxWorld) -- My view of Debian probably derives from the fact that the Debian community doesn't rename a release every time it updates the operating system. The truth is, Debian "stable" (codenamed Potato) is considerably different today than it was a year ago. Now at release 2.2.5r, Debian stable is about as close to the bleeding edge as I want to get with a production machine, and in fact, sufficiently different from it's earlier versions that it has been necessary to make a few changes in the configuration details of our Text Messaging Gateway. Nevertheless, that is part of the beauty of Debian, and a fact if you install Debian by way of the Internet. If we had chosen Red Hat 6.1 or Slackware 4.0 as our platform, and; if we built our Text Messaging Gateway from increasingly older versions of the applications, then; the details of configuration would never change. Our Gateway, however, would not benefit from the latest security updates and improvements. If you get to feel sorry for yourself because Debian does change, and that you are forced to occasionally change procedures with it, just be glad that you are working as a sysadmin. You are, by necessity, working indoors where it is both dry and warm (or else your servers aren't going to last very long). If you read my bio at the end of each of the articles in this series, you will notice that:
Then, if you look at the calendar, you might note that it is winter in the Northern Hemisphere. Much of my December was spent outdoors, on a mountain, in the snow, doing whatever was necessary to get a new transmitter building ready for occupancy by a customer who waited until the last minute to meet an FCC construction permit deadline. The customer was warned that Idaho's winter weather is unpredictable, and they were caught. It cost them, because it necessitated an "all hands" effort to save their license. I spent my holidays driving ground rods in frozen soil and rotten basalt bedrock, wiring outlets, and helping carry spools of 7/8-inch diameter coax. That left little time to write this installment, but that's okay, because the past month permitted Debian to update stable to 2.2.5r. It's always good to document a procedure with the latest version so that the documentation doesn't become obsolete quickly. Before we return to the task of configuring our Text Messaging Gateway, it is a good time for you to login as root and open /etc/apt/sources.list with your favorite text editor to make sure you have the necessary lines uncommented to fully update your machine. Here are the three lines I uncomment (remove the leading hash mark "#") to ensure that apt-get can access any files we need: deb http://security.debian.org stable/updates main contrib non-free deb http://http.us.debian.org/debian/ stable main non-free contrib deb http://non-us.debian.org/debian-non-US stable/non-US main contrib non-free After saving any changes to the sources.list file, you should then run:
Followed by:
And for good measure:
See Now, we are all reading from the same page and are all updated to Debian Potato 2.2.5r, so without further ado, let's get busy and get QuickPage up and running: Step 1. Get an old modemIn Part 9 of this series, I advised you to obtain a modem for this machine. The purpose of this modem is to establish a connection with the TAP/IXO modems of the various paging, PCS and cell phone services you wish to send text messages through. Shut down the machine and install that modem now.I grabbed an old 9600-baud ISA modem and set it's jumpers to com 3 and irq 4. Internal or external makes no difference as long as it is Linux compatible and doesn't conflict with any other hardware. Speed is of little importance because the communications vendors don't typically support speeds above the 1200~4800 baud range. Step 2. Get QuickPageOnce the modem is installed, power up the computer and login as root. You just ranapt-get update and apt-get upgrade, so you are ready to install QuickPage. The following command will fetch the latest binary from Debian's server:
As soon as apt-get is finished with it's magic, we can begin to configure QuickPage to permit basic command line operation. Step 3. Tell QuickPage & Linux about the old modemWe need our modem to work with QuickPage and odds are you will need to open /etc/serial.conf with a text editor and uncomment the appropriate line.In my case, I set the modem for com 3, which corresponds with /dev/ttyS2, so I open /etc/serial.conf with Easy Editor (ee) and uncomment the line that reads: /dev/ttyS2 uart 16450 port 0x3E8 irq 4 You will need to uncomment (remove the "#") the line appropriate for your modem which may, or may not, be /dev/ttyS2. Now, reboot the machine so that the serial port is activated. Step 4. Muck around in the tty filesLogin as root again, and change to the /dev directory:
Pipe
If you forgot to install less with the apt-get utility, now is a good time! ( You will notice the permissions for /dev/ttyS0 through ttyS3 are set at:
Unfortunately, that won't let QuickPage dial out. The easiest way to give QuickPage access to the modem is to change the permissions of this file:
Run
Step 5. Configure the first QuickPage config fileThere are two configuration files that are created under /etc when QuickPage is first installed. They are qpage.cf and qpage.servers.Configuring qpage.servers is the easier task, so we will get that out of the way first. Open the file with a text editor and remove the sole entry:
Replace that entry with:
Save this change to the file. Easy, huh? This simply tells the QuickPage client to look no further than this machine for the QuickPage server. Step 6. Gather some informationConfiguring qpage.cf isn't particularly difficult, but it does require some information that I cannot supply for you. Therefore, Step 6 involves gathering some information. You need to know:
The first one is easy. Ask the person carrying the pager! The second item is a bit more involved. You may be able to call each provider's local office and get the number. It is just as likely their newly hired sales staff will tell you they don't have any such number, or that they don't understand your request. You can look at http://www.qpage.org/phone-numbers.html for a list of numbers thoughtfully provided by Mr. Thomas Dwyer III, the developer of this excellent package. While not 100-percent complete or up-to-date, this list is an excellent starting point. The third item, connection speed, can be problematic. I suggest you begin by attempting to connect at 1200 baud and experiment as needed. Mr. Dwyer's list contains some hints for some services and if you can reach some one in tech support or maintenance at the paging or cell phone company you need to connect with, you may (and I emphasize may) get an authoritative answer. In many instances, experimentation is the only practical solution. Step 7. Configure the other QuickPage config fileWith the information you obtained in Step 6, we set out to configure /etc/qpage.cf. My suggestion is to rename the default qpage.cf to something like oldqpage.cf with the mv command like so:cd /etc mv qpage.cf oldqpage.cf That way, you can refer to Dwyer's comments and examples at your convenience without having to worry about an overlooked line remaining to interfere with your own configuration. Then, with your favorite text editor, create a new qpage.cf file. I'll use Easy Editor:
In this file, you must define the following items (an explanation for each is found in the oldqpage.cf you just created with the mv command):
If you refer back to Part 9 of this series, you will find good 'ol Tom Smith in the shipping department. In the screen shot, Tom just got an unpleasant message from the head of personnel, Basil Buffoon. We will configure /etc/qpage.cf to work with Tom's PCS phone and Basil's alphanumeric pager. There will be two service providers defined and only these two users, so that we don't obscure the essential details with repetition. Here is our example /etc/qpage.cf file: # Configuration file for QuickPage.
#
###########################################
# Who runs this show? Where do we put stuff?
#
administrator=root@localhost
queuedir=/var/spool/qpage
#
###########################################
#
# How long do we beat our head against the wall?
#
identtimeout=5
snpptimeout=60
#
###########################################
#
# Where did we hide the modem and what makes it tick?
#
modem=ttya
device=ttyS2
initcmd=ATZ
#
###########################################
#
# Who are we paying for pager and/or phone service? What is the connection speed?
# What number do we dial to connect to their TAP/IXO modem?
#
service=AlwaysBusyPCS
device=ttya
baudrate=2400
parity=even
allowpid=yes
maxtries=10
phone=1-800-555-1212Save this file, reboot the machine, and refill your coffee cup. When you get back, we will test QuickPage. Step 8. Test your handiworkMake sure your Text Messaging Gateway's modem is plugged into a phone line, then get ready to send Tom Smith the message guaranteed to calm his frazzled nerves. At the command line, enter:
Quickpage responds with:
So, you type: Hi, Tom. Basil was just kidding about firing you. We are just testing the text messaging system. . When you press Enter you are returned to the command prompt. QuickPage then dials the TAP/IXO phone number for AlwaysBusyPCS, identifies the intended recipient as Tom Smith (or rather, Tom's PCS phone number: 412-555-1212) and passes on the text message for transmission to Tom's phone. Depending upon the service, and traffic, Tom should get the message within a minute or two. Now that you have QuickPage up and running, it is a good time to add your remaining users and additional service providers (if any). In Part 11 we will integrate QuickPage and a local mail server, and I promise you won't have to wait as long for the next installment as you did this one! Reader Feedback: Page 1 of 1
Enterprise Open Source Magazine Latest Stories . . .
Subscribe to the World's Most Powerful Newsletters
Subscribe to Our Rss Feeds & Get Your SYS-CON News Live!
|
SYS-CON Featured Whitepapers
Most Read This Week |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||