Use your PC as an answering machine using xPLPhone - XPLProject

Contents

Introduction

xPLPhone is a free application that turns your computer's voice modem into a completely xPL-enabled device. This offers an amazing level of flexibility, allowing you to use your PC as an answer machine, a way of controlling your home via telephone, or even for having your emails read to you!

This How To guides you through installing and configuring xPLPhone, and shows you what can be done when xPLPhone is combined with the powerful xPLHal controller software.

Users who own a CTI Meteor (or similar) caller ID unit can enhance things even further to allow intelligent decision making based on the caller's identity. This guide however does not include anything that requires the use of a Meteor.


What You Need

  • A PC running Windows 2000, Windows XP or Windows Server 2003.
  • A voice modem with appropriate drivers for your operating system
  • Microsoft SAPI version 5.0 or later
  • xPLHal, xPLHal manager and an xPL Hub installed and configured as described in the HowTo guide Get Started on Windows


Downloading the Software

Download the file xPL Phone from http://wiki.xplproject.org.uk/downloads/xpl_phone.zip (1.7MB).


Installing xPLPhone

Note that xPLPhone does not need to be installed on the same computer as xPLHal - they can be installed anywhere on the local network.

  • Unzip xpl_phone.zip to a temporary directory.
  • Run the Setup program by double-clicking on setup.exe.
  • Follow the on-screen prompts to complete the installation of xPL Phone.


Configuring xPL Phone

Note: Before beginning the configuration process you should ensure that xPLHal (or another suitable configuration manager) is running. You should also update your plug-in library, ensuring you have the TONYT plug-in installed. You can do this by selecting Help -> Update Plug-in Library from within the xPLHal Manager.

  • Click Start -> Programs -> xPLPhone -> xPLPhone.
  • The application will launch.
  • Open the xPLHal Manager, and look under xPL Devices -> Awaiting Configuration.
  • Double-click on xPL Phone, which will appear as TONYT-PHONE.<computer-name>
  • When the configuration dialog appears, rename the instance name of xPL Phone to something appropriate for your installation.
  • Leave all other items at their default values, and click OK to close the dialog.


Testing xPLPhone

In addition to answering incoming calls, xPLPhone is also able to make outgoing calls. The following steps will test xPLPhone's ability to place an outgoing call:

  • In the xPLHal Manager, right-click on the Determinators node and select New Determinator.
  • When the New Determinator Wizard appears, click Next.
  • Enter a name for the determinator, such as "Phone: Make outgoing call". By prefixing all your xPLPhone-related determinators with "Phone:", it is easy to identify them in the list.
  • Leave the conditions page blank and click Next to move on to the actions page.
  • Click Add.
  • Enter "Dial" as the name of the action.
  • Select your xPLPhone device from the list of devices.
  • Select "Dial number" from the list of actions, and enter a phone number to dial in the box provided.
  • Click OK.
  • Click Add to create another action.
  • Enter "Say hello" as the name of the action.
  • Select your xPLPhone device from the list of devices.
  • Select "Speak text" from the list of actions.
  • Enter the text you would like spoken, e.g. "Hello, this is your house speaking."
  • Click OK.
  • Click Add to create another action.
  • Type "Hang up" as the name of the action.
  • Select your xPLPhone device from the list of devices.
  • Select "Hang up" from the list of actions and click OK.
  • You should now have three actions listed: Dial, say hello and hang up.
  • Click Next, then click Finish to complete the Wizard.
  • Refresh the list of Determinators in xPLHal Manager to see the determinator you've just created.
  • Right-click on the determinator and select Execute Determinator.
  • xPLPhone should now dial the number you entered and speak the text you specified, before hanging up.


Troubleshooting

If xPLPhone does not make the outgoing call as expected, you can view the xPLPhone activity log located in C:\Program Files\xPLPhone to see what has gone wrong.


Setting up a basic answering machine

First, you need to tell xPLPhone to answer the phone after a specified number of rings. Each time the phone rings, xPLPhone generates an xPL message to indicate that the phone has rung. By tracking the number of "ring" messages received using a global variable, it is possible to determine when to answer the phone.

  • In the xPLHal Manager, right-click on Globals and select New Global Variable.
  • Enter the name as "LINE1_RINGS" and press Enter.
  • Enter the value as 0 and press Enter.
  • Right-click on the Determinators node and select New Determinator.
  • When the New Determinator Wizard appears, click Next.
  • Enter "Phone: Detect incoming ring" as the name of the determinator and click Next.
  • When the conditions list appears, click Add.
  • Enter "Detect ring" as the name of the condition.
  • Select your xPLPhone device from the list of devices, then select "Incoming ring detected" from the list of triggers.
  • Click OK.
  • Click Next to proceed to the actions list.
  • Click Add.
  • Enter "Increment ring variable" as the name of the action.
  • Select xPLHal from the list of devices if it is not already selected.
  • Select "Increment a global variable" from the list of actions, then select "LINE1_RINGS" from the list of global variables.
  • Click OK to save the action.
  • Click Next, then click Finish to complete the wizard.

