[Sofaswitch-svn] [commit] r258 - in sofaswitch/trunk/callflow: bitmaps src tests
Author: derek Date: Thu May 17 19:45:54 2007 New Revision: 258 Modified: sofaswitch/trunk/callflow/bitmaps/AcceptCall.png sofaswitch/trunk/callflow/bitmaps/acceptcall.xpm sofaswitch/trunk/callflow/src/acceptcall.cpp sofaswitch/trunk/callflow/src/callflow.cpp sofaswitch/trunk/callflow/src/callflow.h sofaswitch/trunk/callflow/src/callstartstop.cpp sofaswitch/trunk/callflow/src/shapelist.cpp sofaswitch/trunk/callflow/tests/makevoipcall.src sofaswitch/trunk/callflow/tests/recordincomingvoip.src Log: tidyups for callflow utility. Get widgets to work correctly. Add option handling to generated python script, with help options. Add multiple toolbars to main window, which displays all options nicely. MakeVoipCall diagram now responds to voip node termination, and uses command line option in making a call. Modified: sofaswitch/trunk/callflow/bitmaps/AcceptCall.png ============================================================================== Binary files. No diff available. Modified: sofaswitch/trunk/callflow/bitmaps/acceptcall.xpm ============================================================================== --- sofaswitch/trunk/callflow/bitmaps/acceptcall.xpm (original) +++ sofaswitch/trunk/callflow/bitmaps/acceptcall.xpm Thu May 17 19:45:54 2007 @@ -1,12 +1,12 @@ /* XPM */ static char *acceptcall_xpm[]={ "32 32 6 1", -"d c None", ". c None", "# c #000000", -"b c #00c0c0", +"d c #00c0c0", "c c #00ff00", "a c #585858", +"b c #ffff00", "................................", "................###.............", "..............##a.a##...........", @@ -14,28 +14,28 @@ "..........##a..a.a..aa.##.......", ".......###.a.aa.a.a.a.a..##.....", ".....##..a..a..####..a.aa.a##...", -"...##.aaa.a.###....##a.a.aa.a##.", -"###.aa.a####bb.......##a.a.aaa.#", -".###.###bbbb.........bb##.a.a..#", -"....#bbbb.............bbb##..a#.", -"...bbb.#cccc.aaaa..accccccb###..", -"..bbb.ccca#ccc##a..cc#a..ccbb...", -".....cc##a#..c#a#..#aaa...cbb...", -".....c.##a#..cc##..###a...c.....", -".......##a#..ccaa..aaaa..cc.....", -"............cc...........c......", -"...........cc..........ccc......", -".......a##cc.aaaa..a#ccc........", -".......cccc..a###..a#cc.........", -".......cca#..aaaa..aacc.........", -".......ccaa..###a..a#cc.........", -".......cca#..aaaa..aacc.........", -".......cc............ccd........", -".......cc............ccd........", -".......ccaa..aaaa..aaccd........", -".......cc#a..a##a..a#cc.........", -".......cca#..aaaa..aacc.........", -".....ddddddddddddddddddd........", -"......dddddddddddddddddd........", -".......cc............cc.........", -".......cc............cc........."}; +"...##.abbba.###....##abb.aa.a##.", +"###.aabbcbb#dd......bbbbbb.aaa.#", +".###.bbcccbb......bbbccccba.a..#", +"....#bccccccb....bbccccccbb..a#.", +"...dbbcccbbcbbaaabcccbbbbcb###..", +"..dbbcccbabbccb#bbccbba.bcbdd...", +"...bcccb#a#bbcba#bbbbaa.bcbbd...", +"..bccbb##a#.bcb##..###abbccb....", +"..bccb.##a#bccbaa..aaaabccbb....", +"..bbb.....bcccb.......bbccb.....", +".........bcccb.......bbccbb.....", +"......bbbcccbaaaa..bbbcccb......", +"......bccccb.a###..bccccb.......", +"......bccccb.aaaa..bccccb.......", +"......bccccb.###a..bccccb.......", +"......bccccb.aaaa..bccccb.......", +"......bccccb.......bccccb.......", +"......bccccb.......bccccb.......", +"......bccccb.aaaa..bccccb.......", +"......bccccb.a##a..bccccb.......", +"......bccccb.aaaa..bccccb.......", +"......bbbbbb.......bbbbbb.......", +"......bccccb.......bccccb.......", +"......bccccb.......bccccb.......", +"......bbbbbb.......bbbbbb......."}; Modified: sofaswitch/trunk/callflow/src/acceptcall.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/acceptcall.cpp (original) +++ sofaswitch/trunk/callflow/src/acceptcall.cpp Thu May 17 19:45:54 2007 @@ -21,10 +21,10 @@ : DndShapeCallStartStop(AcceptCall) { displayData[0] = - InformationSection(wxT("Accept incoming voip call at node voip1"), wxT("\"yes\"")); + InformationSection(wxT("Tool tip"), wxT("\"Accept incoming voip call at sofa node \"voip1\"")); displayData[1] = - InformationSection(wxT("SofaSwitch node to advise as to accepting the call"), wxT("\"voip1\"")); + InformationSection(wxT("SofaSwitch node to advise as to accepting the call (Python code)"), wxT("\"voip1\"")); displayData[displayData.size()] = InformationSection(wxT("Answer call yes or no (Python code)"), wxT("\"yes\"")); Modified: sofaswitch/trunk/callflow/src/callflow.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/callflow.cpp (original) +++ sofaswitch/trunk/callflow/src/callflow.cpp Thu May 17 19:45:54 2007 @@ -73,6 +73,7 @@ #include "callflow.h" BEGIN_EVENT_TABLE(MyFrame, wxFrame) + EVT_SIZE(MyFrame::OnSize) EVT_MENU ( wxH_CONTROLSCOMPILE, MyFrame::OnCompile) EVT_MENU ( wxH_CONTROLSCONNECT_OBJECTS, MyFrame::OnControlsConnectObjects) EVT_MENU ( wxH_CONTROLSDEATH, MyFrame::OnControlsDeath) @@ -142,7 +143,7 @@ canvas = new MyCanvas(this); // menu setup goes here - + tbarVertical = NULL; wxMenu * Edit_menu = new wxMenu ; wxMenu * Help_menu = new wxMenu ; wxMenu * Controls_menu = new wxMenu ; @@ -188,8 +189,8 @@ menuBar->Append (Controls_menu, wxT("&Controls") ); menuBar->Append (Help_menu, wxT("Help") ); SetMenuBar (menuBar); - CreateToolBar(wxNO_BORDER | wxTB_FLAT | wxTB_HORIZONTAL); - InitToolBar(GetToolBar()); + + BuildToolBars(); CreateStatusBar(); SetStatusText(" Welcome to Call Flow. "); @@ -310,26 +311,8 @@ Close(); } - -void MyFrame::InitToolBar(wxToolBar* toolBar) +void MyFrame::InitToolBarOne(wxToolBar* toolBar) { - toolBar->SetToolSeparation(2); - toolBar->AddTool(wxH_FILENEW, wxBitmap ( FileNew_xpm ), wxT("Start over - create a new diagram")); - toolBar->AddTool(wxH_FILEOPEN, wxBitmap ( FileOpen_xpm ), wxT("open a file")); - toolBar->AddTool(wxH_FILESAVE, wxBitmap ( FileSave_xpm ), wxT("Save to the current file")); - toolBar->AddTool(wxH_FILESAVE__AS, wxBitmap ( FileSave_As_xpm ), wxT("Save to the file you specify")); - toolBar->AddTool(wxH_FILEE_XIT, wxBitmap ( FileE_xit_xpm ), wxT("End this program now")); - toolBar->AddTool(wxH_CONTROLSCOMPILE, wxBitmap ( compile_xpm ), wxT("Compile to code")); - - toolBar->AddSeparator() ; - - toolBar->AddTool(wxH_EDITCUT, wxBitmap ( EditCut_xpm ), wxT("")); - toolBar->AddTool(wxH_EDITPASTE, wxBitmap ( EditPaste_xpm ), - wxT("Copy current clipboard contents to screen")); - toolBar->AddTool(wxH_EDITCOPY, wxBitmap ( EditCopy_xpm ), wxT("Copy selected shape to clipboard ")); - - toolBar->AddSeparator() ; - toolBar->AddTool(wxH_CONTROLSDEATH, wxBitmap ( death ), wxT("End all processing in this flow chart")); toolBar->AddTool(wxH_CONTROLSENDCALL, wxBitmap ( endcall ), wxT("End a call (send hangup)")); toolBar->AddTool(wxH_CONTROLSSTARTHERE, wxBitmap ( Controlsstart ), wxT("Start processing")); @@ -353,12 +336,81 @@ toolBar->AddTool(wxH_CONTROLSREADFROMFILE, wxBitmap ( readfromfile ),wxT("read audio from file")); toolBar->AddTool(wxH_CONTROLSTRANSFERMEDIA, wxBitmap ( transfermedia ), wxT("transfer media between workers")); toolBar->AddTool(wxH_CONTROLSLOADNEWGRAPH, wxBitmap ( newgraph ), wxT("open existing graph file to handle new task")); + + toolBar->Realize(); +} + +void MyFrame::InitToolBarTwo(wxToolBar * toolBar) +{ + toolBar->SetToolPacking(0); + toolBar->SetMargins(0,0); + toolBar->SetToolSeparation(0); + toolBar->AddTool(wxH_FILENEW, wxBitmap ( FileNew_xpm ), wxT("Start over - create a new diagram")); + toolBar->AddTool(wxH_FILEOPEN, wxBitmap ( FileOpen_xpm ), wxT("open a file")); + toolBar->AddTool(wxH_FILESAVE, wxBitmap ( FileSave_xpm ), wxT("Save to the current file")); + toolBar->AddTool(wxH_FILESAVE__AS, wxBitmap ( FileSave_As_xpm ), wxT("Save to the file you specify")); + toolBar->AddTool(wxH_FILEE_XIT, wxBitmap ( FileE_xit_xpm ), wxT("End this program now")); + toolBar->AddTool(wxH_CONTROLSCOMPILE, wxBitmap ( compile_xpm ), wxT("Compile to code")); + + toolBar->AddSeparator() ; + + toolBar->AddTool(wxH_EDITCUT, wxBitmap ( EditCut_xpm ), wxT("")); + toolBar->AddTool(wxH_EDITPASTE, wxBitmap ( EditPaste_xpm ), + wxT("Copy current clipboard contents to screen")); + toolBar->AddTool(wxH_EDITCOPY, wxBitmap ( EditCopy_xpm ), wxT("Copy selected shape to clipboard ")); + + toolBar->AddSeparator() ; + toolBar->AddSeparator() ; toolBar->AddTool(wxH_HELPMANUAL, wxBitmap ( HelpManual_xpm ), wxT("help on using this program")); toolBar->AddTool(wxH_HELPABOUT, wxBitmap ( HelpAbout ), wxT("Author name etc")); + toolBar->Realize(); -} +} + +void MyFrame::BuildToolBars() +{ + long style = wxDEFAULT_FRAME_STYLE; + style |= wxTB_HORIZONTAL; + style &= ~wxTB_VERTICAL; + + wxToolBar *tbarOne = CreateToolBar(); + InitToolBarOne(tbarOne); + + + style = tbarOne->GetWindowStyle(); + style &= ~wxTB_HORIZONTAL; + style |= wxTB_VERTICAL; + tbarVertical = new wxToolBar(this, wxID_ANY, + wxDefaultPosition, wxDefaultSize, + style); + InitToolBarTwo(tbarVertical); + LayoutChildren(); +} + +void MyFrame::LayoutChildren() +{ + wxSize size = GetClientSize(); + + int offset; + if (tbarVertical != NULL) { + tbarVertical->SetSize(0, 0, wxDefaultCoord, size.y); + offset = tbarVertical->GetSize().x; + } else { + offset = 0; + } + + canvas->SetSize(offset, 0, size.x - offset, size.y); +} + +void MyFrame::OnSize(wxSizeEvent& event) +{ + if (tbarVertical != NULL) + LayoutChildren(); + else + event.Skip(); +} void MyFrame::OnControlsstarthere (wxCommandEvent & WXUNUSED(event)) Modified: sofaswitch/trunk/callflow/src/callflow.h ============================================================================== --- sofaswitch/trunk/callflow/src/callflow.h (original) +++ sofaswitch/trunk/callflow/src/callflow.h Thu May 17 19:45:54 2007 @@ -92,8 +92,16 @@ void OnFileE_xit (wxCommandEvent & event); /**Generic method to initialise the tool bar. This will add all our custom icons - to the tool bar.*/ - void InitToolBar(wxToolBar* toolBar); + to the first (horizontal) tool bar.*/ + void InitToolBarOne(wxToolBar* toolBar); + + /**Generic method to initialise the tool bar. This will add all our custom icons + to the second (vertical) tool bar.*/ + void InitToolBarTwo(wxToolBar* toolBar); + + /**Get the two tool bars (vertical and horizontal) build, filled with widgets, and + onto the page */ + void BuildToolBars(); /**Called in response to a user comand to add a "Start here" widget to the current graph */ @@ -227,6 +235,11 @@ /**Called in response to a user comand to copy the contents of the clipboard to the current graph */ void OnEditPaste (wxCommandEvent & event); + + /**Window has been resized. Adjust the vertical toolbar accordingly */ + void OnSize(wxSizeEvent& event); + + DECLARE_EVENT_TABLE() public: @@ -251,6 +264,10 @@ void CloseJoinBlocks(); protected: + + /**get the vertical toolbar to show correct size etc */ + void LayoutChildren(); + /**Write a new name to the top of the window - the current file has changed, and display the new name of the current file on the window */ void SetNewWindowName(wxString & newFileName); @@ -265,6 +282,9 @@ /**The canvas this window frame gets to write on */ MyCanvas * canvas ; + + /**Pointer to the vertical toolbar, on the left of the screen */ + wxToolBar *tbarVertical; }; #endif Modified: sofaswitch/trunk/callflow/src/callstartstop.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/callstartstop.cpp (original) +++ sofaswitch/trunk/callflow/src/callstartstop.cpp Thu May 17 19:45:54 2007 @@ -46,7 +46,19 @@ bool DndShapeCallStartStop::WriteSystemCode(wxTextFile & file) { - wxString header = wxString::Format(" def %s(self, sTuple):", (kind == MakeCall ? "Make_Call" : "End_Call")); + wxString label; + switch(kind) { + case MakeCall: + label = "Make_Call"; + break; + case EndCall: + label = "End_Call"; + break; + case AcceptCall: + label = "Accept_Call"; + break; + } + wxString header = wxString::Format(" def %s(self, sTuple):", (const char *)label); file.AddLine(header); file.AddLine(" a,b,c = sTuple "); file.AddLine(" try: "); Modified: sofaswitch/trunk/callflow/src/shapelist.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/shapelist.cpp (original) +++ sofaswitch/trunk/callflow/src/shapelist.cpp Thu May 17 19:45:54 2007 @@ -302,10 +302,21 @@ file.AddLine("import distutils "); file.AddLine("import re "); file.AddLine("from twisted.internet import reactor, protocol "); + file.AddLine("from optparse import OptionParser "); + file.AddLine(" "); + file.AddLine("usage = \"usage: %prog [-s|--server srv] [-o|--opts opt]\" "); + file.AddLine("parser = OptionParser(usage) "); + file.AddLine("parser.add_option(\"-s\", \"--server\", dest=\"sofaServer\","); + file.AddLine(" help=\"location of the sofa switch message server\", "); + file.AddLine(" default=\"localhost\") "); + file.AddLine("parser.add_option(\"-o\", \"--opts\", dest=\"scriptArgs\", "); + file.AddLine(" help=\"text passed to the running python code, as self.scriptArgs\","); + file.AddLine(" default=\"\") "); + file.AddLine("(options, args) = parser.parse_args() "); + file.AddLine(" "); + file.AddLine("sofaServer = options.sofaServer "); + file.AddLine("scriptArgs = options.scriptArgs "); 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"); @@ -338,6 +349,13 @@ file.AddLine(" \"\"\" "); file.AddLine(" self.isMaster = newIsMaster "); file.AddLine(" "); + file.AddLine(" def setScriptArgs(self, newScriptArgs): "); + file.AddLine(" \"\"\"Pass to the running python code the arguements that"); + file.AddLine(" were on the command line. This is a feature that enables"); + file.AddLine(" (for example) one command file to call different hosts."); + file.AddLine(" \"\"\" "); + file.AddLine(" self.scriptArgs = newScriptArgs "); + file.AddLine(" "); file.AddLine(" def setUserData(self, newData): "); file.AddLine(" \"\"\"transfer data process, which is required when we "); file.AddLine(" create a child graph of a parent graph, when we have "); @@ -617,6 +635,7 @@ file.AddLine(" self.myController.setGraphData(self.myGraphName) "); file.AddLine(" self.myController.setMaster(self.isMaster) "); file.AddLine(" self.myController.setUserData(self.userData) "); + file.AddLine(" self.myController.setScriptArgs(self.scriptArgs) "); file.AddLine(" return p "); file.AddLine(" "); file.AddLine(" def setGraph(self, newName): "); @@ -628,9 +647,13 @@ file.AddLine(" def setUserData(self, newData): "); file.AddLine(" self.userData = newData "); file.AddLine(" "); + file.AddLine(" def setScriptArgs(self, newData): "); + file.AddLine(" self.scriptArgs = newData "); + file.AddLine(" "); file.AddLine(" "); file.AddLine("f = MyFactory() "); file.AddLine(wxString::Format("f.setGraph(\"%s\") ", graphFileName.c_str())); + file.AddLine(wxString::Format("f.setScriptArgs(scriptArgs)") ); file.AddLine("f.setMaster(True) "); file.AddLine("f.setUserData((None, None)) "); file.AddLine("reactor.connectTCP(sofaServer, 5000, f) "); Modified: sofaswitch/trunk/callflow/tests/makevoipcall.src ============================================================================== --- sofaswitch/trunk/callflow/tests/makevoipcall.src (original) +++ sofaswitch/trunk/callflow/tests/makevoipcall.src Thu May 17 19:45:54 2007 @@ -1 +1,3 @@ -15<B>190<B>450<B> extra <special>Tool Tip<ms>Transfer Media<ms><special>First SofaSwitch worker (python)<ms>self.voipNode<ms><special>Second SofaSwitch worker (python)<ms>self.soundNode<ms><special> <B><Shape>14<B>202<B>158<B> extra <special>Tool Tip<ms>Eventer<ms><special>Event sought (Python code)<ms><ms><special>Event sought (Regular Exp)<ms>voipREQ<ms><special>Python variable: source of the event<ms>self.eventSource<ms><special>Python variable: name of the event<ms>self.eventName<ms><special>Python variable: generated data<ms>self.voipNode<ms><special> <B><Shape>2<B>227<B>517<B> extra <special>Tool Tip<ms>End Processing<ms><special> <B><Shape>9<B>248<B>182<B>248,183,308,182<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>13<B>284<B>231<B> extra <special>Tool Tip<ms>Stop Timer<ms><special>Timer to stop<ms>requestsound<ms><special> <B><Shape>10<B>403<B>444<B> extra <special>Tool Tip<ms>Python<ms><special>Python Code<ms>print "End this as the voip or sound did not respond in time"<ms><special> <B><Shape>9<B>464<B>478<B>497,478,495,572,464,578<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>2<B>218<B>330<B> extra <special>Tool Tip<ms>End Processing<ms><special> <B><Shape>10<B>198<B>252<B> extra <special>Tool Tip<ms>Python<ms><special>Python Code<ms>print "Have a new voip node on ", self.voipNode<ms><special> <B><Shape>2<B>215<B>653<B> extra <special>Tool Tip<ms>End Processing<ms><special> <B><Shape>10<B>448<B>518<B> extra <special>Tool Tip<ms>Python<ms><special>Python Code<ms>print "hangup, as dtmf 9 has been received"<ms><special> <B><Shape>11<B>191<B>71<B> extra <special>Tool Tip<ms>Request Node<ms><special>Request node from (Python code)<ms>"voip"<ms><special>Timer period (seconds)<ms>1<ms><special>Timer label<ms>requestvoip<ms><special>Additional information (Python code)<ms><ms><special> <B><Shape>5<B>193<B>579<B> extra <special>Tool Tip<ms>Conditional<ms><special>Test (Python code)<ms>self.dtmfData=="9"<ms><special> <B><Shape>14<B>338<B>210<B> extra <special>Tool Tip<ms>Eventer<ms><special>Event sought (Python code)<ms><ms><special>Event sought (Regular Exp)<ms>hanguptime<ms><special>Python variable: source of the event<ms>self.eventSource<ms><special>Python variable: name of the event<ms>self.eventName<ms><special>Python variable: generated data<ms>self.hanguptime<ms><special> <B><Shape>14<B>412<B>261<B> extra <special>Tool Tip<ms>Did we rceive a sound node in time<ms><special>Event sought (Python code)<ms><ms><special>Event sought (Regular Exp)<ms>requestsound<ms><special>Python variable: source of the event<ms>self.eventSource<ms><special>Python variable: name of the event<ms>self.eventName<ms><special>Python variable: generated data<ms>self.requestSound<ms><special> <B><Shape>5<B>189<B>304<B> extra <special>Tool Tip<ms>Conditional<ms><special>Test (Python code)<ms>(self.voipNode != None) and (self.soundNode != None)<ms><special> <B><Shape>9<B>497<B>330<B>511,330,497,418<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>19<B>216<B>606<B> extra <special>Tool Tip<ms>Send Dtmf<ms><special>Worker node to activate (python code)<ms>self.voipNode<ms><special>DTMF to send to worker node (python code)<ms>self.dtmfData<ms><special> <B><Shape>9<B>418<B>359<B>421,359,418,448<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>1<B>190<B>19<B> extra <special>Tool Tip<ms>Start Processing<ms><special> <B><Shape>2<B>523<B>304<B> extra <special>Tool Tip<ms>End Processing<ms><special> <B><Shape>9<B>214<B>308<B>309,335,214,308<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>7<B>440<B>632<B> extra <special>Tool Tip<ms>End Call<ms><special>Worker node to activate (python code)<ms>self.voipNode<ms><special> <B><Shape>12<B>439<B>683<B> extra <special>Tool Tip<ms>Timer<ms><special>Timer period (seconds, Python code)<ms>1<ms><special>Timer label (Python code)<ms>"hanguptime"<ms><special> <B><Shape>9<B>458<B>279<B>458,279,511,279<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>14<B>501<B>279<B> extra <special>Tool Tip<ms>Eventer<ms><special>Event sought (Python code)<ms><ms><special>Event sought (Regular Exp)<ms>voip[0-9]*Terminat<ms><special>Python variable: source of the event<ms>self.eventSource<ms><special>Python variable: name of the event<ms>self.eventName<ms><special>Python variable: generated data<ms>self.eventData<ms><special> <B><Shape>11<B>191<B>109<B> extra <special>Tool Tip<ms>Request Node<ms><special>Request node from (Python code)<ms>"sound"<ms><special>Timer period (seconds)<ms>1<ms><special>Timer label<ms>requestsound<ms><special>Additional information (Python code)<ms><ms><special> <B><Shape>14<B>375<B>236<B> extra <special>Tool Tip<ms>A timer - did we receive a voip node before this timer fires<ms><special>Event sought (Python code)<ms><ms><special>Event sought (Regular Exp)<ms>requestvoip<ms><special>Python variable: source of the event<ms>self.eventSource<ms><special>Python variable: name of the event<ms>self.eventName<ms><special>Python variable: generated data<ms>self.requestVoip<ms><special> <B><Shape>9<B>218<B>518<B>218,628,463,518<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>9<B>214<B>353<B>214,353,216,402<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>2<B>425<B>333<B> extra <special>Tool Tip<ms>End Processing<ms><special> <B><Shape>9<B>506<B>388<B>506,388<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>6<B>189<B>402<B> extra <special>Tool Tip<ms>Make Call<ms><special>Worker node to activate (python code)<ms>self.voipNode<ms><special>Call destination (python code)<ms>"h323:h323.voxgratia.org"<ms><special> <B><Shape>15<B>439<B>579<B> extra <special>Tool Tip<ms>Transfer Media<ms><special>First SofaSwitch worker (python)<ms>"sound"<ms><special>Second SofaSwitch worker (python)<ms>"sound"<ms><special> <B><Shape>10<B>481<B>418<B> extra <special>Tool Tip<ms>Python<ms><special>Python Code<ms>print "the voip node has died ", self.eventData<ms><special> <B><Shape>14<B>204<B>491<B> extra <special>Tool Tip<ms>Eventer<ms><special>Event sought (Python code)<ms><ms><special>Event sought (Regular Exp)<ms>DTMF<ms><special>Python variable: source of the event<ms>self.eventSource<ms><special>Python variable: name of the event<ms>self.eventName<ms><special>Python variable: generated data<ms>self.dtmfData<ms><special> <B><Shape>9<B>419<B>504<B>419,504,420,570,464,578<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>10<B>293<B>279<B> extra <special>Tool Tip<ms>Python<ms><special>Python Code<ms>print " have a sound node of ", self.soundNode<ms><special> <B><Shape>5<B>397<B>310<B> extra <special>Tool Tip<ms>Conditional<ms><special>Test (Python code)<ms>(self.requestVoip==None) or(self.requestSound==None)<ms><special> <B><Shape>20<B>336<B>255<B> extra <special>Tool Tip<ms>Death<ms><special> <B><Shape>14<B>297<B>184<B> extra <special>Tool Tip<ms>Eventer<ms><special>Event sought (Python code)<ms><ms><special>Event sought (Regular Exp)<ms>soundREQ<ms><special>Python variable: source of the event<ms>self.eventSource<ms><special>Python variable: name of the event<ms>self.eventName<ms><special>Python variable: generated data<ms>self.soundNode<ms><special> <B><Shape>2<B>438<B>731<B> extra <special>Tool Tip<ms>End Processing<ms><special> <B><Shape>10<B>200<B>531<B> extra <special>Tool Tip<ms>Python<ms><special>Python Code<ms>print "dtmf received of ", self.dtmfData<ms><special> <B><Shape>9<B>216<B>573<B>216,573<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>9<B>386<B>284<B>386,284,386,313,424,314<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>13<B>189<B>210<B> extra <special>Tool Tip<ms>Stop Timer<ms><special>Timer to stop<ms>requestvoip<ms><special> <B><Shape> +2<B>203<B>769<B> extra <special>Tool Tip<ms>End Processing<ms><special> <B><Shape>15<B>423<B>395<B> extra <special>Tool Tip<ms>Make sound node +talk to itself<ms><special>First SofaSwitch worker (python)<ms>"sound"<ms><special>Second SofaSwitch worker (python)<ms>"sound"<ms><special> <B><Shape>22<B>71<B>65<B> extra <special>Tool Tip<ms>Register for events from voip node<ms><special>Node to receive events from (Python code)<ms>"voip"<ms><special> <B><Shape>2<B>420<B>527<B> extra <special>Tool Tip<ms>End Processing<ms><special> <B><Shape>14<B>77<B>242<B> extra <special>Tool Tip<ms>have a voip node from the voip module<ms><special>Event sought (Python code)<ms><ms><special>Event sought (Regular Exp)<ms>voipREQ<ms><special>Python variable: source of the event<ms>self.eventSource<ms><special>Python variable: name of the event<ms>self.eventName<ms><special>Python variable: generated data<ms>self.voipNode<ms><special> <B><Shape>22<B>71<B>108<B> extra <special>Tool Tip<ms>Register for events from am node<ms><special>Node to receive events from (Python code)<ms>"am"<ms><special> <B><Shape>9<B>130<B>262<B>130,263,190,262<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>20<B>287<B>343<B> extra <special>Tool Tip<ms>Death<ms><special> <B><Shape>9<B>166<B>439<B>166,439,212,440<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>9<B>140<B>391<B>140,655,149,713,369,710,376,391,448,395<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>2<B>591<B>357<B> extra <special>Tool Tip<ms>End Processing<ms><special> <B><Shape>11<B>63<B>152<B> extra <special>Tool Tip<ms>Request voip node<ms><special>Request node from (Python code)<ms>"voip"<ms><special>Timer period (seconds)<ms>1<ms><special>Timer label<ms>requestvoip<ms><special>Additional information (Python code)<ms><ms><special> <B><Shape>9<B>140<B>655<B>140,655,149,717<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>5<B>115<B>605<B> extra <special>Tool Tip<ms>Test for dtmf data of "9"<ms><special>Test (Python code)<ms>self.dtmfData=="9"<ms><special> <B><Shape>2<B>187<B>440<B> extra <special>Tool Tip<ms>End Processing<ms><special> <B><Shape>11<B>65<B>196<B> extra <special>Tool Tip<ms>Request sound node<ms><special>Request node from (Python code)<ms>"sound"<ms><special>Timer period (seconds)<ms>1<ms><special>Timer label<ms>requestsound<ms><special>Additional information (Python code)<ms><ms><special> <B><Shape>9<B>141<B>411<B>190,411,141,414<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>7<B>422<B>440<B> extra <special>Tool Tip<ms>End Call<ms><special>Worker node to activate (python code)<ms>self.voipNode<ms><special> <B><Shape>19<B>201<B>724<B> extra <special>Tool Tip<ms>Send Dtmf<ms><special>Worker node to activate (python code)<ms>self.voipNode<ms><special>DTMF to send to worker node (python code)<ms>self.dtmfData<ms><special> <B><Shape>14<B>564<B>337<B> extra <special>Tool Tip<ms>Test timer on request of sound<ms><special>Event sought (Python code)<ms><ms><special>Event sought (Regular Exp)<ms>requestsound<ms><special>Python variable: source of the event<ms>self.eventSource<ms><special>Python variable: name of the event<ms>self.eventName<ms><special>Python variable: generated data<ms>self.eventData<ms><special> <B><Shape>9<B>448<B>363<B>540,363,448,395<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>10<B>74<B>325<B> extra <special>Tool Tip<ms>report we have a voip node<ms><special>Python Code<ms>print "Have a new voip node on ", self.voipNode<ms><special> <B><Shape>1<B>62<B>24<B> extra <special>Tool Tip<ms>Start Processing<ms><special> <B><Shape>9<B>178<B>584<B>178,584,223,585<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>9<B>223<B>382<B>223,635,355,637,359,382,448,395<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>9<B>165<B>630<B>165,630,221,678,226,724<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>9<B>448<B>387<B>577,387,448,395<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>9<B>90<B>385<B>90,385,141,414<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>14<B>175<B>264<B> extra <special>Tool Tip<ms>wait for arrival of sound node<ms><special>Event sought (Python code)<ms><ms><special>Event sought (Regular Exp)<ms>soundREQ<ms><special>Python variable: source of the event<ms>self.eventSource<ms><special>Python variable: name of the event<ms>self.eventName<ms><special>Python variable: generated data<ms>self.soundNode<ms><special> <B><Shape>10<B>174<B>351<B> extra <special>Tool Tip<ms>report we have a sound node<ms><special>Python Code<ms>print " have a sound node of ", self.soundNode<ms><special> <B><Shape>9<B>225<B>286<B>225,286,300,286<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>6<B>116<B>463<B> extra <special>Tool Tip<ms>Make Call to a remote entity<ms><special>Worker node to activate (python code)<ms>self.voipNode<ms><special>Call destination (python code)<ms>self.scriptArgs<ms><special> <B><Shape>2<B>238<B>608<B> extra <special>Tool Tip<ms>End Processing<ms><special> <B><Shape>15<B>116<B>514<B> extra <special>Tool Tip<ms>Transfer Media between the voip and sound node<ms><special>First SofaSwitch worker (python)<ms>self.voipNode<ms><special>Second SofaSwitch worker (python)<ms>self.soundNode<ms><special> <B><Shape>9<B>335<B>311<B>335,311,542,311<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>13<B>164<B>307<B> extra <special>Tool Tip<ms>Stop Timer on the request for a sound node<ms><special>Timer to stop<ms>requestsound<ms><special> <B><Shape>14<B>527<B>313<B> extra <special>Tool Tip<ms>test timer on request of voip<ms><special>Event sought (Python code)<ms><ms><special>Event sought (Regular Exp)<ms>requestvoip<ms><special>Python variable: source of the event<ms>self.eventSource<ms><special>Python variable: name of the event<ms>self.eventName<ms><special>Python variable: generated data<ms>self.eventData<ms><special> <B><Shape>13<B>65<B>286<B> extra <special>Tool Tip<ms>Stop Timer on the voip request<ms><special>Timer to stop<ms>requestvoip<ms><special> <B><Shape>14<B>210<B>585<B> extra <special>Tool Tip<ms>Wait for voip call to end<ms><special>Event sought (Python code)<ms><ms><special>Event sought (Regular Exp)<ms>Terminating<ms><special>Python variable: source of the event<ms>self.eventSource<ms><special>Python variable: name of the event<ms>self.eventName<ms><special>Python variable: generated data<ms>self.eventData<ms><special> <B><Shape>12<B>421<B>483<B> extra <special>Tool Tip<ms>Timer which initates a shutdown, after some tidyup + messages etc have been sent.<ms><special>Timer period (seconds, Python code)<ms>1<ms><special>Timer label (Python code)<ms>"endeverything"<ms><special> <B><Shape>5<B>116<B>414<B> extra <special>Tool Tip<ms>TEST: have a sound and voip node.<ms><special>Test (Python code)<ms>(self.voipNode != None) and (self.soundNode != None)<ms><special> <B><Shape>14<B>285<B>289<B> extra <special>Tool Tip<ms>Eventer<ms><special>Event sought (Python code)<ms><ms><special>Event sought (Regular Exp)<ms>endeverything<ms><special>Python variable: source of the event<ms>self.eventSource<ms><special>Python variable: name of the event<ms>self.eventName<ms><special>Python variable: generated data<ms>self.eventData<ms><special> <B><Shape>14<B>128<B>562<B> extra <special>Tool Tip<ms>Wait for DTMF data<ms><special>Event sought (Python code)<ms><ms><special>Event sought (Regular Exp)<ms>DTMF<ms><special>Python variable: source of the event<ms>self.eventSource<ms><special>Python variable: name of the event<ms>self.eventName<ms><special>Python variable: generated data<ms>self.dtmfData<ms><special> <B><Shape> Modified: sofaswitch/trunk/callflow/tests/recordincomingvoip.src ============================================================================== --- sofaswitch/trunk/callflow/tests/recordincomingvoip.src (original) +++ sofaswitch/trunk/callflow/tests/recordincomingvoip.src Thu May 17 19:45:54 2007 @@ -1,2 +1,3 @@ -7<B>625<B>356<B> extra <special>Tool Tip<ms>End AM node<ms><special>Worker node for termination (python code)<ms>self.amNode<ms><special> <B><Shape>14<B>716<B>313<B> extra <special>Tool Tip<ms>Eventer<ms><special>Event sought (Python code)<ms><ms><special>Event sought (Regular Exp)<ms>hanguptime<ms><special>Python variable: source of the event<ms>self.eventSource<ms><special>Python variable: name of the event<ms>self.eventName<ms><special>Python variable: generated data<ms>self.hanguptime<ms><special> <B><Shape>11<B>239<B>200<B> extra <special>Tool Tip<ms>Request Node from AM module<ms><special>Request node from (Python code)<ms>"am"<ms><special>Timer period (seconds)<ms>1<ms><special>Timer label<ms>requestam<ms><special>Additional information (Python code)<ms><ms><special> <B><Shape>10<B>248<B>301<B> extra <special>Tool Tip<ms>Report - have an am node<ms><special>Python Code<ms>print " have a am node of ", self.amNode<ms><special> <B><Shape>14<B>252<B>93<B> extra <special>Tool Tip<ms>Wait for an incoming voip call<ms><special>Event sought (Python code)<ms><ms><special>Event sought (Regular Exp)<ms>QueryAccept<ms><special>Python variable: source of the event<ms>self.voipNode<ms><special>Python variable: name of the event<ms>self.eventName<ms><special>Python variable: generated data<ms>self.voipData<ms><special> <B><Shape>7<B>625<B>311<B> extra <special>Tool Tip<ms>End voip node<ms><special>Worker node for termination (python code)<ms>self.voipNode<ms><special> <B><Shape>14<B>252<B>252<B> extra <special>Tool Tip<ms>DETECT the AM node to -connect to the incoming call.<ms><special>Event sought (Python code)<ms><ms><special>Event sought (Regular Exp)<ms>amREQ<ms><special>Python variable: source of the event<ms>self.amMasterNode<ms><special>Python variable: name of the event<ms>self.eventName<ms><special>Python variable: generated data<ms>self.amNode<ms><special> <B><Shape>10<B>248<B>141<B> extra <special>Tool Tip<ms>report: incoming voip call<ms><special>Python Code<ms>print "have received an incoming voip call from ",self.voipNode<ms><special> <B><Shape>9<B>302<B>113<B>302,464,496,466,499,113,644,126<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>2<B>278<B>117<B> extra <special>Tool Tip<ms>End Processing<ms><special> <B><Shape>14<B>252<B>442<B> extra <special>Tool Tip<ms>Eventer<ms><special>Event sought (Python code)<ms><ms><special>Event sought (Regular Exp)<ms>Terminating<ms><special>Python variable: source of the event<ms>self.eventSource<ms><special>Python variable: name of the event<ms>self.eventName<ms><special>Python variable: generated data<ms>self.eventData<ms><special> <B><Shape>9<B>650<B>363<B>650,406,729,363<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>2<B>328<B>282<B> extra <special>Tool Tip<ms>End Processing<ms><special> <B><Shape>9<B>264<B>307<B>264,489,567,497,549,307,646,313<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>21<B>249<B>357<B> extra <special>Tool Tip<ms>accept incoming call.<ms><special>Message to send (Python code)<ms>self.voipNode + ":answer yes"<ms><special> <B><Shape>9<B>166<B>93<B>166,134,265,93<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>2<B>744<B>332<B> extra <special>Tool Tip<ms>End Processing<ms><special> <B><Shape>1<B>141<B>41<B> extra <special>Tool Tip<ms>Start Processing<ms><special> <B><Shape>21<B>249<B>401<B> extra <special>Tool Tip<ms>Send Message<ms><special>Message to send (Python code)<ms>self.voipNode + ":reporttome"<ms><special> <B><Shape>9<B>684<B>288<B>684,288,729,313<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>14<B>634<B>266<B> extra <special>Tool Tip<ms>Wait for hangup of the voip call<ms><special>Event sought (Python code)<ms><ms><special>Event sought (Regular Exp)<ms>hangup<ms><special>Python variable: source of the event<ms>self.eventSource<ms><special>Python variable: name of the event<ms>self.eventName<ms><special>Python variable: generated data<ms>self.hangupdata<ms><special> <B><Shape>17<B>621<B>217<B> extra <special>Tool Tip<ms>Write To File<ms><special>Filename to contain new audio (Python code)<ms>"message.wav"<ms><special>answering machine node<ms>self.amNode<ms><special> <B><Shape>9<B>302<B>274<B>302,274,355,286,355,286<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>20<B>718<B>420<B> extra <special>Tool Tip<ms>Death<ms><special> <B><Shape>21<B>150<B>94<B> extra <special>Tool Tip<ms>Send Message<ms><special>Message to send (Python code)<ms>"voip:reporttome"<ms><special> <B><Shape>16<B>618<B>170<B> extra <special>Tool Tip<ms>Play the instructions<ms><special>Filename to read audio from (Python code)<ms>"../prompts/record.wav"<ms><special>answering machine node (Python code)<ms>self.amNode<ms><special> <B><Shape>15<B>619<B>126<B> extra <special>Tool Tip<ms>Transfer Media<ms><special>First SofaSwitch worker (python)<ms>self.amNode<ms><special>Second SofaSwitch worker (python)<ms>self.voipNode<ms><special> <B><Shape>10<B>713<B>361<B> extra <special>Tool Tip<ms>Python<ms><special>Python Code<ms>print "DEATH NOW."<ms><special> <B><Shape> +22<B>150<B>94<B> extra <special>Tool Tip<ms>Register for events from voip<ms><special>Node to receive events from (Python code)<ms>"voip"<ms><special> <B><Shape>9<B>684<B>288<B>684,288,729,313<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>9<B>302<B>274<B>302,274,355,286,355,286<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>14<B>634<B>266<B> extra <special>Tool Tip<ms>Wait for hangup of the voip call<ms><special>Event sought (Python code)<ms><ms><special>Event sought (Regular Exp)<ms>hangup<ms><special>Python variable: source of the event<ms>self.eventSource<ms><special>Python variable: name of the event<ms>self.eventName<ms><special>Python variable: generated data<ms>self.hangupdata<ms><special> <B><Shape>22<B>246<B>398<B> extra <special>Tool Tip<ms>Register for events from voip node +that has just answered the call<ms><special>Node to receive events from (Python code)<ms>self.voipNode<ms><special> <B><Shape>15<B>619<B>126<B> extra <special>Tool Tip<ms>Transfer Media<ms><special>First SofaSwitch worker (python)<ms>self.amNode<ms><special>Second SofaSwitch worker (python)<ms>self.voipNode<ms><special> <B><Shape>7<B>241<B>488<B> extra <special>Tool Tip<ms>End voip node<ms><special>Worker node for termination (python code)<ms>self.voipNode<ms><special> <B><Shape>2<B>278<B>117<B> extra <special>Tool Tip<ms>End Processing<ms><special> <B><Shape>14<B>252<B>252<B> extra <special>Tool Tip<ms>DETECT the AM node to +connect to the incoming call.<ms><special>Event sought (Python code)<ms><ms><special>Event sought (Regular Exp)<ms>amREQ<ms><special>Python variable: source of the event<ms>self.amMasterNode<ms><special>Python variable: name of the event<ms>self.eventName<ms><special>Python variable: generated data<ms>self.amNode<ms><special> <B><Shape>14<B>252<B>442<B> extra <special>Tool Tip<ms>A node (voip or am) has died<ms><special>Event sought (Python code)<ms><ms><special>Event sought (Regular Exp)<ms>Terminating<ms><special>Python variable: source of the event<ms>self.eventSource<ms><special>Python variable: name of the event<ms>self.eventName<ms><special>Python variable: generated data<ms>self.eventData<ms><special> <B><Shape>2<B>328<B>282<B> extra <special>Tool Tip<ms>End Processing<ms><special> <B><Shape>9<B>266<B>375<B>647,375,605,527,266,488<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>10<B>250<B>586<B> extra <special>Tool Tip<ms>Python<ms><special>Python Code<ms>print "DEATH NOW."<ms><special> <B><Shape>1<B>141<B>41<B> extra <special>Tool Tip<ms>Start Processing<ms><special> <B><Shape>9<B>302<B>113<B>302,464,496,466,499,113,644,126<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>2<B>702<B>313<B> extra <special>Tool Tip<ms>End Processing<ms><special> <B><Shape>9<B>166<B>93<B>166,134,265,93<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>10<B>631<B>315<B> extra <special>Tool Tip<ms>Python<ms><special>Python Code<ms>print "the voip call has ended with ", self.remotePerson<ms><special> <B><Shape>17<B>621<B>217<B> extra <special>Tool Tip<ms>Write To File<ms><special>Filename to contain new audio (Python code)<ms>"message.wav"<ms><special>answering machine node<ms>self.amNode<ms><special> <B><Shape>10<B>248<B>301<B> extra <special>Tool Tip<ms>Report - have an am node<ms><special>Python Code<ms>print " have a am node of ", self.amNode<ms><special> <B><Shape>14<B>252<B>93<B> extra <special>Tool Tip<ms>Wait for an incoming voip call<ms><special>Event sought (Python code)<ms><ms><special>Event sought (Regular Exp)<ms>QueryAccept<ms><special>Python variable: source of the event<ms>self.voipNode<ms><special>Python variable: name of the event<ms>self.eventName<ms><special>Python variable: generated data<ms>self.remotePerson<ms><special> <B><Shape>11<B>239<B>200<B> extra <special>Tool Tip<ms>Request Node from AM module<ms><special>Request node from (Python code)<ms>"am"<ms><special>Timer period (seconds)<ms>1<ms><special>Timer label<ms>requestam<ms><special>Additional information (Python code)<ms><ms><special> <B><Shape>10<B>248<B>141<B> extra <special>Tool Tip<ms>report: incoming voip call<ms><special>Python Code<ms>print "have received an incoming voip call from ",self.remotePerson<ms><special> <B><Shape>16<B>618<B>170<B> extra <special>Tool Tip<ms>Play the instructions<ms><special>Filename to read audio from (Python code)<ms>"../prompts/record.wav"<ms><special>answering machine node (Python code)<ms>self.amNode<ms><special> <B><Shape>7<B>240<B>537<B> extra <special>Tool Tip<ms>End AM node<ms><special>Worker node for termination (python code)<ms>self.amNode<ms><special> <B><Shape>20<B>251<B>637<B> extra <special>Tool Tip<ms>Death<ms><special> <B><Shape>23<B>237<B>354<B> extra <special>Tool tip<ms>Accept incoming voip call at sofa node<ms><special>SofaSwitch node to advise as to accepting the call (Python code)<ms>self.voipNode<ms><special>Answer call yes or no (Python code)<ms>"yes"<ms><special> <B><Shape>
participants (1)
-
SofaSWITCH SVN