From derek@sofaswitch.org Tue Jul 3 20:17:43 2007 From: SofaSWITCH SVN To: sofaswitch-svn@lists.freeswitch.org Subject: [Sofaswitch-svn] [commit] r342 - sofaswitch/trunk/get_started Date: Tue, 03 Jul 2007 20:17:43 -0400 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7657268151833767429==" --===============7657268151833767429== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Author: derek Date: Tue Jul 3 20:17:43 2007 New Revision: 342 Added: sofaswitch/trunk/get_started/answeringmachine.sgml Log: Add this file, which describes the use of the answering machine. Added: sofaswitch/trunk/get_started/answeringmachine.sgml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- (empty file) +++ sofaswitch/trunk/get_started/answeringmachine.sgml Tue Jul 3 20:17:43 20= 07 @@ -0,0 +1,165 @@ + +Answering machine utility +Audio play/record + + + + +The sound card (described in previous section) can be utilised in the &sofas= witch; environment, +and it can send/receive audio with any other &sofaswitch; audio +component. The Answering Machine is perhaps the simplest other +audio component, which can play/record audio from/to a wav file. + + + +Build and run the answering machine utility with the commands + +cd am +make both + + ./obj_linux_x86_r/am -s machine_running_server=20 + + +The options to the answering machine utility specify the name of the machine= running the +sofa message server. you will need to adjust the options to correctly specify +the name of the machine running the message server. Thus, if the message ser= ver +and the answering machine are on the same computer, you will use the string +localhost. +You can see all the available command +options by running the answering machine utility with the command parameter = -h + + + +For the test script to work, we expect that am 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. Run this +utility with: + +python testsound.py machine_running_server + +Again, you will need to modify this command line to correctly specify the +location of the machine running the server. + + + +The server reports the following messages. + +controller : am:REQUESTNEWID + am : controller:REQUESTNEWID am1 +controller : am1:transferudp sound + am1 : controller:OutgoingCall am1 + am1 : sound:transferudp sound 10.0.0.5:64000 + sound : am1:transferudp sound 10.0.0.5:61000 done +controller : am1:setannouncementfile sample_message.wav +controller : am1:setreceivedmsgfile derek.wav +controller : am1:hangup + am1 : controller:Terminating + +The messages are in four groups. + + The controller requests an answering machine entity to send= /receive audio from. + The answering machine supervisor sends a message back to the controlle= r, advising + the controller of the new identity. + + The controller tells the new identy (am1= ) to connect audio streams with the sound + identity. Notice that the controller is not aware of the address used = to transfer audio. + + The controller tells the answering machine identity to play= audio from the file + sample_message.wav, and record to the file derek.wav. + +Advisement notices (call setup, call terminating) + + + +As before, this simple test can be extended by running the client.p= y python script file described above. +You can enquire of the answering machine for status information (command am:status full) and you +will see what is available. The answerine machine will reply back + +am:status full +am:Current Status:----------- +Comms instance count 61 50 11 +Consumer instance count 50 50 0 +pre, active & dead calls 0 1 0 + + Current active nodes: + am51 + +These figures are designed to provide some diagnostic information about what= is going on. +There main purpose is tell you the counts of constructed/allocated class ins= tances, and therefore +provide some guide as to if the system is leaking memory. + + + +There are 11 Comms instances currently availble. One is used in an active ca= ll (am51), and the +remaining 10 have connected to the message server. These remaining 10 are th= erefore ready for +immediate use, should they be requested by the controller. + + + +The Consumer instance count is a class that is very short lived, and designed +to clean up calls after the call has terminated.. In this case, 50 have been +constructed, 50 deleted, and balance is zero. If there are several available +Consumer instances, we have evidence that the calls are not being cleaned up. +Each Consumer instance is a separate thread, created to clean up one call. A +call is cleaned up independently (well, as much as possible) from all other= calls. + + + +From running the client.py script, while the tes= tsound.py script is running, we +can interrogate the message server to see what is happening. We send the com= mand status full, +which looks like: + +status full + Status of the Server +------------------------- +Constructed/Deleted TcpConnections 98 72 26 +Count ready made TcpConnections 10 +Messages Sent Received Dropped Diff 1274 972 108 194 +Current list size 15 + + current nodes + controller + sound + am + am51 + am52 + am53 + am54 + am55 + am56 + am57 + am58 + am59 + am60 + am61 + test + + + + +The server has reported that there are 26 available TcpConnection +class instances. One TcpConnection instance is used for e= ach connected +node to the server. The figure of 26 above is correct. + + 15 are used for the 15 entries in the list + 10 are stored away, ready for use in connecting nodes + 1 is on hand, ready to use immediately with the next incoming +connection. + + + + +The list contains 15 nodes, which is correct. Controller = is there, who +is running the testsound.py script file. Further, sound is there, who is +managing the sound card, and is an endpoint for the test. The supervisor +am for the answering machine is there. Also, tes= t is there, +which is the identity of the node from the client.py &pyt= hon; script. +am51 is there, who is the current active answering machin= e node. +Nodes am52..am61 are the nodes that the answering machine +supervisor has prebuilt, which are ready for use. + + \ No newline at end of file --===============7657268151833767429==--