(Example: +cartoon +desktops) Advanced Search & Tips
See the Home Page side bar for links to more sections!
App Makeovers Desktop Pictures Icons MacOS X Mods Safari Stuff
Application Splashes Dock Poofs iTunes Skins MacOS X Themes Snapshots
Boot Images Download Stats Links Page Mouse Cursors Uploads
Boot Panels GUI Software Login Panels REALbasic User Forum
Clocks Home Page
Download a free demo of REALbasic!
Download a free demo of REALbasic!

Recent Articles...
Attention
Mac OS X 10.2 Users!

Browse with Sherlock
By Date


By Category

3D
3D Photo Gallery Part 2 (12-06-01)
3D Photo Gallery Part 1 (11-29-01)

Audio
Laugh Track Machine
Audio Player with Reverb
Shepard Melody(11-08-01)
RB Phone Home (10-25-01)
Build a Drum Machine (10-04-01)

General RB
Listbox Auto-Find
iTunes-style Listboxes
Virtual Volumes
Time Tracker
Software Distribution Part 4
Software Distribution Part 3
Software Distribution Part 2
Software Distribution Part 1
Exceptions
Custom Controls (8-2-01)
Living on the Edge (6-21-01)
Tips and Tricks (6-14-01)
Review of REALbasic 3.0 (2-19-01)
Text Clippings Made Easy (5-10-01)

Graphics
Shimmer Graphics
Lissajous Figures
Simple Screen Capture
Vector Graphics
Kaleidoscope Images
Stegonography
Spirals!
Image Table (11-15-01)
RB Magnifying Lens (10-11-01)
Screen Capture (8-9-01)
Color Picker Tutorial (6-7-01)

Hacks
Ghost Grab
Speedy Mouse Extension(11-01-01)
iTunes Plugins (8-23-01)
iTunes Skinner (7-26-01)

Internet
HTML IMG Tags
Version Tracking
Even Smarter Instant Messaging
Web Tiler
JavaScript and REALbasic (10-02-01)
Stock Ticker - Part II (9-06-01)
Stock Ticker - Part I (8-30-01)
AIM Mate (8-16-01)

Mac OS X
Build a Bundle Part 2
Build a Bundle Part 1
Dock Your Passwords
Mac OS X Debugging
REALbasic Mac OS X Icon Tutorial (12-13-01)
Animate Your Dock (5-17-01)
RB and the Command Line (5-3-01)

Novelty
Tile Mixer
Zip Code Finder
Happy Valentine's Day
Merlin Simulator Part 3 (01-24-02)
Merlin Simulator Part 2 (01-17-02)
Merlin Simulator Part 1 (01-10-02)
Buzzword Machine (10-18-01)
AppleSoft BASIC (9-20-01)

Printing
Print to PDF

Resources
Picture Extractor 2 (5-31-01)
Picture Extractor 1 (5-24-01)

Serial
Caller ID Part 3 (7-12-01)
Caller ID Part 2 (7-5-01)
Caller ID Part 1 (6-28-01)

Speech
Speech Recognition (9-13-01)
Video
Big Brother Video Capture

Newest Dev Tools!

Book Alert !
REALbasic for Dummies
by Erick Tejkowski
$19.99 @ Amazon

Made with REALbasic!

Book Alert !
REALbasic the Definitive Guide
by Matt Neuburg

Problems?
Downloads are in StuffIt 5 format (free download).
Tell me about a bad link (Thanks!).
Submission Policy

7-12-01

Build a Caller ID Application (Part 3) by Erick Tejkowski

This week we continue with the third (and final) installment of the ResExcellence Caller ID tutorial. In the past two weeks, we discussed how to:

  • Connect Caller ID hardware to your Macintosh.
  • Read the basics of the Caller ID specification.
  • Write a simple REALbasic project to parse the CID data.

This week, we will look at how "private" and "out-of-area" calls are handled by CID. We will also improve the project by adding new features such as speech notification and database storage.

The Caller ID Specification - Continued

In previous installments, we saw that CID data gets sent as a string of characters through the modem. We focused on CID data in the MDMF format, which has a sequence like this:

DATA: About:
MESG = Begins the CID data stream
$80 Denotes MDMF data
$xx Msg length
$01 Parameter - Time
$08 length of time data
2 bytes Month
2 bytes Day
2 bytes Hour
2 bytes Minute
$07 Parameter - Name
$xx Name length
xxxx The name data
$02 Parameter - Phone #
10 digits The phone #

In case you are wondering what all of those dollar signs are about, they tell you that the number is in hex format. It's never a bad idea to have a hex converter on hand when programming. In the above table $xx denotes a hex number that will be different for each call. xxxx represents a string of characters that will differ for each call.

