POTS programming exercise


In this exercise you will write the complete control program for POTS (Plain Ordinary Telephone Service). This exercise can be done using real telephony hardware or using a simulator for the hardware.

You have at your disposal:

You may also have The exchange consists of telephony hardware, power suplies, divers racks etc. However all we are interested in is. You can either use the simulator while testing programs or you can use the real hardware. If you use the real hardware you can use the simulator to shadow what the hardware is doing.

All you have to do is to write the call handling software for the most simple case of POTS. This should be less than 100 lines of Erlang. You can either write your own "number analyser", to analyse the numbers you dial or use the number analyser provided. Assign the telephone numbers as as follows.

	Telephone No. & Port (DTS)
	123		64
	124		65
	13		66
	247		67
The only parts of digital telephone set we will use are the handset (which will generate on and off hook signal when you put it down or lift it and the 'number' buttons - all other buttons, LED's etc can be ignored (we have the software to handle them so if you finish early you can write some fancy features using the display and the other buttons).

The system you have has in-built error recovery, so if you do naughty things your processes will be killed and the skelital control process will be restarted. (The telephones will be reset and the switch connections removed).

Start by running the telephony system as is. Look at the directions in the file dts.erl to see how to start the system.


Running the system

Copy the files dts.erl and dts.jam to some suitable directory.

Make sure you have the line:

    code:add_path('\$DIR/pots').
in the file .erlang in your home directory.

At the CSL $DIR is the directory

    /home/super/erlang/course/course1.3/exercises
this directory may be different on you machine

Start the Erlang system:

    erl
The system is started by calling one of the functions: When you have done this, look at the code for dts.erl and experiment with the simulator and/or hardware.

If you wish to start new processes when the system is started (for example to change the number analysis server) you will have to modify start.erl

Don't forget to compile your own versions of dts.erl and start.erl when you have modified them.