[commit] r111 - in sofaswitch/trunk/callflow: . docs src
Author: derek Date: Thu Sep 21 22:53:18 2006 New Revision: 111 Added: sofaswitch/trunk/callflow/docs/ Modified: sofaswitch/trunk/callflow/overview.dxy sofaswitch/trunk/callflow/src/shapelist.cpp Log: Work on docs, and get network events processed right. Modified: sofaswitch/trunk/callflow/overview.dxy ============================================================================== --- sofaswitch/trunk/callflow/overview.dxy (original) +++ sofaswitch/trunk/callflow/overview.dxy Thu Sep 21 22:53:18 2006 @@ -45,6 +45,17 @@ Thus, the design of CallFlow was such that you can create scripts to do very complex things with the minimum of effort. +\section WhatDo What does CallFlow do ? +In this section, I describe, in overview, what CallFlow does + +\li Draw the diagram of the call handling for one call +\li Compile this to python, which creates two files. The first file + describes the graph, and the second file describes the handling of + the graph. The second file is "hardwired" to load that particular + graph file. However, the second file is is, essentially, the same between + every compile. +\li You use Python to execute the second file, which loads the graph file. + \subsection history History Modified: sofaswitch/trunk/callflow/src/shapelist.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/shapelist.cpp (original) +++ sofaswitch/trunk/callflow/src/shapelist.cpp Thu Sep 21 22:53:18 2006 @@ -288,6 +288,10 @@ file.AddLine("import re "); file.AddLine("from twisted.internet import reactor, protocol "); file.AddLine(" "); + file.AddLine("sofaServer = \"localhost\" "); + file.AddLine("if len(sys.argv) > 1: "); + file.AddLine(" sofaServer = sys.argv[1] "); + file.AddLine(" "); file.AddLine("class Controller(protocol.Protocol): "); file.AddLine(" \"\"\" The class which holds all the information on how to manage each entity"); file.AddLine(" on the flow chart, how to connect, and does the requisite calls to twisted "); @@ -302,7 +306,7 @@ file.AddLine(" self.currentHandlers= {} "); file.AddLine(" self.knownNetworkMessages= [] "); file.AddLine(" self.knownNetworkMessages.append(\"REQUESTNEWID\") "); - file.AddLine(" self.knownNetworkMessages.append(\"DTMF\") "); + file.AddLine(" self.knownNetworkMessages.append(\"RECEIVEDDTMF\") "); // file.AddLine(" self.knownNetworkMessages.append(\"\") "); char c= 34; wxString tString = wxString::Format(" self.quote = \"\\%c\"", c); @@ -463,6 +467,8 @@ file.AddLine(" initialise, and activate the next step of initialise. Or, it is an ordinary "); file.AddLine(" message that has to be processed "); file.AddLine(" \"\"\" "); + file.AddLine(" while data.find(\" \") >= 0: "); + file.AddLine(" data = data.replace(\" \", \" \") "); file.AddLine(" ssdata = str(data).split(\'\\0\') "); file.AddLine(" for oneMessage in ssdata: "); file.AddLine(" self.countReceived += 1 "); @@ -485,6 +491,7 @@ file.AddLine(" Note that this method can only deal with certain predefined "); file.AddLine(" types of messages "); file.AddLine(" \"\"\" "); + file.AddLine(" thisMessage = thisMessage.strip() "); file.AddLine(" if len(thisMessage) > 2: "); file.AddLine(" print \"Received \", thisMessage "); file.AddLine(" for msg in self.knownNetworkMessages: "); @@ -539,7 +546,7 @@ file.AddLine(" "); file.AddLine("f = MyFactory() "); file.AddLine("f.setGraph(\"a_graph\") "); - file.AddLine("reactor.connectTCP(\"localhost\", 5000, f) "); + file.AddLine("reactor.connectTCP(sofaServer, 5000, f) "); file.AddLine("reactor.run() "); file.AddLine(" "); file.Write();
participants (1)
-
SofaSWITCH SVN