The above table demonstrates how CID data arrives on my particular CID. Your data may differ. For example, you may find that order of the name and phone number data are switched. This is due to the fact that the spec does not necessarily specify an order for parameters. Since each segment of the message is preceded by a parameter type code number (i.e. date, name, or phone #), your software could accept the data in any order based on that parameter code number. We won't go into how to do that here. Just be aware that it is a real possibility depending on how the data is sent to your home. If you live in another country, none of this code may work at all. Check around on the web to see if you can discover what format is in use for your particular country.

Until now, we have always assumed that CID data (the name and phone number) would be sent to our application. But, sometimes this is not exactly the case. For example, if the caller presses *67 before calling you, the phone call will be classified as "Private" and the letter "P" will be sent in place of the caller's name and phone number. In other instances, the caller may live too far away for the data to make it all the way to your phone. When this happens, the call is designated "Out of Area" and the letter "O" is sent in place of the name and phone number.

Fortunately, Private and Out-of-Area calls don't change the CID data stream much. The following table lists the order of CID data when the name and phone number are missing. Differences from the previous table appear in italics.

DATA: About:
MESG = Begins the CID data stream
$80 Denotes MDMF data
$xx Msg length
$01 Parameter - Time
$08 length of time data
2 bytes Month
2 bytes Day
2 bytes Hour
2 bytes Minute
$08 Parameter - Name
$01 Name length
P The name data ("P" or "O")
$04 Parameter - Phone #
$01 Phone # length
P The phone # ("P" or "O")

To help you visualize this better, a screenshot of CID data from a *67 phone call:

07-12_privatecall.jpg (22k)

The Code

If all of these specifications are making you crazy, you'll be happy to know that you won't need to change any code from last week to implement the Private and Out-of-Area phone calls. Still, it is good for you to know how the Caller ID data stream is organized, should you want to modify the code yourself later.

Instead of adding boring CID parsing code, we will focus on improvements to the Caller ID project. When you receive a call and parse the incoming data, you are free to do anything you want with it. Once you see a few of these ideas, you will begin to understand why a Mac-based Caller ID is much more svelte than a traditional CID box.

For starters, speech is a handy function that is easy to add to your Caller ID project. Imagine having your application speak the caller's number, or better yet, an interesting phrase, depending on who the caller is. I'm sure you can come up with many fun ideas for this feature.

To add speech, open the CallerID window and create a new Method. Name the method SpeakText, and enter thetext as string in the Parameters field. In this new method, add the following code:

dim i as integer

Declare Function SpeakString lib "SpeechLib" (SpeakString as pstring) as Integer
i=SpeakString(thetext)

As you might imagine, this code will speak any text you pass to it. To incorporate it into your Caller ID, add the following code to end of the ParseIncoming method:

SpeakText(labelphone.text)

Another benefit of using your computer is the fact that you can store your Caller ID history for days, weeks, months, and years at a time. Most hardware CID boxes permit storage of no more than a few dozen names. I have added a low-tech database to the Caller ID project, which can you download at the end of this tutorial. In the example, any new calls are added to a Listbox. That data can then be saved to a text file. Of course, you could choose a more high-tech approach. You might consider storing your CID info in a database. With REALbasic, there are many choices.

  • REAL Database
  • FileMaker database
  • AppleWorks
There are many other databases you could use, but these are some of the most likely choices for home users.

Hopefully some of these ideas have sparked your imagination. There are many interesting uses for this project. For instance, it would not be difficult to add the ability to:

  • Display a photo of your friends when they call
  • Play a particular sound when your mother-in-law calls
  • Email you a notice whenever someone calls
  • Predict what time of day telemarketers call
As you can see, the possibilities are limitless. And you thougt that old Mac was useless?

Download

As usual, you can

Next week, I will be writing to you from the MacWorld Expo in New York. I will be signing books at the REALSoftware booth, so stop by and say "Hi" if you are in the neighborhood. See you then!


7-10-01

REALbasic News by Erick Tejkowski

Ono...oh yes! Michio Ono has been unleashing loads of REALbasic goodies lately.

  1. Micono RbMovieUtil
    • Mac OS X compatible
    • Over 25 new methods
  2. Equalizer Plugin
    • Mac OS 9, Mac OS X, and Windows compatible
    • Three code demos; includes a pretty good "fake" of the iTunes screensaver.
But, don't forget about Ben Schneider's excellent QTAudioPlayer code. Ben manages to accomplish everything that Michio Ono does in the Equalizer plugin (and more), but without the use of plugins. Ben also tells me that there is a Mac OS X version coming very soon.

Small Size; BIG Features. Phoenix Design has released SmlControls which emulates the Mac OS X small radio button and check box controls with full alpha-masking, and adds advanced family control for radio buttons.

Four Mice for REAL. REALbasic 3.2 awarded 4 mice by Macworld Magazine The August issue of Macworld Magazine reviews REALbasic 3.2, rating it a "4-mouse" product.

"If you're looking for the easiest way to start programming your Mac, REALbasic 3.2 is the answer. Its closest competition -- Metrowerks CodeWarrior Learning Edition 2, which includes C, C++, and Java -- has a harsher learning curve, due ti the professional development environment it shares with its predecessor, CodeWarrior Professional. REALbasic isn't without flaws, but its ease of use and drag-and-drop approach can quickly turn novice coders into programmers, and programmers into coding machines"

Houston, we have a winner! The Houston Chronicle is running an article about the current state of Mac programming. REALbasic wins hands-down for speed and ease-of-use:

"...if you want to become really productive really fast, REALbasic is the way to go."

Easy Databases. Need some REALbasic database help? Try the EasyDB Classes. The creators claim you can learn to use the classes and become productive with REALbasic databases in less than 20 minutes.

Excellent! Sure, the new versions of REALbasic 3.5 support Microsoft Office automation, but what about when you need to get down and dirty with Excel files? ExcelWriter lets you create native Excel spreadsheets without the need for Office. The latest version removes restrictions for compiled apps.

Hurry up and wait... Freak Software recently posted FSWait giving you a true wait command which will halt all processing for the specified time.(It works like the old wait command in HyperCard.)

Feeling Edgy? For all experimenters out there, REALbasic 3.5a4 was released last week. Release notes included with the download detail the improvements and changes.



See the Home Page side bar for links to more sections!
App Makeovers Desktop Pictures Icons MacOS X Mods Safari Stuff
Application Splashes Dock Poofs iTunes Skins MacOS X Themes Snapshots
Boot Images Download Stats Links Page Mouse Cursors Uploads
Boot Panels GUI Software Login Panels REALbasic User Forum
Clocks Home Page

Maintained by the Staff of ResExcellence. This entire site ©1997-2003 ResExcellence
Privacy Statement? Sure we gotta Privacy Statement.

942 on the ResEx LinuxPPC Server