You now have a global variable called LINE1_RINGS that will increment each time the phone rings. However, you want this variable to reset to zero each time the phone goes back on hook, so that it is ready for the next call.

To achieve this, follow these steps:

  • Right-click on the Determinators node and select New Determinator.
  • Click Next.
  • Enter "Phone: Reset ring count when not in a call" as the name of the determinator and click Next.
  • At the list of conditions, click Add, and enter "Not in a call" as the name of the condition.
  • Select your xPLPhone device from the list, then select "Heartbeat message received" from the list of triggers.
  • Select "None" from the list of call types, then click OK.
  • Click Next to move on to the actions list.
  • Click Add, and enter "Reset ring count" as the name of the action.
  • Select xPLHal from the list of devices if it is not already selected.
  • Select "Set the value of a global variable" from the list of actions.
  • Select the LINE1_RINGS global, then enter 0 as the value.
  • Click OK.
  • Click Next, then Finish to complete the Wizard.

Now that your global variable is in place to track the number of incoming rings, you can now tell xPLPhone to answer the phone and act like an answering machine.


Answering the Phone

For the purposes of this article, our answering machine will perform four tasks: Answer the phone, play a greeting, take a message, then hang up. You can easily expand this so that pressing something like the * key will take you into a menu system to allow remote control of other xPL devices in your home.

  • Start the New Determinator Wizard by right-clicking on the Determinators node in xPLHal Manager and clicking New Determinator.
  • At the Welcome screen, click Next.
  • Enter "Phone: Answer the phone" as the name of the determinator, and click Next.
  • On the list of conditions, click Add.
  • Enter "Detect change in ring count" as the name of the condition.
  • Select xPLHal from the list of devices, then select "Detect a change in a global" from the list of triggers.
  • Select the LINE1_RINGS global from the list and click OK.
  • Click Add to add another condition.
  • Enter "Ensure more than 4 rings" as the name of the condition.
  • Select xPLHal from the list of devices, then select "Compare global to a literal" from the list of triggers.
  • Select the LINE1_RINGS variable, select "Greater than" as the operator, and enter 4 as the value.
  • Click OK.
  • You now have a determinator that will fire whenever the phone has rung more than 4 times. Click Next to move on to the actions page.
  • Click Add.
  • Enter "Answer the phone" as the name of the action.
  • Select your xPLPhone device from the list of devices, and select "Answer the phone" from the list of actions.
  • Click OK.
  • Click Add to create another action.
  • Enter "Play greeting" as the name of the determinator.
  • Select your xPLPhone device from the list of devices, then select "Play wave file" from the list of actions.
  • Enter the name of the greeting file, such as greeting.wav, and click OK.
  • Click Add to add another action.
  • Enter "Play the beep" as the name of the action.
  • Select xPLPHone, then select "Play wave file" from the list of actions.
  • Enter beep.wav as the file to be played, then click OK.
  • Click Add to add another action.
  • Enter "Record a message" as the name of the action.
  • Select xPLPhone, then select "Record a message" from the list of actions.
  • In the Timeout field, enter the maximum message duration in seconds, e.g. 120 seconds will allow messages lasting up to 2 minutes.
  • In the filename field, enter a path like "C:\Inbox\{SYS::TIMESTAMP}.wav". The SYS::TIMESTAMP must be entered in uppercase letters, and will be replaced by a numeric representation of the current date and time when the call comes in, in the form yyyymmddhhmmss. This ensures that every message has a unique filename.
  • Click OK to save the action.
  • Click Add to create another action.
  • Enter "Hang up" in the name field.
  • Select xPLPhone, then select "Hang up" from the list of actions.
  • Click OK.
  • Click Add to create the final action.
  • Enter "Reset ring count" as the name of the action.
  • Select xPLHal from the list, and select "Set the value of a global variable" from the list of actions.
  • Select the global LINE1_RINGS, and enter 0 as the value, then click OK.
  • Click Next, then Finish to complete the Wizard.

Your modem will now answer the phone and take a message whenever the phone rings. If you want to restrict the operation of the answer machine so that it only answers the phone when you are away, you can add an extra condition to the determinator that checks that the MODE is set to EMPTY.


Conclusion

In this article we have shown you how to configure a basic answer phone using xPLPhone and xPLHal, however the real power of xPLPhone is realised when interfacing with other xPL components, such as allowing remote control of X10 devices, or in fact any device that is xPL-enabled.


Want to discuss this article?

If you have questions or comments about this article, you can join the mailing list enabled xPL forums.

This page was last modified on 3 December 2005, at 18:00. This page has been accessed 7,682 times.