[Sofaswitch-svn] [commit] r390 - in sofaswitch/trunk: callflow/src callflow/tests overview sofa/src voip
Author: derek Date: Mon Aug 6 00:21:14 2007 New Revision: 390 Modified: sofaswitch/trunk/callflow/src/python.cpp sofaswitch/trunk/callflow/tests/makevoipcall.src sofaswitch/trunk/callflow/tests/mirrorvoip.src sofaswitch/trunk/overview/chap2.sgml sofaswitch/trunk/sofa/src/messages.cxx sofaswitch/trunk/voip/jocall.h sofaswitch/trunk/voip/mymanager.cxx sofaswitch/trunk/voip/mymanager.h sofaswitch/trunk/voip/udpconnection.cxx sofaswitch/trunk/voip/udpconnection.h sofaswitch/trunk/voip/udpep.cxx sofaswitch/trunk/voip/udpep.h Log: Tidy ups. Work on making udp channel/ep consistant with opal. Tidy up python icon look. fix typos in docs. Modified: sofaswitch/trunk/callflow/src/python.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/python.cpp (original) +++ sofaswitch/trunk/callflow/src/python.cpp Mon Aug 6 00:21:14 2007 @@ -39,17 +39,17 @@ dc.SetPen(*wxBLACK_PEN); wxPoint p1(m_rect.GetPosition()); - wxPoint pA(p1.x + 16, p1.y + 12); + wxPoint pA(p1.x + 16, p1.y + 13); wxPoint pB(p1.x + 16, p1.y + 0); wxPoint pC(p1.x + 16, p1.y + 60); - wxPoint pD(p1.x + 16, p1.y + 46); + wxPoint pD(p1.x + 16, p1.y + 43); DrawArrow(dc, pB, ArrowDown, InputPointConnected(0) ? Connected : Loose); DrawArrow(dc, pC, ArrowDown, OutputPointConnected(0) ? Connected : Loose); dc.DrawLine(pA, pB); dc.DrawLine(pD, pC); - dc.DrawBitmap(Python_xpm, p1.x, p1.y + 16, true); + dc.DrawBitmap(Python_xpm, p1.x, p1.y + 13, true); DndShape::Draw(dc); } Modified: sofaswitch/trunk/callflow/tests/makevoipcall.src ============================================================================== --- sofaswitch/trunk/callflow/tests/makevoipcall.src (original) +++ sofaswitch/trunk/callflow/tests/makevoipcall.src Mon Aug 6 00:21:14 2007 @@ -1,3 +1,3 @@ -9<B>271<B>711<B>271,711,316,711<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>22<B>97<B>52<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>9<B>165<B>522<B>165,522,165,598,251,601<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>9<B>248<B>502<B>248,502,251,601<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>9<B>206<B>141<B>206,141,272,141<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>1<B>88<B>9<B> extra <special>Tool Tip<ms>Start Processing<ms><special> <B><Shape>7<B>225<B>646<B> extra <special>Tool Tip<ms>End Call<ms><special>Worker node to activate (python code)<ms>self.voipNode<ms><special> <B><Shape>20<B>229<B>740<B> extra <special>Tool Tip<ms>Death<ms><special> <B><Shape>20<B>336<B>305<B> extra <special>Tool Tip<ms>Death<ms><special> <B><Shape>2<B>244<B>139<B> extra <special>Tool Tip<ms>Suspend Processing<ms><special> <B><Shape>2<B>169<B>538<B> extra <special>Tool Tip<ms>Suspend Processing<ms><special> <B><Shape>14<B>153<B>429<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>2<B>211<B>306<B> extra <special>Tool Tip<ms>Suspend Processing<ms><special> <B><Shape>9<B>166<B>479<B>166,479<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>9<B>203<B>451<B>203,451,248,452<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>19<B>168<B>499<B> extra <special>Tool Tip<ms>Send Dtmf to the voip node<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>7<B>95<B>148<B> extra <special>Tool Tip<ms>End Call<ms><special>Worker node for termination (Python code)<ms>self.soundNode<ms><special> <B><Shape>9<B>166<B>171<B>166,171,166,281<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>2<B>291<B>710<B> extra <special>Tool Tip<ms>Suspend Processing<ms><special> <B><Shape>5<B>140<B>472<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>14<B>235<B>452<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>6<B>141<B>330<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>11<B>89<B>96<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>Info to send to remote node (Python code)<ms><ms><special>Python variable: generated data<ms>self.voipNode<ms><special> <B><Shape>9<B>139<B>116<B>139,116,181,121<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>9<B>120<B>198<B>120,198,120,253,359,253<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>9<B>99<B>146<B>99,146,101,269,166,281<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>2<B>258<B>468<B> extra <special>Tool Tip<ms>Suspend Processing<ms><special> <B><Shape>5<B>141<B>281<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>7<B>163<B>164<B> extra <special>Tool Tip<ms>End Call<ms><special>Worker node for termination (Python code)<ms>self.voipNode<ms><special> <B><Shape>12<B>334<B>253<B> extra <special>Tool Tip<ms>Timer<ms><special>Timer period (seconds, Python code)<ms>0.2<ms><special>Timer label (Python code)<ms>"expire timer"<ms><special> <B><Shape>12<B>224<B>689<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>15<B>141<B>381<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>15<B>226<B>601<B> extra <special>Tool Tip<ms>Make sound node -talk to noone<ms><special>First SofaSwitch worker (python)<ms>"sound"<ms><special>Second SofaSwitch worker (python)<ms>"noone"<ms><special> <B><Shape>9<B>188<B>214<B>188,214,188,251,359,252<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>11<B>156<B>121<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>Info to send to remote node (Python code)<ms><ms><special>Python variable: generated data<ms>self.soundNode<ms><special> <B><Shape>9<B>191<B>306<B>191,306,237,307<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>2<B>360<B>272<B> extra <special>Tool Tip<ms>Suspend Processing<ms><special> <B><Shape> +11<B>156<B>121<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>Info to send to remote node (Python code)<ms><ms><special>Python variable: generated data<ms>self.soundNode<ms><special> <B><Shape>19<B>168<B>499<B> extra <special>Tool Tip<ms>Send Dtmf to the voip node<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>5<B>141<B>281<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>9<B>166<B>171<B>166,171,166,281<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>2<B>291<B>710<B> extra <special>Tool Tip<ms>Suspend Processing<ms><special> <B><Shape>9<B>120<B>198<B>120,198,120,253,359,253<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>9<B>166<B>479<B>166,479<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>9<B>165<B>522<B>165,522,165,598,251,601<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>9<B>188<B>214<B>188,214,188,251,359,252<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>9<B>139<B>116<B>139,116,181,121<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>7<B>225<B>646<B> extra <special>Tool Tip<ms>End Call<ms><special>Worker node to activate (python code)<ms>self.voipNode<ms><special> <B><Shape>9<B>191<B>306<B>191,306,237,307<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>15<B>226<B>601<B> extra <special>Tool Tip<ms>Make sound node +talk to noone<ms><special>First SofaSwitch worker (python)<ms>"sound"<ms><special>Second SofaSwitch worker (python)<ms>"noone"<ms><special> <B><Shape>7<B>95<B>148<B> extra <special>Tool Tip<ms>End Call<ms><special>Worker node for termination (Python code)<ms>self.soundNode<ms><special> <B><Shape>9<B>271<B>711<B>271,711,316,711<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>6<B>141<B>330<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>14<B>235<B>452<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>9<B>248<B>502<B>248,502,251,601<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>2<B>360<B>272<B> extra <special>Tool Tip<ms>Suspend Processing<ms><special> <B><Shape>9<B>206<B>141<B>206,141,272,141<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>5<B>140<B>472<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>11<B>89<B>96<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>Info to send to remote node (Python code)<ms><ms><special>Python variable: generated data<ms>self.voipNode<ms><special> <B><Shape>12<B>224<B>689<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>15<B>141<B>381<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>2<B>211<B>306<B> extra <special>Tool Tip<ms>Suspend Processing<ms><special> <B><Shape>12<B>334<B>253<B> extra <special>Tool Tip<ms>Timer<ms><special>Timer period (seconds, Python code)<ms>0.2<ms><special>Timer label (Python code)<ms>"expire timer"<ms><special> <B><Shape>14<B>153<B>429<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>20<B>229<B>740<B> extra <special>Tool Tip<ms>Death<ms><special> <B><Shape>2<B>169<B>538<B> extra <special>Tool Tip<ms>Suspend Processing<ms><special> <B><Shape>1<B>89<B>43<B> extra <special>Tool Tip<ms>Start Processing<ms><special> <B><Shape>2<B>258<B>468<B> extra <special>Tool Tip<ms>Suspend Processing<ms><special> <B><Shape>9<B>99<B>146<B>99,146,101,269,166,281<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>7<B>163<B>164<B> extra <special>Tool Tip<ms>End Call<ms><special>Worker node for termination (Python code)<ms>self.voipNode<ms><special> <B><Shape>2<B>244<B>139<B> extra <special>Tool Tip<ms>Suspend Processing<ms><special> <B><Shape>9<B>203<B>451<B>203,451,248,452<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>20<B>336<B>305<B> extra <special>Tool Tip<ms>Death<ms><special> <B><Shape> Modified: sofaswitch/trunk/callflow/tests/mirrorvoip.src ============================================================================== --- sofaswitch/trunk/callflow/tests/mirrorvoip.src (original) +++ sofaswitch/trunk/callflow/tests/mirrorvoip.src Mon Aug 6 00:21:14 2007 @@ -1 +1 @@ -9<B>311<B>507<B>358,507,311,526<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>2<B>288<B>572<B> extra <special>Tool Tip<ms>Suspend Processing<ms><special> <B><Shape>22<B>268<B>100<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>14<B>347<B>405<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>319<B>402<B>319,402,363,402<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>22<B>265<B>291<B> extra <special>Tool Tip<ms>Register for events from voip2<ms><special>Node to receive events from (Python code)<ms>self.voipNode<ms><special> <B><Shape>1<B>259<B>58<B> extra <special>Tool Tip<ms>Start Processing<ms><special> <B><Shape>10<B>295<B>523<B> extra <special>Tool Tip<ms>Python<ms><special>Python Code<ms>print " "<ms><special> <B><Shape>14<B>269<B>380<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>10<B>267<B>192<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>2<B>375<B>425<B> extra <special>Tool Tip<ms>Suspend Processing<ms><special> <B><Shape>9<B>283<B>483<B>283,483,311,526<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>10<B>342<B>447<B> extra <special>Tool Tip<ms>Python<ms><special>Python Code<ms>print "Terminating-- the voip call has ended with ", self.remotePerson<ms><special> <B><Shape>23<B>257<B>247<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>14<B>271<B>144<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>2<B>297<B>162<B> extra <special>Tool Tip<ms>Suspend Processing<ms><special> <B><Shape>15<B>257<B>333<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.voipNode<ms><special> <B><Shape>10<B>267<B>423<B> extra <special>Tool Tip<ms>Python<ms><special>Python Code<ms>print "HANGUP the voip call has ended with ", self.remotePerson<ms><special> <B><Shape> +2<B>375<B>425<B> extra <special>Tool Tip<ms>Suspend Processing<ms><special> <B><Shape>1<B>259<B>58<B> extra <special>Tool Tip<ms>Start Processing<ms><special> <B><Shape>14<B>271<B>144<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>10<B>295<B>523<B> extra <special>Tool Tip<ms>Python<ms><special>Python Code<ms>print " "<ms><special> <B><Shape>9<B>319<B>402<B>319,402,363,402<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>14<B>269<B>380<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>265<B>291<B> extra <special>Tool Tip<ms>Register for events from the node who is calling us.<ms><special>Node to receive events from (Python code)<ms>self.voipNode<ms><special> <B><Shape>10<B>267<B>192<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>15<B>257<B>333<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.voipNode<ms><special> <B><Shape>10<B>267<B>423<B> extra <special>Tool Tip<ms>Python<ms><special>Python Code<ms>print "HANGUP the voip call has ended with ", self.remotePerson<ms><special> <B><Shape>9<B>311<B>507<B>358,507,311,526<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>9<B>283<B>483<B>283,483,311,526<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>23<B>257<B>247<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>22<B>268<B>100<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>2<B>288<B>572<B> extra <special>Tool Tip<ms>Suspend Processing<ms><special> <B><Shape>14<B>347<B>405<B> extra <special>Tool Tip<ms>Wait for voip node to terminate<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>297<B>162<B> extra <special>Tool Tip<ms>Suspend Processing<ms><special> <B><Shape>10<B>342<B>447<B> extra <special>Tool Tip<ms>Python<ms><special>Python Code<ms>print "Terminating-- the voip call has ended with ", self.remotePerson<ms><special> <B><Shape> Modified: sofaswitch/trunk/overview/chap2.sgml ============================================================================== --- sofaswitch/trunk/overview/chap2.sgml (original) +++ sofaswitch/trunk/overview/chap2.sgml Mon Aug 6 00:21:14 2007 @@ -87,7 +87,7 @@ </para></entry></row> <row><entry><para>Controller</para></entry> <entry><para> -is responsible for generating control mesasges to +is responsible for generating control messaes to get things to happen. It is this entity who initiates responses from the &sofaswitch; system as real world events happen. There may be multiple active Controllers - this is a Modified: sofaswitch/trunk/sofa/src/messages.cxx ============================================================================== --- sofaswitch/trunk/sofa/src/messages.cxx (original) +++ sofaswitch/trunk/sofa/src/messages.cxx Mon Aug 6 00:21:14 2007 @@ -682,7 +682,8 @@ void MessageFrame::ProcessAnswer(PStringArray &cmds, PString & sender) { - SendThisMessageTo(PString("Command ") + cmds[0] + PString(" not handled"), sender); + PTRACE(3, "Messages\tCommand::ProcessAnswer(PStringArray &cmds, PString & sender) Is not overridden. It should be\n"); + SendThisMessageTo(PString("Command ") + cmds[0] + PString(" not handled"), sender); } Modified: sofaswitch/trunk/voip/jocall.h ============================================================================== --- sofaswitch/trunk/voip/jocall.h (original) +++ sofaswitch/trunk/voip/jocall.h Mon Aug 6 00:21:14 2007 @@ -44,6 +44,28 @@ class MyManager; + +/** + This class describes the userdata passed to the Managers method for + setting up a call. We encapsulate the user data into this one class, and + can therefore pass it in to the OpalManager::SetUpCall method as a + pointer, and use the Opal methods for setting up a call. +*/ +class CallUserData : public PObject +{ + PCLASSINFO(CallUserData, PObject); + public: + /**The Sofa Switch identifying string to label the remote entity who asked + for this call to be setup. This string could be "c12" */ + PString remoteCont; + + /**This string describes the Sofa Switch label of the id assigned to this + call. It is used when we are processing an incoming call, and have to + join a Comms instance to a running call */ + PString preferredId; +}; + + /** A class the combines the OpalCall structure from OPAL with our protocol handling all messages. Modified: sofaswitch/trunk/voip/mymanager.cxx ============================================================================== --- sofaswitch/trunk/voip/mymanager.cxx (original) +++ sofaswitch/trunk/voip/mymanager.cxx Mon Aug 6 00:21:14 2007 @@ -443,9 +443,13 @@ OpalConnection::StringOptions * stringOptions ) { + if (connection.GetRemotePartyName().Find("udp Sound") != P_MAX_INDEX) + return OpalManager::OnIncomingConnection(connection, options, stringOptions); + PString message = PString("QueryAcceptIncoming ") + connection.GetRemotePartyName(); supervisor.SendThisMessageTo(message, GetControllerId()); - return TRUE; + + return OpalManager::OnIncomingConnection(connection, options, stringOptions); } void MyManager::AcceptThisCall(const PString & uniqueCallId, BOOL doAccept) @@ -637,7 +641,11 @@ if (!str.IsEmpty()) { PString localDev("udpss:*"); - SetUpCall(localDev, str, controllerIdString, preferredId); + PString callToken; + CallUserData uData; + uData.remoteCont = controllerIdString; + uData.preferredId = preferredId; + SetUpCall(localDev, str, callToken, &uData); } return; @@ -815,57 +823,6 @@ OpalManager::OnUserInputString(connection, value); } - -BOOL MyManager::SetUpCall(const PString & partyA, - const PString & partyB, - const PString & remoteController, - const PString & preferredId) -{ - PTRACE(3, "OpalMan\tSet up call from " << partyA - << " to " << partyB - << " by remote controller " << remoteController ); - - OpalCall * call = CreateCall(remoteController, preferredId); - if (call == NULL) { - PTRACE(1, "ERror, failed to setup a call"); - return FALSE; - } - - call->SetPartyB(partyB); - unsigned int options = 0; - int userData ; - OpalConnection::StringOptions stringOptions; - - OpalConnection *c1; - if (!MakeConnection(*call, partyA, &userData, options, &stringOptions)) { - PTRACE(3, "Manager\tFailed to make connection to " << partyA); - goto CallSetupFailed; - } - - c1 = call->GetConnection(0); - if (c1 == NULL) { - PTRACE(3, "SofaMan\t c1 is NULLLLLLL"); - goto CallSetupFailed; - } - - if (!c1->SetUpConnection()) { - PTRACE(3, "Manager\tFailed to setup connetion"); - goto CallSetupFailed; - } - - PTRACE(3, "SofaMan\tSetUpCall succeeded, call=" << *call); - return TRUE; - - - CallSetupFailed: - call->Clear(); - PStringStream msg; - msg << "FAILED to make a connection to connect " << partyA << " and " << partyB; - cerr << msg << endl; - PTRACE(1, msg); - return FALSE; -} - OpalCall * MyManager::CreateCall() { PTRACE(3, "Manager\tCreate a call with any CallID"); @@ -887,8 +844,16 @@ return frame; } -OpalCall * MyManager::CreateCall(const PString & remoteCont, const PString & preferredId) +OpalCall * MyManager::CreateCall(void * userData) { + PString remoteCont; + PString preferredId; + if (userData != NULL) { + CallUserData &uData = *((CallUserData *)userData); + remoteCont = uData.remoteCont; + preferredId = uData.preferredId; + } + PTRACE(3, "Manager\tCreate a call with a CallID of " << preferredId); Comms *c = NULL; if (!preferredId.IsEmpty()) { Modified: sofaswitch/trunk/voip/mymanager.h ============================================================================== --- sofaswitch/trunk/voip/mymanager.h (original) +++ sofaswitch/trunk/voip/mymanager.h Mon Aug 6 00:21:14 2007 @@ -150,27 +150,22 @@ /**Return the id of the remote controller */ PString GetControllerId(); - /**Set up a call between two parties. - This is used to initiate a call. Incoming calls are "answered" using a - different mechanism. - */ - virtual BOOL SetUpCall(const PString & partyA, /*!< The A party of call */ - const PString & partyB, /*!< The B party of call */ - const PString & remoteController, /*!<the controller who started this call */ - const PString & preferredId /*!<the id to assign to this call */ - ); - - /**Create a call object. - This function allows an application to have the system create - desccendants of the OpalCall class. This call will be controlled by an ID. + This method allows an application to have the system create + desccendants of the OpalCall class. + + This method is used to handle incoming voip calls. */ virtual OpalCall * CreateCall(); /**Same as CreateCall(), but assign a particular Comms structure, with a particular remoteController to this call. This routine - is used on creating outgoing calls. */ - virtual OpalCall * CreateCall(const PString & remoteController, const PString & preferredId); + is used when creating outgoing calls. + + The default behavious returns an instance of MyOpalCall. + */ + virtual OpalCall * CreateCall(void * userData ///< user data passed to SetUpCall + ); /**Destroy a call object. This gets called from background thread that garbage collects all calls Modified: sofaswitch/trunk/voip/udpconnection.cxx ============================================================================== --- sofaswitch/trunk/voip/udpconnection.cxx (original) +++ sofaswitch/trunk/voip/udpconnection.cxx Mon Aug 6 00:21:14 2007 @@ -88,52 +88,41 @@ DecOpalUdpSsConnection(); } -BOOL OpalUdpSsConnection::OnIncomingConnection(unsigned int options, - OpalConnection::StringOptions *stringOptions) -{ - PTRACE(3, "UdpSsConnection\t " << *this << " onIncoming connection"); - return endpoint.OnIncomingConnection(*this, options, stringOptions); -} - BOOL OpalUdpSsConnection::SetUpConnection() { - PSafePtr<OpalConnection> otherConn = ownerCall.GetOtherPartyConnection(*this); - - if (otherConn == NULL) { - PTRACE(3, "UdpSsConenction\t error - other party is NULL"); - PAssertAlways("Other Connection is NULL"); + // Check if we are A-Party in thsi call, so need to do things differently + if (ownerCall.GetConnection(0) == this) { + phase = SetUpPhase; + if (!OnIncomingConnection(0, NULL)) { + Release(EndedByCallerAbort); + return FALSE; } - remotePartyName = otherConn->GetRemotePartyName(); - remotePartyAddress = otherConn->GetRemotePartyAddress(); - PString remoteApplication = otherConn->GetRemoteApplication(); - - PTRACE(3, "UdpSs\tSetUpConnection, Remote party name " << remotePartyName << ')'); - PTRACE(3, "UdpSs\tSetUpConnection, Remote party address" << remotePartyAddress << ')'); - PTRACE(3, "UdpSs\tSetUpConnection, Remote application " << remoteApplication << ')'); - - // Check if we are A-Party in thsi call, so need to do things differently - if (ownerCall.GetConnection(0) == this) { - phase = SetUpPhase; - if (!OnIncomingConnection(0, NULL)) { - Release(EndedByCallerAbort); - return FALSE; - } - - PTRACE(2, "PCSS\tOutgoing call routed to " << ownerCall.GetPartyB() << " for " << *this); - if (!ownerCall.OnSetUp(*this)) { - Release(EndedByNoAccept); - return FALSE; - } - - PTRACE(3, "PCSS\tSetUpConnection(" << remotePartyName << ')'); - phase = AlertingPhase; - endpoint.OnShowIncoming(*this); - OnAlerting(); + PTRACE(3, "PCSS\tOutgoing call routed to " << ownerCall.GetPartyB() << " for " << *this); + if (!ownerCall.OnSetUp(*this)) { + Release(EndedByNoAccept); + return FALSE; } return TRUE; + } + + { + PSafePtr<OpalConnection> otherConn = ownerCall.GetOtherPartyConnection(*this); + if (otherConn == NULL) + return FALSE; + + remotePartyName = otherConn->GetRemotePartyName(); + remotePartyAddress = otherConn->GetRemotePartyAddress(); + remoteProductInfo = otherConn->GetRemoteProductInfo(); + } + + PTRACE(3, "PCSS\tSetUpConnection(" << remotePartyName << ')'); + phase = AlertingPhase; + OnAlerting(); + + return endpoint.OnShowIncoming(*this); } @@ -267,21 +256,6 @@ } -void OpalUdpSsConnection::InitiateCall() -{ - PTRACE(3, "Initiate call "); - phase = SetUpPhase; - - if (!OnIncomingConnection(0, NULL)) - Release(EndedByCallerAbort); - else { - PTRACE(2, "UdpSs\tOutgoing call routed to " << ownerCall.GetPartyB() << " for " << *this); - if (!ownerCall.OnSetUp(*this)) - Release(EndedByNoAccept); - } -} - - void OpalUdpSsConnection::AcceptIncoming() { if (!LockReadOnly()) Modified: sofaswitch/trunk/voip/udpconnection.h ============================================================================== --- sofaswitch/trunk/voip/udpconnection.h (original) +++ sofaswitch/trunk/voip/udpconnection.h Mon Aug 6 00:21:14 2007 @@ -71,11 +71,6 @@ /**@name Overrides from OpalConnection */ //@{ - /**Indicates this connection instance is about to join another connection - instance */ - virtual BOOL OnIncomingConnection(unsigned int, - OpalConnection::StringOptions*); - /**Start an outgoing connection. This function will initiate the connection to the remote entity, for example in H.323 it sends a SETUP, in SIP it sends an INVITE etc. @@ -177,10 +172,6 @@ /**@name New operations */ //@{ - /**Call is initiated as the A-Party. - */ - virtual void InitiateCall(); - /**Accept the incoming connection. */ virtual void AcceptIncoming(); Modified: sofaswitch/trunk/voip/udpep.cxx ============================================================================== --- sofaswitch/trunk/voip/udpep.cxx (original) +++ sofaswitch/trunk/voip/udpep.cxx Mon Aug 6 00:21:14 2007 @@ -78,7 +78,9 @@ BOOL OpalUdpSsEndPoint::MakeConnection(OpalCall & call, const PString & remoteParty, - void * userData) + void * userData, + unsigned int /*options*/, + OpalConnection::StringOptions * /*stringOptions*/) { // First strip of the prefix if present PINDEX prefixLength = 0; @@ -94,37 +96,10 @@ } connectionsActive.SetAt(conToken, connection); - - // If we are the A-party then need to initiate a call now in this thread and - // go through the routing engine via OnIncomingConnection. If we are the - // B-Party then SetUpConnection() gets called in the context of the A-party - // thread. - if (call.GetConnection(0) == connection) - connection->InitiateCall(); return TRUE; } - - - -BOOL OpalUdpSsEndPoint::MakeConnection(OpalCall & call, - const PString & remoteParty, - void * userData, - unsigned int /*options*/, - OpalConnection::StringOptions *stringOptions) -{ - return MakeConnection(call, remoteParty, userData); -} - -BOOL OpalUdpSsEndPoint::MakeConnection(OpalCall & call, - const PString & remoteParty, - void *userData, - unsigned int /*options*/) -{ - return MakeConnection(call, remoteParty, userData); -} - PString OpalUdpSsEndPoint::OnGetDestination(const OpalUdpSsConnection & /*connection*/) { @@ -168,11 +143,16 @@ } -void OpalUdpSsEndPoint::AcceptIncomingConnection(const PString & token) +BOOL OpalUdpSsEndPoint::AcceptIncomingConnection(const PString & token) { PSafePtr<OpalUdpSsConnection> connection = GetUdpSsConnectionWithLock(token, PSafeReadOnly); - if (connection != NULL) - connection->AcceptIncoming(); + if (connection == NULL) { + PTRACE(2, "OpalSsEp\tAcceptIncoming connection on " << token << "return false as connection not found"); + return FALSE; + } + + connection->AcceptIncoming(); + return TRUE; } @@ -189,25 +169,13 @@ return PSafePtrCast<OpalConnection, OpalUdpSsConnection>(GetConnectionWithLock(token, mode)); } - -void OpalUdpSsEndPoint::OnShowIncoming(const OpalUdpSsConnection & connection) -{ - PTRACE(3, "INCOMING CALL from remote node"); - incomingConnectionToken = connection.GetToken(); -} - - - -BOOL OpalUdpSsEndPoint::OnIncomingConnection(OpalConnection& conn, - unsigned int options, - OpalConnection::StringOptions *stringOptions) +BOOL OpalUdpSsEndPoint::OnShowIncoming(const OpalUdpSsConnection & connection) { - return TRUE; + PTRACE(3, "INCOMING CALL from remote node " << connection.GetToken()); + return TRUE; } - - BOOL OpalUdpSsEndPoint::OnShowOutgoing(const OpalUdpSsConnection & connection) { //PTime now; Modified: sofaswitch/trunk/voip/udpep.h ============================================================================== --- sofaswitch/trunk/voip/udpep.h (original) +++ sofaswitch/trunk/voip/udpep.h Mon Aug 6 00:21:14 2007 @@ -103,25 +103,10 @@ virtual BOOL MakeConnection( OpalCall & call, ///< Owner of connection const PString & party, ///< Remote party to call - void * userData = NULL ///< Arbitrary data to pass to connection + void * userData = NULL, ///< Arbitrary data to pass to connection + unsigned int options = 0,///< options to pass to conneciton + OpalConnection::StringOptions * stringOptions = NULL ); - virtual BOOL MakeConnection( - OpalCall & call, ///< Owner of connection - const PString & party, ///< Remote party to call - void * userData, ///< Arbitrary data to pass to connection - unsigned int options ///< options to pass to conneciton - ); - virtual BOOL MakeConnection( - OpalCall & call, ///< Owner of connection - const PString & party, ///< Remote party to call - void * userData, ///< Arbitrary data to pass to connection - unsigned int options, ///< options to pass to conneciton - OpalConnection::StringOptions * stringOptions - ); - - - - /**Get the data formats this endpoint is capable of operating. This provides a list of media data format names that may be used by an @@ -173,19 +158,16 @@ The default implementation is pure. */ - virtual void OnShowIncoming( + virtual BOOL OnShowIncoming( const OpalUdpSsConnection & connection /// Connection having event ); /**Accept the incoming connection. */ - virtual void AcceptIncomingConnection( + virtual BOOL AcceptIncomingConnection( const PString & connectionToken /// Token of connection to accept call ); - /**A connection is coming in - or being added to this endpoint */ - virtual BOOL OnIncomingConnection(OpalConnection&, unsigned int, - OpalConnection::StringOptions*); /**Call back to indicate that remote is ringing. If FALSE is returned the call is aborted.
participants (1)
-
SofaSWITCH SVN