[Sofaswitch-svn] [commit] r257 - in sofaswitch/trunk/callflow: bitmaps src
Author: derek Date: Wed May 16 01:00:31 2007 New Revision: 257 Added: sofaswitch/trunk/callflow/src/acceptcall.cpp sofaswitch/trunk/callflow/src/acceptcall.h Modified: sofaswitch/trunk/callflow/bitmaps/acceptcall.xpm sofaswitch/trunk/callflow/src/Makefile.am sofaswitch/trunk/callflow/src/Makefile.in sofaswitch/trunk/callflow/src/callflow.cpp sofaswitch/trunk/callflow/src/callflow.h sofaswitch/trunk/callflow/src/callstartstop.cpp sofaswitch/trunk/callflow/src/dnd.cpp sofaswitch/trunk/callflow/src/dnd.h sofaswitch/trunk/callflow/src/drawshape.h sofaswitch/trunk/callflow/src/makecall.cpp Log: Add code to indicate acceptance of an incoming voip/tdm call. Modified: sofaswitch/trunk/callflow/bitmaps/acceptcall.xpm ============================================================================== --- sofaswitch/trunk/callflow/bitmaps/acceptcall.xpm (original) +++ sofaswitch/trunk/callflow/bitmaps/acceptcall.xpm Wed May 16 01:00:31 2007 @@ -1,5 +1,5 @@ /* XPM */ -static char *acceptcall[]={ +static char *acceptcall_xpm[]={ "32 32 6 1", "d c None", ". c None", Modified: sofaswitch/trunk/callflow/src/Makefile.am ============================================================================== --- sofaswitch/trunk/callflow/src/Makefile.am (original) +++ sofaswitch/trunk/callflow/src/Makefile.am Wed May 16 01:00:31 2007 @@ -2,108 +2,35 @@ bin_PROGRAMS = callflow - callflow_LDADD = $(WX_LIBS) -override CXXFLAGS = @CXXFLAGS@ -I.. +override CXXFLAGS = @CXXFLAGS@ -I.. -I../bitmaps -callflow_SOURCES = \ - ../bitmaps/ContEnd.xpm \ - ../bitmaps/ContEndFor.xpm \ - ../bitmaps/ContFor.xpm \ - ../bitmaps/ContStart.xpm \ - ../bitmaps/ControlsEndHere.xpm \ - ../bitmaps/ControlsIf.xpm \ - ../bitmaps/Controlsend.xpm \ - ../bitmaps/Controlsend_for.xpm \ - ../bitmaps/Controlsfor.xpm \ - ../bitmaps/Controlsstart.xpm \ - ../bitmaps/EditCopy.xpm \ - ../bitmaps/EditCut.xpm \ - ../bitmaps/EditPaste.xpm \ - ../bitmaps/FileE_xit.xpm \ - ../bitmaps/FileNew.xpm \ - ../bitmaps/FileOpen.xpm \ - ../bitmaps/FileSave.xpm \ - ../bitmaps/FileSave__As.xpm \ - ../bitmaps/HelpAbout.xpm \ - ../bitmaps/HelpManual.xpm \ - ../bitmaps/JoinObjects.xpm \ - ../bitmaps/Python.xpm \ - ../bitmaps/RequestNode.xpm \ - ../bitmaps/compile.xpm \ - ../bitmaps/death.xpm \ - ../bitmaps/endcall.xpm \ - ../bitmaps/eventer.xpm \ - ../bitmaps/makecall.xpm \ - ../bitmaps/miniclock.xpm \ - ../bitmaps/newgraph.xpm \ - ../bitmaps/newshape.xpm \ - ../bitmaps/senddtmf.xpm \ - ../bitmaps/stoptimer.xpm \ - ../bitmaps/readfromfile.xpm \ - ../bitmaps/sendmessage.xpm \ - ../bitmaps/writetofile.xpm \ - ../bitmaps/transfermedia.xpm \ - callflow.cpp \ - callflow.h \ - callstartstop.h \ - callstartstop.cpp \ - canvas.cpp \ - canvas.h \ - conditional.cpp \ - conditional.h \ - death.cpp \ - death.h \ - dnd.cpp \ - dnd.h \ - drawshape.cpp \ - drawshape.h \ - endcall.cpp \ - endcall.h \ - endfor.cpp \ - endfor.h \ - endhere.cpp \ - endhere.h \ - eventer.cpp \ - eventer.h \ - fileio.cpp \ - fileio.h \ - information.cpp \ - information.h \ - joinblocks.cpp \ - joinblocks.h \ - listpoints.cpp \ - listpoints.h \ - loadnewgraph.cpp \ - loadnewgraph.h \ - makecall.cpp \ - makecall.h \ - python.cpp \ - python.h \ - readfromfile.cpp \ - readfromfile.h \ - requestnode.cpp \ - requestnode.h \ - senddtmf.cpp \ - senddtmf.h \ - sendmessage.cpp \ - sendmessage.h \ - shapelist.cpp \ - shapelist.h \ - shapeselect.cpp \ - shapeselect.h \ - startfor.cpp \ - startfor.h \ - starthere.cpp \ - starthere.h \ - stoptimer.cpp \ - stoptimer.h \ - timer.cpp \ - timer.h \ - transfermedia.cpp \ - transfermedia.h \ - writetofile.cpp \ - writetofile.h +callflow_SOURCES = ../bitmaps/ContEnd.xpm ../bitmaps/ContEndFor.xpm \ +../bitmaps/ContFor.xpm ../bitmaps/ContStart.xpm ../bitmaps/ControlsEndHere.xpm \ +../bitmaps/ControlsIf.xpm ../bitmaps/Controlsend.xpm \ +../bitmaps/Controlsend_for.xpm ../bitmaps/Controlsfor.xpm \ +../bitmaps/Controlsstart.xpm ../bitmaps/EditCopy.xpm ../bitmaps/EditCut.xpm \ +../bitmaps/EditPaste.xpm ../bitmaps/FileE_xit.xpm ../bitmaps/FileNew.xpm \ +../bitmaps/FileOpen.xpm ../bitmaps/FileSave.xpm ../bitmaps/FileSave__As.xpm \ +../bitmaps/HelpAbout.xpm ../bitmaps/HelpManual.xpm ../bitmaps/JoinObjects.xpm \ +../bitmaps/MasterNode.xpm ../bitmaps/Python.xpm ../bitmaps/RequestNode.xpm \ +../bitmaps/acceptcall.xpm ../bitmaps/compile.xpm ../bitmaps/death.xpm \ +../bitmaps/endcall.xpm ../bitmaps/eventer.xpm ../bitmaps/makecall.xpm \ +../bitmaps/miniclock.xpm ../bitmaps/newgraph.xpm ../bitmaps/newshape.xpm \ +../bitmaps/readfromfile.xpm ../bitmaps/senddtmf.xpm ../bitmaps/sendmessage.xpm \ +../bitmaps/stoptimer.xpm ../bitmaps/transfermedia.xpm ../bitmaps/writetofile.xpm \ +acceptcall.cpp acceptcall.h callflow.cpp callflow.h callstartstop.h \ +callstartstop.cpp canvas.cpp canvas.h conditional.cpp conditional.h death.cpp \ +death.h dnd.cpp dnd.h drawshape.cpp drawshape.h endcall.cpp endcall.h endfor.cpp \ +endfor.h endhere.cpp endhere.h eventer.cpp eventer.h fileio.cpp fileio.h \ +information.cpp information.h joinblocks.cpp joinblocks.h listpoints.cpp \ +listpoints.h loadnewgraph.cpp loadnewgraph.h makecall.cpp makecall.h \ +masternode.cpp masternode.h python.cpp python.h readfromfile.cpp readfromfile.h \ +requestnode.cpp requestnode.h senddtmf.cpp senddtmf.h sendmessage.cpp \ +sendmessage.h shapelist.cpp shapelist.h shapeselect.cpp shapeselect.h \ +startfor.cpp startfor.h starthere.cpp starthere.h stoptimer.cpp stoptimer.h \ +timer.cpp timer.h transfermedia.cpp transfermedia.h writetofile.cpp \ +writetofile.h Modified: sofaswitch/trunk/callflow/src/Makefile.in ============================================================================== --- sofaswitch/trunk/callflow/src/Makefile.in (original) +++ sofaswitch/trunk/callflow/src/Makefile.in Wed May 16 01:00:31 2007 @@ -48,12 +48,13 @@ am__installdirs = "$(DESTDIR)$(bindir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) -am_callflow_OBJECTS = callflow.$(OBJEXT) callstartstop.$(OBJEXT) \ - canvas.$(OBJEXT) conditional.$(OBJEXT) death.$(OBJEXT) \ - dnd.$(OBJEXT) drawshape.$(OBJEXT) endcall.$(OBJEXT) \ - endfor.$(OBJEXT) endhere.$(OBJEXT) eventer.$(OBJEXT) \ - fileio.$(OBJEXT) information.$(OBJEXT) joinblocks.$(OBJEXT) \ - listpoints.$(OBJEXT) loadnewgraph.$(OBJEXT) makecall.$(OBJEXT) \ +am_callflow_OBJECTS = acceptcall.$(OBJEXT) callflow.$(OBJEXT) \ + callstartstop.$(OBJEXT) canvas.$(OBJEXT) conditional.$(OBJEXT) \ + death.$(OBJEXT) dnd.$(OBJEXT) drawshape.$(OBJEXT) \ + endcall.$(OBJEXT) endfor.$(OBJEXT) endhere.$(OBJEXT) \ + eventer.$(OBJEXT) fileio.$(OBJEXT) information.$(OBJEXT) \ + joinblocks.$(OBJEXT) listpoints.$(OBJEXT) \ + loadnewgraph.$(OBJEXT) makecall.$(OBJEXT) masternode.$(OBJEXT) \ python.$(OBJEXT) readfromfile.$(OBJEXT) requestnode.$(OBJEXT) \ senddtmf.$(OBJEXT) sendmessage.$(OBJEXT) shapelist.$(OBJEXT) \ shapeselect.$(OBJEXT) startfor.$(OBJEXT) starthere.$(OBJEXT) \ @@ -186,104 +187,32 @@ target_alias = @target_alias@ SUFFIXES = .cpp .rc callflow_LDADD = $(WX_LIBS) -callflow_SOURCES = \ - ../bitmaps/ContEnd.xpm \ - ../bitmaps/ContEndFor.xpm \ - ../bitmaps/ContFor.xpm \ - ../bitmaps/ContStart.xpm \ - ../bitmaps/ControlsEndHere.xpm \ - ../bitmaps/ControlsIf.xpm \ - ../bitmaps/Controlsend.xpm \ - ../bitmaps/Controlsend_for.xpm \ - ../bitmaps/Controlsfor.xpm \ - ../bitmaps/Controlsstart.xpm \ - ../bitmaps/EditCopy.xpm \ - ../bitmaps/EditCut.xpm \ - ../bitmaps/EditPaste.xpm \ - ../bitmaps/FileE_xit.xpm \ - ../bitmaps/FileNew.xpm \ - ../bitmaps/FileOpen.xpm \ - ../bitmaps/FileSave.xpm \ - ../bitmaps/FileSave__As.xpm \ - ../bitmaps/HelpAbout.xpm \ - ../bitmaps/HelpManual.xpm \ - ../bitmaps/JoinObjects.xpm \ - ../bitmaps/Python.xpm \ - ../bitmaps/RequestNode.xpm \ - ../bitmaps/compile.xpm \ - ../bitmaps/death.xpm \ - ../bitmaps/endcall.xpm \ - ../bitmaps/eventer.xpm \ - ../bitmaps/makecall.xpm \ - ../bitmaps/miniclock.xpm \ - ../bitmaps/newgraph.xpm \ - ../bitmaps/newshape.xpm \ - ../bitmaps/senddtmf.xpm \ - ../bitmaps/stoptimer.xpm \ - ../bitmaps/readfromfile.xpm \ - ../bitmaps/sendmessage.xpm \ - ../bitmaps/writetofile.xpm \ - ../bitmaps/transfermedia.xpm \ - callflow.cpp \ - callflow.h \ - callstartstop.h \ - callstartstop.cpp \ - canvas.cpp \ - canvas.h \ - conditional.cpp \ - conditional.h \ - death.cpp \ - death.h \ - dnd.cpp \ - dnd.h \ - drawshape.cpp \ - drawshape.h \ - endcall.cpp \ - endcall.h \ - endfor.cpp \ - endfor.h \ - endhere.cpp \ - endhere.h \ - eventer.cpp \ - eventer.h \ - fileio.cpp \ - fileio.h \ - information.cpp \ - information.h \ - joinblocks.cpp \ - joinblocks.h \ - listpoints.cpp \ - listpoints.h \ - loadnewgraph.cpp \ - loadnewgraph.h \ - makecall.cpp \ - makecall.h \ - python.cpp \ - python.h \ - readfromfile.cpp \ - readfromfile.h \ - requestnode.cpp \ - requestnode.h \ - senddtmf.cpp \ - senddtmf.h \ - sendmessage.cpp \ - sendmessage.h \ - shapelist.cpp \ - shapelist.h \ - shapeselect.cpp \ - shapeselect.h \ - startfor.cpp \ - startfor.h \ - starthere.cpp \ - starthere.h \ - stoptimer.cpp \ - stoptimer.h \ - timer.cpp \ - timer.h \ - transfermedia.cpp \ - transfermedia.h \ - writetofile.cpp \ - writetofile.h +callflow_SOURCES = ../bitmaps/ContEnd.xpm ../bitmaps/ContEndFor.xpm \ +../bitmaps/ContFor.xpm ../bitmaps/ContStart.xpm ../bitmaps/ControlsEndHere.xpm \ +../bitmaps/ControlsIf.xpm ../bitmaps/Controlsend.xpm \ +../bitmaps/Controlsend_for.xpm ../bitmaps/Controlsfor.xpm \ +../bitmaps/Controlsstart.xpm ../bitmaps/EditCopy.xpm ../bitmaps/EditCut.xpm \ +../bitmaps/EditPaste.xpm ../bitmaps/FileE_xit.xpm ../bitmaps/FileNew.xpm \ +../bitmaps/FileOpen.xpm ../bitmaps/FileSave.xpm ../bitmaps/FileSave__As.xpm \ +../bitmaps/HelpAbout.xpm ../bitmaps/HelpManual.xpm ../bitmaps/JoinObjects.xpm \ +../bitmaps/MasterNode.xpm ../bitmaps/Python.xpm ../bitmaps/RequestNode.xpm \ +../bitmaps/acceptcall.xpm ../bitmaps/compile.xpm ../bitmaps/death.xpm \ +../bitmaps/endcall.xpm ../bitmaps/eventer.xpm ../bitmaps/makecall.xpm \ +../bitmaps/miniclock.xpm ../bitmaps/newgraph.xpm ../bitmaps/newshape.xpm \ +../bitmaps/readfromfile.xpm ../bitmaps/senddtmf.xpm ../bitmaps/sendmessage.xpm \ +../bitmaps/stoptimer.xpm ../bitmaps/transfermedia.xpm ../bitmaps/writetofile.xpm \ +acceptcall.cpp acceptcall.h callflow.cpp callflow.h callstartstop.h \ +callstartstop.cpp canvas.cpp canvas.h conditional.cpp conditional.h death.cpp \ +death.h dnd.cpp dnd.h drawshape.cpp drawshape.h endcall.cpp endcall.h endfor.cpp \ +endfor.h endhere.cpp endhere.h eventer.cpp eventer.h fileio.cpp fileio.h \ +information.cpp information.h joinblocks.cpp joinblocks.h listpoints.cpp \ +listpoints.h loadnewgraph.cpp loadnewgraph.h makecall.cpp makecall.h \ +masternode.cpp masternode.h python.cpp python.h readfromfile.cpp readfromfile.h \ +requestnode.cpp requestnode.h senddtmf.cpp senddtmf.h sendmessage.cpp \ +sendmessage.h shapelist.cpp shapelist.h shapeselect.cpp shapeselect.h \ +startfor.cpp startfor.h starthere.cpp starthere.h stoptimer.cpp stoptimer.h \ +timer.cpp timer.h transfermedia.cpp transfermedia.h writetofile.cpp \ +writetofile.h all: all-am @@ -356,6 +285,7 @@ distclean-compile: -rm -f *.tab.c +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/acceptcall.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/callflow.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/callstartstop.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/canvas.Po@am__quote@ @@ -373,6 +303,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/listpoints.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/loadnewgraph.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/makecall.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/masternode.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/python.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readfromfile.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/requestnode.Po@am__quote@ @@ -586,7 +517,7 @@ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-info-am -override CXXFLAGS = @CXXFLAGS@ -I.. +override CXXFLAGS = @CXXFLAGS@ -I.. -I../bitmaps # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: Added: sofaswitch/trunk/callflow/src/acceptcall.cpp ============================================================================== --- (empty file) +++ sofaswitch/trunk/callflow/src/acceptcall.cpp Wed May 16 01:00:31 2007 @@ -0,0 +1,52 @@ +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ +#pragma hdrstop +#endif + + +#ifndef WX_PRECOMP +#include "wx/wx.h" +#endif +#include <wx/textfile.h> +#include <wx/tokenzr.h> +#include "shapelist.h" + + +#include "acceptcall.h" + + +///////////////////////////////////////////////////////////////////////////// +DndShapeAcceptCall::DndShapeAcceptCall() + : DndShapeCallStartStop(AcceptCall) +{ + displayData[0] = + InformationSection(wxT("Accept incoming voip call at node voip1"), wxT("\"yes\"")); + + displayData[1] = + InformationSection(wxT("SofaSwitch node to advise as to accepting the call"), wxT("\"voip1\"")); + + displayData[displayData.size()] = + InformationSection(wxT("Answer call yes or no (Python code)"), wxT("\"yes\"")); +} + + +void DndShapeAcceptCall::Draw(wxDC & dc) +{ + DndShapeCallStartStop::Draw(dc); + + wxPoint p1(m_rect.GetPosition()); + + wxFont f = wxFont(*wxSWISS_FONT); + f.SetPointSize(24); + dc.SetFont(f); + dc.SetPen(*wxGREEN_PEN); + dc.SetBrush(wxBrush(*wxGREEN, wxTRANSPARENT)); + + wxString text = wxString::Format("? ?"); + wxCoord w, h; + dc.GetTextExtent(text, &w, &h); + int xPos = m_rect.x + 25 - (w/2); + int yPos = m_rect.y + 20 - (h/2); + dc.DrawText(text, xPos, yPos); +} Added: sofaswitch/trunk/callflow/src/acceptcall.h ============================================================================== --- (empty file) +++ sofaswitch/trunk/callflow/src/acceptcall.h Wed May 16 01:00:31 2007 @@ -0,0 +1,25 @@ +#ifndef ACCEPT_CALL_H +#define ACCEPT_CALL_H + +#include "callstartstop.h" + +////////////////////////////////////////////////////////////////////////////////////////////// +/**Define a create a call shape. Store values for size, location, input & output points. + This instance has the ability to draw this shape to a specified location on the canvas */ +class DndShapeAcceptCall : public DndShapeCallStartStop +{ +public: + /**Construtor, Define this shape in terms of size and points etc */ + DndShapeAcceptCall(); + + /**Draw the additional things to indicate we are making a call. Thus, we + add graphics to the base image provided by CallStartStop::Draw(wxDC & + dc) */ + void Draw(wxDC & dc); + + /** Used to report the name of this particular class. */ + static wxString GetKindName() { return wxString("Accept Call"); } +}; + + +#endif // ACCEPT_CALL_H Modified: sofaswitch/trunk/callflow/src/callflow.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/callflow.cpp (original) +++ sofaswitch/trunk/callflow/src/callflow.cpp Wed May 16 01:00:31 2007 @@ -38,19 +38,21 @@ #include "bitmaps/JoinObjects.xpm" #include "bitmaps/Python.xpm" #include "bitmaps/RequestNode.xpm" +#include "bitmaps/acceptcall.xpm" #include "bitmaps/compile.xpm" #include "bitmaps/death.xpm" #include "bitmaps/endcall.xpm" #include "bitmaps/eventer.xpm" #include "bitmaps/makecall.xpm" +#include "bitmaps/masternode.xpm" #include "bitmaps/miniclock.xpm" #include "bitmaps/newgraph.xpm" #include "bitmaps/readfromfile.xpm" #include "bitmaps/senddtmf.xpm" +#include "bitmaps/sendmessage.xpm" #include "bitmaps/stoptimer.xpm" #include "bitmaps/transfermedia.xpm" #include "bitmaps/writetofile.xpm" -#include "bitmaps/sendmessage.xpm" class MyFrame ; @@ -81,9 +83,11 @@ EVT_MENU ( wxH_CONTROLSFOR, MyFrame::OnControlsfor) EVT_MENU ( wxH_CONTROLSIF, MyFrame::OnControlsif) EVT_MENU ( wxH_CONTROLSLOADNEWGRAPH, MyFrame::OnControlsLoadNewGraph) + EVT_MENU ( wxH_CONTROLSACCEPTCALL, MyFrame::OnControlsAcceptCall) EVT_MENU ( wxH_CONTROLSMAKECALL, MyFrame::OnControlsMakeCall) EVT_MENU ( wxH_CONTROLSPYTHON, MyFrame::OnControlspython) EVT_MENU ( wxH_CONTROLSSENDMESSAGE, MyFrame::OnControlsSendMessage) + EVT_MENU ( wxH_CONTROLSMASTERNODE, MyFrame::OnControlsMasterNode) EVT_MENU ( wxH_CONTROLSREQUESTNODE, MyFrame::OnControlsrequestnode) EVT_MENU ( wxH_CONTROLSSENDDTMF, MyFrame::OnControlsSendDtmf) EVT_MENU ( wxH_CONTROLSSTARTHERE, MyFrame::OnControlsstarthere) @@ -157,9 +161,11 @@ Controls_menu -> Append ( wxH_CONTROLSFOR, wxT("for"), wxT("")); Controls_menu -> Append ( wxH_CONTROLSIF, wxT("if"), wxT("")); Controls_menu -> Append ( wxH_CONTROLSLOADNEWGRAPH, wxT("load pre-existing compiled graph"), wxT("")); + Controls_menu -> Append ( wxH_CONTROLSACCEPTCALL, wxT("accept incoming voip/tdm call"), wxT("")); Controls_menu -> Append ( wxH_CONTROLSMAKECALL, wxT("make a call"), wxT("")); Controls_menu -> Append ( wxH_CONTROLSPYTHON, wxT("python"), wxT("")); Controls_menu -> Append ( wxH_CONTROLSSENDMESSAGE, wxT("send sofa message"), wxT("")); + Controls_menu -> Append ( wxH_CONTROLSMASTERNODE, wxT("read events from remote node"), wxT("")); Controls_menu -> Append ( wxH_CONTROLSREADFROMFILE, wxT("read audio from file"), wxT("")); Controls_menu -> Append ( wxH_CONTROLSREQUESTNODE, wxT("request node"), wxT("")); Controls_menu -> Append ( wxH_CONTROLSSENDDTMF, wxT("send dtmf"), wxT("")); @@ -334,11 +340,13 @@ toolBar->AddTool(wxH_CONTROLSTIMER, wxBitmap ( miniclock_xpm ), wxT("Start a timer")); toolBar->AddTool(wxH_CONTROLSSTOPTIMER, wxBitmap ( stoptimer ), wxT("Stop specified timer")); toolBar->AddTool(wxH_CONTROLSEVENTER, wxBitmap ( eventer_xpm ), wxT("Register for & Wait for an event")); + toolBar->AddTool(wxH_CONTROLSACCEPTCALL, wxBitmap (acceptcall_xpm), wxT("Accept incoming voip/TDM call from an outside entity")); toolBar->AddTool(wxH_CONTROLSMAKECALL, wxBitmap (makecall), wxT("Make a voip/TDM call to outside entity")); toolBar->AddTool(wxH_CONTROLSFOR, wxBitmap ( Controlsfor_xpm ), wxT("Start a for loop")); toolBar->AddTool(wxH_CONTROLSEND_FOR, wxBitmap ( Controlsend_for_xpm ), wxT("end a for loop")); toolBar->AddTool(wxH_CONTROLSPYTHON, wxBitmap ( Python_xpm ), wxT("arbitrary python code")); toolBar->AddTool(wxH_CONTROLSSENDMESSAGE, wxBitmap ( sendmessage_xpm ), wxT("send arbitrary sofa message")); + toolBar->AddTool(wxH_CONTROLSMASTERNODE, wxBitmap ( masternode_xpm ), wxT("collect events from remote sofa node")); toolBar->AddTool(wxH_CONTROLSCONNECT_OBJECTS, wxBitmap ( JoinObjects ), wxT("Join objects with multi segmented lines")); toolBar->AddTool(wxH_CONTROLSWRITETOFILE, wxBitmap ( writetofile ), wxT("send audio to file")); @@ -436,6 +444,12 @@ canvas->SetEditingMode(MyCanvas::PlaceOneShape); } +void MyFrame::OnControlsMasterNode (wxCommandEvent & WXUNUSED(event)) +{ + imageTypeForPlacing = DndShape::MasterNode; + canvas->SetEditingMode(MyCanvas::PlaceOneShape); +} + void MyFrame::OnControlsDeath (wxCommandEvent & WXUNUSED(event)) { imageTypeForPlacing = DndShape::Death; @@ -464,14 +478,20 @@ { imageTypeForPlacing = DndShape::LoadNewGraph; canvas->SetEditingMode(MyCanvas::PlaceOneShape); - } + void MyFrame::OnControlsMakeCall (wxCommandEvent & WXUNUSED(event)) { imageTypeForPlacing = DndShape::MakeCall, canvas->SetEditingMode(MyCanvas::PlaceOneShape); } +void MyFrame::OnControlsAcceptCall (wxCommandEvent & WXUNUSED(event)) +{ + imageTypeForPlacing = DndShape::AcceptCall, + canvas->SetEditingMode(MyCanvas::PlaceOneShape); +} + void MyFrame::OnHelpManual (wxCommandEvent & WXUNUSED(event)) { Modified: sofaswitch/trunk/callflow/src/callflow.h ============================================================================== --- sofaswitch/trunk/callflow/src/callflow.h (original) +++ sofaswitch/trunk/callflow/src/callflow.h Wed May 16 01:00:31 2007 @@ -21,7 +21,9 @@ wxH_CONTROLSFOR, wxH_CONTROLSIF, wxH_CONTROLSLOADNEWGRAPH, + wxH_CONTROLSACCEPTCALL, wxH_CONTROLSMAKECALL, + wxH_CONTROLSMASTERNODE, wxH_CONTROLSPYTHON, wxH_CONTROLSREADFROMFILE, wxH_CONTROLSREQUESTNODE, @@ -151,6 +153,15 @@ python code for processing. One such use is print statements.*/ void OnControlspython (wxCommandEvent & event); + /**Called in response to a user comand to add a "Master Node" widget to + the current graph. This widget allows the user to advise a remote sofa + entity that this instance of the controller is the one to send all + events/questions to. Thus, on issueing this command a voip node (voip3 + say), when voip3 terminates, it will advise this controller. On sending + this command to "voip", on receiving an incoming call, this controller + will be told of the incoming call. */ + void OnControlsMasterNode (wxCommandEvent & event); + /**Called in response to a user comand to add a "SendMessage" widget to the current graph. This widget allows the user to send a sofa message to any other sofa entity */ @@ -184,6 +195,11 @@ the building */ void OnControlsMakeCall(wxCommandEvent & event); + /**Called in response to a decision as to if we accept/reject an incoming + call. We use this entity to send a message to the remote sofa node that + the incoming TDM/voip call is accepted or rejected */ + void OnControlsAcceptCall(wxCommandEvent & event); + /**Called in response to a user comand to add a "Draw Line Segment" widget to the current graph. The multiple line segment object is used to join two widgets on the screen */ Modified: sofaswitch/trunk/callflow/src/callstartstop.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/callstartstop.cpp (original) +++ sofaswitch/trunk/callflow/src/callstartstop.cpp Wed May 16 01:00:31 2007 @@ -26,13 +26,20 @@ relInputPoints.Add(25, 0); relOutputPoints.Add(25, 50); - if (kindToMake == MakeCall) - displayData[displayData.size()] = - InformationSection(wxT("Worker node to activate (python code)"), wxT("\"voip1\"")); - else - displayData[displayData.size()] = - InformationSection(wxT("Worker node for termination (python code)"), wxT("\"voip1\"")); - + switch(kindToMake) { + case AcceptCall: + displayData[displayData.size()] = + InformationSection(wxT("Worker node to inform on call status (python code)"), wxT("\"voip1\"")); + break; + case EndCall: + displayData[displayData.size()] = + InformationSection(wxT("Worker node for termination (python code)"), wxT("\"voip1\"")); + break; + case MakeCall: + displayData[displayData.size()] = + InformationSection(wxT("Worker node to activate (python code)"), wxT("\"voip1\"")); + break; + } AdjustIoPoints(); } @@ -54,11 +61,26 @@ file.AddLine(" print \"The destination string \", self.data[a][\"call destination\"], \" could not be evaluated as a python string\" "); file.AddLine(" self.dest = None "); } - - if (kind == MakeCall) - file.AddLine(" self.rhost += \":CALLNODE \" + self.dest + \"\\0\" "); - else - file.AddLine(" self.rhost += \":HANGUP \\0\" "); + if (kind == AcceptCall) { + file.AddLine(" try: "); + file.AddLine(" self.option = eval(self.data[a][\"answer option\"]) "); + file.AddLine(" except: "); + file.AddLine(" print \"The answer call option string \", self.data[a][\"answer option\"], \" could not be evaluated as a python string\" "); + file.AddLine(" self.option = \"No\" "); + } + + switch(kind) + { + case MakeCall: + file.AddLine(" self.rhost += \":CALLNODE \" + self.dest + \"\\0\" "); + break; + case EndCall: + file.AddLine(" self.rhost += \":HANGUP \\0\" "); + break; + case AcceptCall: + file.AddLine(" self.rhost += \":Answer \" + self.option + \"\\0\" "); + break; + } file.AddLine(" self.transport.write(self.rhost) "); file.AddLine(" return self.data[a][\"Output\"] "); file.AddLine(" "); @@ -80,10 +102,17 @@ wxString dest = ProtectString(displayData[1].data); file.AddLine(wxString::Format(" \"%s\", ", dest.c_str())); - if (kind == MakeCall) { - file.AddLine(wxString::Format(" \"call destination\" : ")); - dest = ProtectString(displayData[2].data); - file.AddLine(wxString::Format(" \"%s\", ", dest.c_str())); + switch(kind) { + case AcceptCall: + file.AddLine(wxString::Format(" \"answer option\" : ")); + dest = ProtectString(displayData[2].data); + file.AddLine(wxString::Format(" \"%s\", ", dest.c_str())); + break; + case MakeCall: + file.AddLine(wxString::Format(" \"call destination\" : ")); + dest = ProtectString(displayData[2].data); + file.AddLine(wxString::Format(" \"%s\", ", dest.c_str())); + break; } file.AddLine(wxString::Format(" },")); Modified: sofaswitch/trunk/callflow/src/dnd.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/dnd.cpp (original) +++ sofaswitch/trunk/callflow/src/dnd.cpp Wed May 16 01:00:31 2007 @@ -450,6 +450,12 @@ if (thisKind == SendMessage) return DndShapeSendMessage::GetKindName(); + if (thisKind == MasterNode) + return DndShapeMasterNode::GetKindName(); + + if (thisKind == AcceptCall) + return DndShapeAcceptCall::GetKindName(); + wxString answer = wxString::Format("node kind is %d", thisKind); return answer; } @@ -534,6 +540,7 @@ case None: printf("Construct a shape of null\n"); return NULL; + case AcceptCall: return new DndShapeAcceptCall(); case Conditional: return new DndShapeConditional(); case Death: return new DndShapeDeath(); case EndCall: return new DndShapeEndCall(); @@ -543,18 +550,19 @@ case JoinBlocks: return new DndShapeJoinBlocks(); case LoadNewGraph: return new DndShapeLoadNewGraph(); case MakeCall: return new DndShapeMakeCall(); + case MasterNode: return new DndShapeMasterNode(); case Python: return new DndShapePython(); case ReadFromFile: return new DndShapeReadFromFile(); case RequestNode: return new DndShapeRequestNode(); case Select: return new DndShapeSelect(); case SendDtmf: return new DndShapeSendDtmf(); + case SendMessage: return new DndShapeSendMessage(); case StartFor: return new DndShapeStartFor(); case StartHere: return new DndShapeStartHere(); case StopTimer: return new DndShapeStopTimer(); case Timer: return new DndShapeTimer(); case TransferMedia: return new DndShapeTransferMedia(); case WriteToFile: return new DndShapeWriteToFile(); - case SendMessage: return new DndShapeSendMessage(); default: printf("Unknown construction of shape %d\n", shapeRequired); } Modified: sofaswitch/trunk/callflow/src/dnd.h ============================================================================== --- sofaswitch/trunk/callflow/src/dnd.h (original) +++ sofaswitch/trunk/callflow/src/dnd.h Wed May 16 01:00:31 2007 @@ -283,7 +283,9 @@ SendDtmf = 19, /*!< Send a dtmf symbol to some sofaswitch worker node */ Death = 20, /*!< End all processing of this call flow now */ SendMessage = 21, /*!< Send some message to some remote sofa entity */ - KnownShapes = 22, /*!< Indicates the number of known shapes we can manage */ + MasterNode = 22, /*!< Identify this controller as the one to receive event etc messages */ + AcceptCall = 23, /*!< Advise remote sofa node if this TDM/voip call is accepted or not */ + KnownShapes = 24 /*!< Indicates the number of known shapes we can manage */ }; /**Constructor to a predefined shape */ Modified: sofaswitch/trunk/callflow/src/drawshape.h ============================================================================== --- sofaswitch/trunk/callflow/src/drawshape.h (original) +++ sofaswitch/trunk/callflow/src/drawshape.h Wed May 16 01:00:31 2007 @@ -1,6 +1,7 @@ #ifndef _drawshape_h #define _drawshape_h +#include "acceptcall.h" #include "conditional.h" #include "death.h" #include "endcall.h" @@ -10,6 +11,7 @@ #include "joinblocks.h" #include "loadnewgraph.h" #include "makecall.h" +#include "masternode.h" #include "python.h" #include "readfromfile.h" #include "requestnode.h" Modified: sofaswitch/trunk/callflow/src/makecall.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/makecall.cpp (original) +++ sofaswitch/trunk/callflow/src/makecall.cpp Wed May 16 01:00:31 2007 @@ -20,7 +20,6 @@ DndShapeMakeCall::DndShapeMakeCall() : DndShapeCallStartStop(MakeCall) { - displayData[displayData.size()] = InformationSection(wxT("Call destination (Python code)"), wxT("\"h323:h323.voxgratia.org\"")); }
participants (1)
-
SofaSWITCH SVN