Main Page | Related Pages

Getting Started

In this section, I endeavour to describe how to get started and get to understand how this all hangs together.

Requirements to get running

The first thing required to do is download pwlib and opal from http://www.voxgratia.org/. The pwlib library will (most likely) be already on your box if you have a well known distribution such as redhat, suse, or debian. I suggest you remove pwlib from your box, to eliminate library conflict issues.

Specifically, they can be downloaded from the page: http://www.voxgratia.org/downloads.html. The Faq, http://www.voxgratia.org/docs/faq.html is helpful for solving most of the build issues you will come across. Build instructions for linux are contained in the tarballs. You may need to set the environment variable LD_LIBRARY_PATH to get the code to run.

The server, answering machine, and sound card utility do not need the opal library to compile and build. These applications rely on pwlib. The opal library is used in the voip utility to do H.323, SIP, or IAX2 calls.

There are python based programs as part of this application - these do the work of controlling everything. Python 2.2 is sufficient to run the controller scripts

Testing the server

The server is the program which allows the different Sofa Switch entities to communicate. You will compile it with the command make both, in the server directory. For debugging, run with the "-r" option, which reports all incoming messages. This allows you to quickly ascertain which component is doing the wrong thing.

The python program client.py will connect to the server. You can send messages from one instance to the other. Commands like, "list", "cons1:hello" (to send hello to instance cons1) should be tried. You also have "end", to terminate the python program, and "quitnow" to kill the server. Note that you can run the python programs on any machine. The only requirement is that there is a path for TCP packets to travel between the server and python programs.

server> python client.py console_2 localhost
list
 read in  console_2
 read in  cons1
cons1:hello
list
 read in  console_2
 read in  cons1
quitnow
OOOOOPS. The server has gone. We exit now.

The server reported:

server> server -r
 console_2 : list
 console_2 : cons1:hello
 console_2 : list
 console_2 : quitnow
end of this server program

The server output consists of two columns: left being the source of messages, and the right being the message itself. Note that here, the user was typing text in at the console identified as "console_2". No text was typed in at cons1.

Test sound card and Answering Machine

The sound card can be utilised in the Sofa Switch environment, and it can send/receive audio with any other Sofa Switch audio component. The Answering Machine is perhaps the simplest other audio component, which can play/record audio from/to a wav file.

In the sound directory, build the executable with make both

In the answering machine directory (am) build the executable with make both

Once the server is running, start sound with

./ob_linux_x86_r/audio -s machine_running_server -d Ensoniq\ AudioPCI
where the -d command specifies the name of the audio device.

Once the server is running, start the answering machine with

./ob_linux_x86_r/ssam -s machine_running_server 

For the test script to work, we expect that ssam is launched from a directory containing a 16bit, 8khz sound file, called "sample_message.wav"

In the controller directory, there is a python script that will connect the audio streams from the answering machine and sound executables together.

python testsound.py machine_running_server

The server reports the following messages.

controller : ssam:REQUESTNEWID
      ssam : controller:REQUESTNEWID ssam1
controller : ssam1:transferudp sound
     ssam1 : controller:OutgoingCall ssam1
     ssam1 : sound:transferudp sound 10.0.0.5:64000
     sound : ssam1:transferudp sound 10.0.0.5:61000 done
controller : ssam1:setannouncementfile sample_message.wav
controller : ssam1:setreceivedmsgfile derek.wav
controller : ssam1:hangup
     ssam1 : controller:Terminating

The messages are in four groups.

Test sound card, Answering Machine and Conference

In this section, we create a more complex example, which consists of one conference room which contains three members. One Member is connected to the sound card, and ther other two members are answering machines. One answering machine is left dormant. The second answering machine injects audio into the conference, and records the conference audio.

Note that the person connected to the sound card may also inject audio into the conference, simply by speaking into the microphone

The conference utility has to be compiled (make both) and invoked. The command line args are identical to ssam.

./ob_linux_x86_r/ssmcu -s machine_running_server 

The server reports

controller : ssmcu:REQUESTNEWID room
controller : ssam:REQUESTNEWID
     ssmcu : controller:REQUESTNEWID ssmcu1
      ssam : controller:REQUESTNEWID ssam1
controller : ssam1:transferudp ssmcu1
controller : ssam1:setannouncementfile sample_message.wav
     ssam1 : controller:OutgoingCall ssam1
     ssam1 : ssmcu1:transferudp ssmcu1 10.0.0.5:64000
    ssmcu1 : ssam1:OutgoingCall ssmcu1
    ssmcu1 : ssam1:transferudp ssmcu1 10.0.0.5:59000 done
controller : ssmcu:REQUESTNEWID room
controller : ssam:REQUESTNEWID
      ssam : controller:REQUESTNEWID ssam2
     ssmcu : controller:REQUESTNEWID ssmcu2
controller : ssam2:transferudp ssmcu2
controller : ssam2:setreceivedmsgfile derek.wav
controller : ssmcu:REQUESTNEWID room
     ssam2 : controller:OutgoingCall ssam2
     ssam2 : ssmcu2:transferudp ssmcu2 10.0.0.5:64001
     ssmcu : controller:REQUESTNEWID ssmcu3
    ssmcu2 : ssam2:OutgoingCall ssmcu2
    ssmcu2 : ssam2:transferudp ssmcu2 10.0.0.5:59001 done
controller : sound:transferudp ssmcu3
     sound : ssmcu3:transferudp ssmcu3 10.0.0.5:61000
    ssmcu3 : sound:OutgoingCall ssmcu3
    ssmcu3 : sound:transferudp ssmcu3 10.0.0.5:59002 done

From inspection of the messages, we see that

The testmcu.py script does not cause the conference to end. You can start up the client.py program, and send commands to any entity. You can, for example, ask ssam1 to play a different announcement file. The moment a new announcement file is specified in the answering machine, the old file stops playing and the new file starts playing.

To help explain the topology of this networked system, please refer to the diagram below.

mcu_layout.jpg


Generated on Sun Jan 29 19:48:56 2006 for Sofa Switch by  doxygen 1.4.4