sofaswitch-svn
Threads by month
- ----- 2026 -----
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
August 2007
- 1 participants
- 14 discussions
24 Aug '07
Author: derek
Date: Fri Aug 24 01:14:41 2007
New Revision: 395
Modified:
sofaswitch/trunk/sofa/src/messlist.cxx
sofaswitch/trunk/voip/comms.cxx
sofaswitch/trunk/voip/comms.h
sofaswitch/trunk/voip/jocall.cxx
sofaswitch/trunk/voip/mymanager.cxx
sofaswitch/trunk/voip/mymanager.h
sofaswitch/trunk/voip/udpsound.cxx
Log:
Multiple patches to logging. Keep compatible with current opal code.
Modified: sofaswitch/trunk/sofa/src/messlist.cxx
==============================================================================
--- sofaswitch/trunk/sofa/src/messlist.cxx (original)
+++ sofaswitch/trunk/sofa/src/messlist.cxx Fri Aug 24 01:14:41 2007
@@ -104,7 +104,6 @@
PWaitAndSignal m(mutex);
if (PAbstractList::GetSize() == 0) {
- PTRACE(3, "No more available comms to use");
return NULL;
}
Modified: sofaswitch/trunk/voip/comms.cxx
==============================================================================
--- sofaswitch/trunk/voip/comms.cxx (original)
+++ sofaswitch/trunk/voip/comms.cxx Fri Aug 24 01:14:41 2007
@@ -54,16 +54,18 @@
{
PTRACE(3, "Destroy the Comms class instance for " << GetOurId() << " all done");
+ DecComms();
+}
+
+void Comms::OnOpalCallCleared()
+{
PWaitAndSignal m(opalCallLock);
if (myOpalCall != NULL) {
myOpalCall->SafeDereference();
myOpalCall = NULL;
}
-
- DecComms();
}
-
void Comms::AdviseCallCreation()
{
PTRACE(3, "Advise of call creation on " << GetOurId() << " and " << remoteController);
@@ -82,13 +84,11 @@
{
PTRACE(5, "Comms StopAllComms Start " << GetOurId());
Terminate();
- WaitForTermination();
PTRACE(5, "Comms StopAllComms All done " << GetOurId());
}
void Comms::OnTermination()
{
- new CommsConsumer(manager, this);
PTRACE(3, "END of comms communications for " << GetOurId());
}
@@ -110,8 +110,6 @@
{
audioSocket.Close();
Terminate();
-
- audioSocket.Close();
}
void Comms::ProcessCallNode(PStringArray &cmds, PString & sender)
@@ -264,6 +262,16 @@
return mf;
}
+void CommsProvider::RemoveAllMessageFrames()
+{
+ PWaitAndSignal m(mutex);
+ Comms *mf = NULL;
+
+ for(PINDEX i = 0; i < PAbstractList::GetSize(); i++) {
+ mf = (Comms *)PAbstractList::GetAt(i);
+ new CommsConsumer(manager, mf);
+ }
+}
Comms *CommsProvider::GetNextComms()
{
@@ -271,7 +279,7 @@
for(;;) {
Comms *c = (Comms *)GetTheNextMessageFrame();
if (c->IsTerminated()) {
- manager.DestroyOldComms(c);
+ delete c;
}
return c;
}
@@ -284,11 +292,13 @@
manager(_manager),
comms(m)
{
+ PTRACE(2, "Create a Clear Comms Consumer to clear a comms instance " << m->GetOurId());
Resume();
}
CommsConsumer::~CommsConsumer()
{
+ PTRACE(2, "Finish Clear Comms Consumer to clear a comms instance " << ourId);
}
void CommsConsumer::Main()
@@ -298,29 +308,15 @@
comms->WaitForTermination();
- /*This line means that if, for any reason, the sofa communications
- terminates at any time, we will always detect it, and close this
- call off dead */
- manager.ClearCall(comms->GetOpalCallToken());
-
- PString ourId = comms->GetOurId();
+ ourId = comms->GetOurId();
PTRACE(3, "START checking: look for " << ourId << " to appear in a manager list");
-
- PINDEX iteration = 0;
- for(;;) {
- iteration++;
- PTRACE(6, "look for comms instance " << ourId << " in the manager"
- << " iteration " << iteration);
- Comms *c = manager.ClearCommsId(ourId);
- if (c != NULL) {
- PTRACE(3, "NOW delete comms instance " << ourId);
- PTRACE(3, "as we found it and have exclusive access to it");
- PTRACE(3, "and know that this thread has finished.");
- delete c;
- return;
- }
- PThread::Sleep(400);
+ Comms *c = manager.ClearCommsId(ourId);
+ if (c != NULL) {
+ PTRACE(3, "NOW delete comms instance " << ourId);
+ PTRACE(3, "as we found it and have exclusive access to it");
+ PTRACE(3, "and know that this thread has finished.");
+ delete c;
}
}
/* The comment below is magic for those who use emacs to edit this file. */
Modified: sofaswitch/trunk/voip/comms.h
==============================================================================
--- sofaswitch/trunk/voip/comms.h (original)
+++ sofaswitch/trunk/voip/comms.h Fri Aug 24 01:14:41 2007
@@ -84,6 +84,12 @@
notify the controller accordingly)).
*/
void AdviseCallCreation();
+
+ /**A Callback from the opal call class. This indicates that the call has
+ been completed dead cleared done and dusted. There are no more
+ communications to come from the current voip call, so this comms instance
+ can lose its interest in the OpalCall Structure */
+ void OnOpalCallCleared();
/**Assign a value to the jocall pointer */
void SetMyOpalCallPtr(MyOpalCall *ptr);
@@ -190,6 +196,9 @@
/**Retrieve the next Comms instance */
Comms *GetNextComms();
+ /**Cause each entry on this list to be deleted by an instance of the
+ CommsConsumer class */
+ void RemoveAllMessageFrames();
protected:
@@ -226,6 +235,9 @@
/**The instance we have to delete */
Comms *comms;
+
+ /**The id associated with the comms instance we ahve to delete */
+ PString ourId;
};
/////////////////////////////////////////////////////////////////////////////
Modified: sofaswitch/trunk/voip/jocall.cxx
==============================================================================
--- sofaswitch/trunk/voip/jocall.cxx (original)
+++ sofaswitch/trunk/voip/jocall.cxx Fri Aug 24 01:14:41 2007
@@ -76,10 +76,12 @@
MyOpalCall::~MyOpalCall()
{
PTRACE(3, "Destructor for Opal Call " << GetToken() << " and " << comms.GetOurId());
- comms.StopAllCommunications();
+ comms.StopAllCommunications();
+/* The comms instance must not self delete on completion. We stop the comms
+ instance, and then we delete it (as we are finished with it) */
+
comms.WaitForTermination();
-
- manager.DestroyOldComms(commsPtr);
+ manager.AppendFinishedComms(commsPtr);
PTRACE(3, "MyOpalCall\t" << *this << " destroyed dead and gone");
DecMyOpalCall();
@@ -167,6 +169,7 @@
PTRACE(2, "on cleared of this call " << myToken);
OpalCall::OnCleared();
CloseThisId();
+ comms.OnOpalCallCleared();
}
void MyOpalCall::SendThisDtmf(const PString & value)
Modified: sofaswitch/trunk/voip/mymanager.cxx
==============================================================================
--- sofaswitch/trunk/voip/mymanager.cxx (original)
+++ sofaswitch/trunk/voip/mymanager.cxx Fri Aug 24 01:14:41 2007
@@ -83,8 +83,8 @@
MyManager::MyManager(LaunchNewId & _lid,
PString & _ourId, PString & _ourPassword)
: lid(_lid),
- supervisor(*(new Supervisor(lid)))
-
+supervisor(*(new Supervisor(lid))),
+runningComms(*new CommsProvider(lid, *this))
{
allocationNumber = 0;
IncMyManager();
@@ -106,11 +106,10 @@
supervisor.Resume();
nodesMakingCalls.Initialise();
+ nodesFinishedCalls.Initialise();
- runningComms = new CommsProvider(lid, *this);
- runningComms->SetPreAllocatedSize(10);
- runningComms->Initialise();
- deadComms.Initialise();
+ runningComms.SetPreAllocatedSize(10);
+ runningComms.Initialise();
}
@@ -120,8 +119,6 @@
supervisor.WaitForTermination();
delete & supervisor;
- delete runningComms;
-
PTRACE(3, "destroy the manager");
DecMyManager();
}
@@ -497,13 +494,11 @@
PStringStream status;
status << endl;
status << "Pre built calls "
- << PString(runningComms->GetSize()) << endl;
+ << PString(runningComms.GetSize()) << endl;
status << "Pending message frames "
<< PString(nodesMakingCalls.GetSize()) << endl;
status << "Current active calls "
<< PString(activeCalls.GetSize()) << endl;
- status << "Terminating calls "
- << PString(deadComms.GetSize()) << endl;
status << "--------------" << endl;
status << " Comms count is "
@@ -522,9 +517,8 @@
<< GetCountUdpSoundChannel() << endl;
status << "--------------" << endl;
- PStringArray prebuilts = runningComms->GetCurrentEntries();
+ PStringArray prebuilts = runningComms.GetCurrentEntries();
PStringArray pendingNames = nodesMakingCalls.GetCurrentEntries();
- PStringArray deadNames = deadComms.GetCurrentEntries();
if (prebuilts.GetSize() > 0) {
status << "PreBuilt frames " << endl;
@@ -551,13 +545,6 @@
status << endl;
}
- if (deadNames.GetSize() > 0) {
- status << "Calls that are being cleaned up " << endl;
- for (PINDEX i = 0; i < deadNames.GetSize(); i++)
- status << " " << deadNames[i] << endl;
- status << endl;
- }
-
return status;
}
@@ -571,25 +558,28 @@
return c;
}
- c = (Comms *)runningComms->GetMessageFrameOn(memberId);
+ c = (Comms *)runningComms.GetMessageFrameOn(memberId);
if (c != NULL) {
PTRACE(3, "Clear comms Id on " << memberId
<< " for prebuilt, ready to go frames");
return c;
}
-
- c = (Comms *)deadComms.GetMessageFrameOn(memberId);
+
+ c = (Comms *)nodesFinishedCalls.GetMessageFrameOn(memberId);
if (c != NULL) {
- PTRACE(3, "Clear comms Id on " << memberId
- << " for dead comms instances frame");
+ PTRACE(3, "Clear comms Id on " << memberId << " for comms instances finished in a call");
return c;
}
- PTRACE(3, "Clear comms Id on " << memberId << " not found");
return NULL;
}
-
+void MyManager::AppendFinishedComms(Comms *commsPtr)
+{
+ PTRACE(3, "Manager\tThis comms instance has finished a call, and is about to DIE" << commsPtr->GetOurId());
+ nodesFinishedCalls.AddNewMessageFrame(commsPtr);
+ new CommsConsumer(*this, commsPtr);
+}
PString MyManager::GetDurationInfo(const PString & token)
{
@@ -605,7 +595,7 @@
void MyManager::RequestNewId(PString & requester)
{
- Comms *c = runningComms->GetNextComms();
+ Comms *c = runningComms.GetNextComms();
if (c == NULL)
return;
@@ -660,24 +650,18 @@
return;
}
-void MyManager::DestroyOldComms(Comms *oldComms)
-{
- PTRACE(3, "Place Comms instance " << *oldComms << " onto the deadComms list");
- deadComms.AddNewMessageFrame(oldComms);
-}
-
-
void MyManager::RemoveAllCalls()
{
/* Stop the building of new Comms instances */
PTRACE(3, "Manager\tRemove All Calls Start");
- runningComms->Terminate();
+ runningComms.Terminate();
nodesMakingCalls.TerminateAllMessageFrames();
- runningComms->WaitForTermination();
- runningComms->TerminateAllMessageFrames();
-
+ runningComms.WaitForTermination();
+ runningComms.TerminateAllMessageFrames();
+ runningComms.RemoveAllMessageFrames();
+
PTRACE(3, "Manager\tRemove all calls who are making calls");
/**Now we can remove all calls in the list */
@@ -704,26 +688,26 @@
for(PINDEX i = 0; i < 2; i++) {
RemoveAllCalls();
PTRACE(3, "END of all calls ");
-
- while(runningComms->GetSize() > 0) {
- PThread::Sleep(100);
- }
- PTRACE(3, "Running comms has a size of 0");
-
+ }
+
+ while(runningComms.GetSize() > 0) {
+ PTRACE(3, "Manager\tWait for runningComs to reach 0. Curently "
+ << runningComms.GetSize() << " elements");
+ PThread::Sleep(100);
+
+ PTRACE(3, "Running comms has a size of " << runningComms.GetSize());
+
while (nodesMakingCalls.GetSize() > 0) {
+ PTRACE(3, "Manager\tWait for Nodes Makeing Calls to get to zero size");
PThread::Sleep(100);
}
- PTRACE(3, "nodes making calls has a size of 0");
+ PTRACE(3, "nodes making calls has a size of " << nodesMakingCalls.GetSize());
while (activeCalls.GetSize() > 0) {
+ PTRACE(3, "Manager\tWait for active calls to get to zero size");
PThread::Sleep(100);
}
- PTRACE(3, "active calls has a size of 0");
-
- while (deadComms.GetSize() > 0) {
- PThread::Sleep(100);
- }
- PTRACE(3, "dead comms has a size of 0");
+ PTRACE(3, "active calls has a size of " << activeCalls.GetSize());
}
PTRACE(3, "Now, we have to leave a wait period");
@@ -836,7 +820,7 @@
{
PTRACE(3, "Manager\tCreate a call with any CallID");
Comms *c;
- c = runningComms->GetNextComms();
+ c = runningComms.GetNextComms();
if (c == NULL) {
PTRACE(3, "Failed to make a new node");
@@ -874,7 +858,7 @@
if (c == NULL) {
PTRACE(3, "No valid comms structure yet, so create one on the fly ");
- c = runningComms->GetNextComms();
+ c = runningComms.GetNextComms();
if (c == NULL) {
PTRACE(1, "BAD vibes, failed to creaate comms instance ");
Modified: sofaswitch/trunk/voip/mymanager.h
==============================================================================
--- sofaswitch/trunk/voip/mymanager.h (original)
+++ sofaswitch/trunk/voip/mymanager.h Fri Aug 24 01:14:41 2007
@@ -206,10 +206,6 @@
is available */
void RequestNewId(PString & requester);
- /**Take this old Comms structure, and delete it, in a separate
- thread to the MyOpalCall destructor */
- void DestroyOldComms(Comms *oldComms);
-
/**Check the different lists of Comms instances in this Manager
(runningComms, deadComms, and nodesMakingCalls) and find the
matching Comms instance. Return a pointer to the Comms
@@ -220,6 +216,11 @@
now" */
void RemoveAllCalls();
+ /**This comms instance was used in a call, and the call is finished. Put
+ this comms instance in a list. This method will then invoke a
+ CommsConsumer class to remove this instance */
+ void AppendFinishedComms(Comms *commsPtr);
+
protected:
/**The interface to the external script which runs python, to provide comms for us */
LaunchNewId &lid;
@@ -227,15 +228,21 @@
/** The manager of the comms with remote controller. It allows the calls to be setup */
Supervisor & supervisor;
+ /**A list of Comms instances, which are already built, connected
+ to the remote server, and ready to be used */
+ CommsProvider &runningComms;
+
/**A list of the nodes who are initiating calls through us. Frames
will be deleted from this list if they have not been claimed.
Frames have 10 seconds of life on this list before they are
deleted */
MessageFrameListPending nodesMakingCalls;
- /**A list of Comms instances, which are already built, connected
- to the remote server, and ready to be used */
- CommsProvider *runningComms;
+ /**A list of the nodes who have completed calls they are in. Frames will
+ be deleted by the CommsConsumer class, which will fish the node out of
+ this list and delete it. */
+ MessageFrameList nodesFinishedCalls;
+
/**A list of Comms instances that are known to have died. Comms instances will be
removed from this list by the CommsConsumer class.*/
Modified: sofaswitch/trunk/voip/udpsound.cxx
==============================================================================
--- sofaswitch/trunk/voip/udpsound.cxx (original)
+++ sofaswitch/trunk/voip/udpsound.cxx Fri Aug 24 01:14:41 2007
@@ -101,16 +101,22 @@
BOOL UdpSoundChannel::Write(const void * buffer, PINDEX amount)
{
- PTRACE(6, "MEDIA\tWrite " << amount << " bytes to the socket");
+ {
+ WORD dPort;
+ PIPSocket::Address destination;
+
+ audioSocket.GetSendAddress(destination, dPort);
+
+ PTRACE(6, "MEDIA\tWrite " << amount << " bytes to the socket " << destination << ":" << dPort);
+ }
+
if (!IsOpen()) {
PTRACE(3, "MEDIA\tWrite failed as this sound channel is closed");
return FALSE;
}
BOOL res = audioSocket.Write(buffer, amount);
- if (res) {
- PTRACE(5, "MEDIA\tWrite succeeded");
- } else {
+ if (res == FALSE) {
WORD dPort;
PIPSocket::Address destination;
@@ -123,7 +129,7 @@
lastWriteCount = amount;
- PTRACE(5, "MEDIA\tWrite to socket return " << audioSocket.IsOpen());
+ PTRACE(7, "MEDIA\tWrite to socket return " << audioSocket.IsOpen());
return audioSocket.IsOpen();
}
@@ -136,31 +142,32 @@
}
BOOL readOk = TRUE;
- PTRACE(5, "MEDIA\tNow do a read of " << amount << " bytes for " << GetSSLabel(isSource));
- PTRACE(5, "MEDIA\tThe read queue has a buffered bytes size of " << readQueue.GetLength());
+ PTRACE(7, "MEDIA\tNow do a read of " << amount << " bytes for " << GetSSLabel(isSource));
+ PTRACE(7, "MEDIA\tThe read queue has a buffered bytes size of " << readQueue.GetLength());
while (amount > readQueue.GetLength()) {
- PTRACE(5, "The internal buffer has insufficient bytes, as " << readQueue.GetLength() << " is less than " << amount);
- PTRACE(5, "MEDIA\tGrab some extra bytes from the socket");
readOk = audioSocket.Read(readBuffer.GetPointer(), 480);
if (!readOk) {
- PTRACE(1, "MEDIA\tThe read of a packet from a socket failed for " << GetSSLabel(isSource));
+ PTRACE(3, "MEDIA\tThe read of a packet from a socket failed for "
+ << GetSSLabel(isSource));
return FALSE;
}
- PTRACE(5, "The socket provided us with " << audioSocket.GetLastReadCount() << " bytes");
+ PTRACE(7, "The socket provided us with "
+ << audioSocket.GetLastReadCount() << " bytes");
readOk = readQueue.Write(readBuffer.GetPointer(), audioSocket.GetLastReadCount());
- PTRACE(5, "The readqueue now has a size of " << readQueue.GetLength() << " bytes");
+ PTRACE(7, "The readqueue now has a size of "
+ << readQueue.GetLength() << " bytes");
if (!readOk) {
- PTRACE(1, "Failed to write incoming packet to the memory queue");
+ PTRACE(3, "Failed to write incoming packet to the memory queue");
return FALSE;
}
}
readOk = readQueue.Read(buffer, amount);
lastReadCount = readQueue.GetLastReadCount();
- PTRACE(5, "Requested " << amount << " return after getting the next packet, so supply " << lastReadCount);
+ PTRACE(7, "Requested " << amount << " return after getting the next packet, so supply " << lastReadCount);
return readOk;
}
1
0
[Sofaswitch-svn] [commit] r394 - in sofaswitch/trunk: callflow/tests sofa/include/sofa sofa/src voip
by SofaSWITCH SVN 23 Aug '07
by SofaSWITCH SVN 23 Aug '07
23 Aug '07
Author: derek
Date: Thu Aug 23 01:22:58 2007
New Revision: 394
Modified:
sofaswitch/trunk/callflow/tests/makevoipcall.src
sofaswitch/trunk/sofa/include/sofa/messages.h
sofaswitch/trunk/sofa/src/messages.cxx
sofaswitch/trunk/voip/comms.cxx
sofaswitch/trunk/voip/comms.h
sofaswitch/trunk/voip/jocall.cxx
sofaswitch/trunk/voip/mymanager.cxx
sofaswitch/trunk/voip/udpconnection.cxx
Log:
*Tweaks to make it more easier to use - and match the OPAL
call progress phases. More work is requried here.
*Modify logging levels.
Modified: sofaswitch/trunk/callflow/tests/makevoipcall.src
==============================================================================
--- sofaswitch/trunk/callflow/tests/makevoipcall.src (original)
+++ sofaswitch/trunk/callflow/tests/makevoipcall.src Thu Aug 23 01:22:58 2007
@@ -1,3 +1,3 @@
-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>
+9<B>120<B>198<B>120,198,120,253,359,253<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>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>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>9<B>191<B>306<B>191,306,237,307<special>Tool Tip<ms>Join blocks shape<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>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>9<B>206<B>141<B>206,141,272,141<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 itself.<ms><special>First SofaSwitch worker (python)<ms>"sound"<ms><special>Second SofaSwitch worker (python)<ms>"sound"<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>2<B>244<B>139<B> extra <special>Tool Tip<ms>Suspend Processing<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>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>2<B>258<B>468<B> extra <special>Tool Tip<ms>Suspend Processing<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>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>9<B>99<B>146<B>99,146,101,269,166,281<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>2<B>211<B>306<B> extra <special>Tool Tip<ms>Suspend Processing<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>165<B>522<B>165,522,165,598,251,601<special>Tool Tip<ms>Join blocks shape<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>20<B>229<B>740<B> extra <special>Tool Tip<ms>Death<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>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>20<B>336<B>305<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>9<B>139<B>116<B>139,116,181,121<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>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>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>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>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>
Modified: sofaswitch/trunk/sofa/include/sofa/messages.h
==============================================================================
--- sofaswitch/trunk/sofa/include/sofa/messages.h (original)
+++ sofaswitch/trunk/sofa/include/sofa/messages.h Thu Aug 23 01:22:58 2007
@@ -197,7 +197,11 @@
2) transferUdp messageid addr:port sent in response to 1)
3) transferUdp messageid addr:port done sent in response to 2)
- An application would not normally override this method.*/
+ An entity which handles call setup/teardown would not normally override
+ this method.
+
+ Although, a supervisor, which watchs lots of calls, will override this
+ and treat it as an error on receiving this comand.*/
virtual void ProcessTransferUdp(PStringArray &cmds, PString & sender);
/**we have received a command advising us that we are to end now */
Modified: sofaswitch/trunk/sofa/src/messages.cxx
==============================================================================
--- sofaswitch/trunk/sofa/src/messages.cxx (original)
+++ sofaswitch/trunk/sofa/src/messages.cxx Thu Aug 23 01:22:58 2007
@@ -46,7 +46,7 @@
ourPassword = _ourPassword;
ourBaseId = _ourId;
buildCount = 0;
- PTRACE(3, "BASEId is " << ourBaseId);
+ PTRACE(5, "BASEId is " << ourBaseId);
PINDEX slash = ourBaseId.Find('/');
if (slash != P_MAX_INDEX) {
@@ -54,7 +54,7 @@
remoteServer = ourBaseId.Left(slash);
} else
ourNodeId = ourBaseId;
- PTRACE(3, "NODEId is " << ourNodeId);
+ PTRACE(5, "NODEId is " << ourNodeId);
}
LaunchNewId::~LaunchNewId()
@@ -64,7 +64,7 @@
PString LaunchNewId::CreateNewId()
{
- PTRACE(3, "Create a new id");
+ PTRACE(5, "Create a new id");
PWaitAndSignal m(countMutex);
PString res;
if (buildCount == 0) {
@@ -73,7 +73,7 @@
} else
res = ourNodeId + PString(buildCount++);
- PTRACE(3, "New id created at " << res);
+ PTRACE(5, "New id created at " << res);
return res;
}
@@ -87,7 +87,7 @@
ourId = lid.CreateNewId();
ourPassword = lid.GetOurPassword();
remoteServer = lid.GetServer();
- PTRACE(3, "Constructor for MessageFrame " << ourId);
+ PTRACE(5, "Constructor for MessageFrame " << ourId);
keepGoing = TRUE;
@@ -117,7 +117,7 @@
WORD localPort = preferredPort;
for (; preferredPort != 0;) {
if (audioSocket.Listen(INADDR_ANY, 0, localPort)) {
- PTRACE(3, "audio receive/send socket to listen on port " << localPort);
+ PTRACE(4, "audio receive/send socket to listen on port " << localPort);
break;
}
@@ -137,7 +137,7 @@
{
Terminate();
WaitForTermination();
- PTRACE(3, "DEstructor for MessageFrame " << ourId);
+ PTRACE(5, "DEstructor for MessageFrame " << ourId);
}
void MessageFrame::DtmfReceivedFromTheWorld(const PString & receivedDtmf)
@@ -163,7 +163,7 @@
return FALSE;
}
- PTRACE(3, "WaitForInitialised start wait for connection");
+ PTRACE(5, "WaitForInitialised start wait for connection");
goodConnection.Wait();
if (!keepGoing) {
PTRACE(3, "Thread " << GetOurId() << " failed as we could not connect");
@@ -171,7 +171,7 @@
return FALSE;
}
- PTRACE(3, "WaitForInitialised start wait for source id");
+ PTRACE(5, "WaitForInitialised start wait for source id");
writeSourceId.Wait();
if (!keepGoing) {
PTRACE(3, "Thread " << GetOurId() << " failed as no source id received");
@@ -179,30 +179,28 @@
return FALSE;
}
- PTRACE(3, "WaitForInitialised start all done ok.");
- PTRACE(3, "Thread " << GetOurId() << " is initialised ok");
+ PTRACE(5, "WaitForInitialised start all done ok.");
+ PTRACE(4, "Thread " << GetOurId() << " is initialised ok");
return TRUE;
}
void MessageFrame::Terminate()
{
- PTRACE(3, "Terminate the message frame for " << GetOurId());
-
keepGoing = FALSE;
audioSocket.Close();
CloseMessagesSocket();
threadRunning.Signal();
goodConnection.Signal();
writeSourceId.Signal();
- PTRACE(3, "Finish Terminate the message frame for " << GetOurId());
+ PTRACE(4, "Finish Terminate the message frame for " << GetOurId());
}
void MessageFrame::Initialise()
{
SetThreadName(PString("Messages.") + ourId);
- PTRACE(3, "Message frame Initialise begin");
+ PTRACE(5, "Message frame Initialise begin");
messagesSocket.SetPort(5000);
- PTRACE(3, "Message frame connect to port 5000 of server \""
+ PTRACE(5, "Message frame connect to port 5000 of server \""
<< remoteServer << "\"");
for(PINDEX tryCount = 0; keepGoing && (tryCount < 5); tryCount++) {
@@ -210,43 +208,42 @@
PTRACE(3, "Failed to connect to \"" << remoteServer << "\" error was \""
<< messagesSocket.GetErrorText() << "\"");
}
- PTRACE(3, "finish a try to connect");
if (messagesSocket.GetErrorCode() == PChannel::NoError) {
tryCount = 100;
- PTRACE(3, "successfull connect for " << ourId);
+ PTRACE(5, "successfull connect for " << ourId);
} else {
- PTRACE(1, "Error text from connect is " << messagesSocket.GetErrorText());
+ PTRACE(3, "Error text from connect is " << messagesSocket.GetErrorText());
PThread::Sleep(10);
}
}
if (!keepGoing) {
- PTRACE(3, "initialize end - keepgoing is false");
+ PTRACE(4, "initialize end - keepgoing is false ");
return;
}
- PTRACE(3, "ok, we have connected - probably");
+ PTRACE(5, "ok, we have connected - probably");
if (messagesSocket.GetErrorCode() != PChannel::NoError) {
- PTRACE(1, "error fail warning GIVE UP on this link. After 5 tries, could not get in." );
+ PTRACE(3, "error fail warning GIVE UP on this link. After 5 tries, could not get in." );
PTRACE(3, "multiple efforts to connect aborted " );
keepGoing = FALSE;
goodConnection.Signal();
return;
}
- PTRACE(3, "ok - we have a good connection");
+ PTRACE(5, "ok - we have a good connection");
goodConnection.Signal();
if (!messagesSocket.SetOption(TCP_NODELAY, 1, IPPROTO_TCP)) {
PTRACE(1, "SetOption(TCP_NODELAY) failed: " << messagesSocket.GetErrorText());
if (!keepGoing) {
- PTRACE(3, "initialize end TCP_NODELAY- keepgoing is false");
+ PTRACE(4, "initialize end TCP_NODELAY- keepgoing is false");
return;
}
}
if (!messagesSocket.SetOption(SO_KEEPALIVE, 1)) {
- PTRACE(1, "SetOption(keepalive) failed: " << messagesSocket.GetErrorText());
+ PTRACE(3, "SetOption(keepalive) failed: " << messagesSocket.GetErrorText());
if (!keepGoing) {
PTRACE(3, "initialize end SO_KEEPALIVE- keepgoing is false");
return;
@@ -318,7 +315,7 @@
if (!keepGoing) {
PTRACE(3, "END fail warning of message frame thread for " << ourId);
}
- PTRACE(3, "Initialise all done and was successfull. ");
+ PTRACE(5, "Initialise all done and was successfull. ");
PINDEX maxm = 2000;
PBYTEArray data(maxm);
@@ -331,11 +328,10 @@
readSize[ir] = 1;
while(keepGoing){
- PTRACE(3, "next iteration of read loop");
messagesSocket.Read(data.GetPointer(), maxm);
PINDEX size = messagesSocket.GetLastReadCount();
PINDEX lastError = messagesSocket.GetErrorCode();
- PTRACE(4, "Read size is " << size << " and error code " << lastError);
+
readSize[readIndex] = size;
readIndex = (readIndex + 1) % consecutiveReadNulls;
PINDEX readSum = 0;
@@ -352,9 +348,9 @@
}
if (lastError != PChannel::NoError) {
- PTRACE(1, "Failed in read from comms socket, code is "
+ PTRACE(3, "Failed in read from comms socket, code is "
<< messagesSocket.GetErrorText());
- PTRACE(1, "End Process Incoming Messages as we had a read error.");
+ PTRACE(3, "End Process Incoming Messages as we had a read error.");
keepGoing = FALSE;
continue;
} else {
@@ -362,9 +358,7 @@
}
}
- PTRACE(3, " - thread has finished");
-
- PTRACE(3, "End of Process Incoming Messages - thread has finished");
+ PTRACE(5, "End of Process Incoming Messages - thread has finished");
CloseMessagesSocket();
OnTermination();
@@ -373,7 +367,7 @@
void MessageFrame::OnTermination()
{
- PTRACE(1, " End of the emssage frame thread.for " << GetOurId());
+ PTRACE(5, " End of the emssage frame thread.for " << GetOurId());
}
void MessageFrame::ProcessIncomingMessages(PBYTEArray & block,
@@ -393,7 +387,7 @@
for(i = 0; i < result.GetSize(); i++) {
PString res = result[i];
- PTRACE(3, "Incoming message of \"" << res << "\"");
+ PTRACE(5, "Incoming message of \"" << res << "\"");
PINDEX l = res.Find(':');
if (l == P_MAX_INDEX) {
PTRACE(3, "Could not find a colon in " << res);
@@ -428,7 +422,7 @@
void MessageFrame::SendThisMessageTo(const char *message, PString dest)
{
PString msg(message);
- PTRACE(3, "Sendmessage " << msg << " " << dest);
+ PTRACE(3, "Sendmessage " << msg << " to " << dest);
SendThisMessageTo(msg, dest);
}
@@ -440,10 +434,6 @@
PTRACE(3, "the message " << message << " is dropped, cause we are closed ");
return;
}
-
- PStringStream summary;
- summary <<"Now we send the message \"" << message << "\" to " << dest;
- PTRACE(3, summary);
PBYTEArray binary;
binary.SetSize(dest.GetLength() + 1 + message.GetLength() + 1);
@@ -454,10 +444,8 @@
binary[binary.GetSize() - 1] = 0;
writeMessageLock.Wait();
- if (messagesSocket.Write(binary.GetPointer(), binary.GetSize())) {
- PTRACE(3, "Sent message just fine");
- } else {
- PTRACE(3, "Failed to send message " << messagesSocket.GetErrorText());
+ if (messagesSocket.Write(binary.GetPointer(), binary.GetSize()) == FALSE) {
+ PTRACE(3, "Failed to send message " << _message << " to " << dest << ". error was " << messagesSocket.GetErrorText());
}
writeMessageLock.Signal();
}
@@ -465,9 +453,9 @@
void MessageFrame::ProcessMessage(PString message, PString sender)
{
PStringArray cmds = message.Tokenise(" ", FALSE);
- PTRACE(3, "Now process \"" << message << "\"");
+
if (cmds[0] *= availableCommands[0]) {
- PTRACE(2, "ProcessHangup " << cmds[0]);
+ PTRACE(4, "ProcessHangup " << cmds[0]);
if (OkToHangup()) {
keepGoing = FALSE;
ProcessHangup(cmds, sender);
@@ -480,61 +468,61 @@
}
if (cmds[0] *= availableCommands[1]) {
- PTRACE(2, "ProcessCallNode " << cmds[0]);
+ PTRACE(4, "ProcessCallNode " << cmds[0]);
ProcessCallNode(cmds, sender);
return;
}
if (cmds[0] *= availableCommands[2]) {
- PTRACE(2, "ProcessStatusQuery " << cmds[0]);
+ PTRACE(4, "ProcessStatusQuery " << cmds[0]);
ProcessStatusQuery(cmds, sender);
return;
}
if (cmds[0] *= availableCommands[3]) {
- PTRACE(2, "ProcessDuration " << cmds[0]);
+ PTRACE(4, "ProcessDuration " << cmds[0]);
ProcessDuration(cmds, sender);
return;
}
if (cmds[0] *= availableCommands[4]) {
- PTRACE(2, "ProcessIdentify " << cmds[0]);
+ PTRACE(4, "ProcessIdentify " << cmds[0]);
ProcessIdentify(cmds, sender);
return;
}
if (cmds[0] *= availableCommands[5]) {
- PTRACE(2, "ProcessDebug " << cmds[0]);
+ PTRACE(4, "ProcessDebug " << cmds[0]);
ProcessDebug(cmds, sender);
return;
}
if (cmds[0] *= availableCommands[6]) {
- PTRACE(2, "ProcessAnswer " << cmds[0]);
+ PTRACE(4, "ProcessAnswer " << cmds[0]);
ProcessAnswer(cmds, sender);
return;
}
if (cmds[0] *= availableCommands[7]) {
- PTRACE(2, "ProcessTransferUdp " << cmds[0]);
+ PTRACE(4, "ProcessTransferUdp " << cmds[0]);
ProcessTransferUdp(cmds, sender);
return;
}
if (cmds[0] *= availableCommands[8]) {
- PTRACE(2, "ProcessQueryAddress (or query local address)" << cmds[0]);
+ PTRACE(4, "ProcessQueryAddress (or query local address)" << cmds[0]);
ProcessQueryLocalAddress(cmds, sender);
return;
}
if (cmds[0] *= availableCommands[9]) {
- PTRACE(2, "ProcessAdviseSendAddress " << cmds[0]);
+ PTRACE(4, "ProcessAdviseSendAddress " << cmds[0]);
ProcessAdviseSendAddress(cmds, sender);
return;
}
if (cmds[0] *= availableCommands[10]) {
- PTRACE(2, "ProcessQuitNow " << cmds[0]);
+ PTRACE(4, "ProcessQuitNow " << cmds[0]);
if (OkToQuitNow()) {
keepGoing = FALSE;
ProcessQuitNow(cmds, sender);
@@ -547,50 +535,50 @@
}
if (cmds[0] *= availableCommands[11]) {
- PTRACE(2, "ProcessHelp " << cmds[0]);
+ PTRACE(4, "ProcessHelp " << cmds[0]);
ProcessHelp(cmds, sender);
return;
}
if (cmds[0] *= availableCommands[12]) {
- PTRACE(2, "ProcessQueryDestAddress (or query destination address)" << cmds[0]);
+ PTRACE(4, "ProcessQueryDestAddress (or query destination address)" << cmds[0]);
ProcessQueryDestAddress(cmds, sender);
return;
}
if (cmds[0] *= availableCommands[13]) {
- PTRACE(2, "ProcessSendDtmf " << cmds[0]);
+ PTRACE(4, "ProcessSendDtmf " << cmds[0]);
ProcessSendDtmf(cmds, sender);
return;
}
if (cmds[0] *= availableCommands[14]) {
- PTRACE(2, "ProcessRequestNewId " << cmds[0]);
+ PTRACE(4, "ProcessRequestNewId " << cmds[0]);
ProcessRequestNewId(cmds, sender);
return;
}
if (cmds[0] *= availableCommands[15]) {
- PTRACE(2, "ProcessSetReceivedMsgFile " << cmds[0]);
+ PTRACE(4, "ProcessSetReceivedMsgFile " << cmds[0]);
ProcessSetWriteFile(cmds, sender);
return;
}
if (cmds[0] *= availableCommands[16]) {
- PTRACE(2, "ProcessSetAnnouncementFile " << cmds[0]);
+ PTRACE(4, "ProcessSetAnnouncementFile " << cmds[0]);
ProcessSetReadFile(cmds, sender);
return;
}
if (cmds[0] *= availableCommands[17]) {
- PTRACE(2, "ReportToMe " << cmds[0]);
+ PTRACE(4, "ReportToMe " << cmds[0]);
SetRemoteController(sender);
return;
}
#ifdef PMEMORY_CHECK
if (cmds[0] *= availableCommands[18]) {
- PTRACE(2, "ProcessMemoryDump " << cmds[0]);
+ PTRACE(4, "ProcessMemoryDump " << cmds[0]);
ProcessMemoryDump(cmds, sender);
return;
}
Modified: sofaswitch/trunk/voip/comms.cxx
==============================================================================
--- sofaswitch/trunk/voip/comms.cxx (original)
+++ sofaswitch/trunk/voip/comms.cxx Thu Aug 23 01:22:58 2007
@@ -54,6 +54,12 @@
{
PTRACE(3, "Destroy the Comms class instance for " << GetOurId() << " all done");
+ PWaitAndSignal m(opalCallLock);
+ if (myOpalCall != NULL) {
+ myOpalCall->SafeDereference();
+ myOpalCall = NULL;
+ }
+
DecComms();
}
@@ -237,19 +243,6 @@
return TRUE;
}
-void Comms::AdviseCallRelease()
-{
- PTRACE(3, "Advise of call hangup on " << GetOurId() << " and " << remoteController);
- PString advise = PString("Hangup ") + GetOurId();
- SendThisMessageTo(advise, remoteController);
-
- PWaitAndSignal m(opalCallLock);
- if (myOpalCall != NULL) {
- myOpalCall->SafeDereference();
- myOpalCall = NULL;
- }
-}
-
PUDPSocket & Comms::GetAudioSocket()
{
PTRACE(6, "Return reference to audio socket");
Modified: sofaswitch/trunk/voip/comms.h
==============================================================================
--- sofaswitch/trunk/voip/comms.h (original)
+++ sofaswitch/trunk/voip/comms.h Thu Aug 23 01:22:58 2007
@@ -74,15 +74,17 @@
/**Send a message to the remote controller that we are closing down now */
virtual void StopAllCommunications();
- /**Send a message to the remote controller saying that we are
- created (and established in the Opal sense of a connection). The
- id of this node is appended to the message.
+ /**Send a message to the remote controller saying that we are created (and
+ established in the Opal sense of a connection). The id of this node is
+ appended to the message.
+
+ Note that there is no need to send a message to the remote controller we
+ have died. The remote controller will get this "death" message from the
+ server. ((The message server will note that our socket has died, and
+ notify the controller accordingly)).
*/
void AdviseCallCreation();
- /**Tell this comms instance to let go of the OpalCall pointer */
- void AdviseCallRelease();
-
/**Assign a value to the jocall pointer */
void SetMyOpalCallPtr(MyOpalCall *ptr);
Modified: sofaswitch/trunk/voip/jocall.cxx
==============================================================================
--- sofaswitch/trunk/voip/jocall.cxx (original)
+++ sofaswitch/trunk/voip/jocall.cxx Thu Aug 23 01:22:58 2007
@@ -153,7 +153,6 @@
void MyOpalCall::OnReleased(OpalConnection & connection)
{
- comms.AdviseCallRelease();
PTRACE(2, "On Released of connection. " << connection.GetToken());
OpalCall::OnReleased(connection);
}
Modified: sofaswitch/trunk/voip/mymanager.cxx
==============================================================================
--- sofaswitch/trunk/voip/mymanager.cxx (original)
+++ sofaswitch/trunk/voip/mymanager.cxx Thu Aug 23 01:22:58 2007
@@ -439,8 +439,8 @@
BOOL MyManager::OnIncomingConnection(
- OpalConnection & connection, ///< Connection that is calling
- unsigned options, ///< options for new connection
+ OpalConnection & connection,
+ unsigned options,
OpalConnection::StringOptions * stringOptions
)
{
Modified: sofaswitch/trunk/voip/udpconnection.cxx
==============================================================================
--- sofaswitch/trunk/voip/udpconnection.cxx (original)
+++ sofaswitch/trunk/voip/udpconnection.cxx Thu Aug 23 01:22:58 2007
@@ -189,7 +189,6 @@
if (soundChannel == NULL)
return NULL;
- PTRACE(3, "ZZZ\tCreate opal audio media stream for " << mediaFormat << " and source of " << isSource);
return new OpalAudioMediaStream(*this, mediaFormat, sessionID, isSource, 2, soundChannel);
}
1
0
Author: derek
Date: Mon Aug 6 21:03:57 2007
New Revision: 393
Modified:
sofaswitch/trunk/voip/jocall.cxx
sofaswitch/trunk/voip/jocall.h
sofaswitch/trunk/voip/mymanager.cxx
sofaswitch/trunk/voip/supervisor.cxx
sofaswitch/trunk/voip/supervisor.h
sofaswitch/trunk/voip/udpconnection.cxx
sofaswitch/trunk/voip/udpconnection.h
Log:
Get h323 voice calls to mirror back. We make a h.323 call to ourselves, which we then detect coming
back to us... Good..
Modified: sofaswitch/trunk/voip/jocall.cxx
==============================================================================
--- sofaswitch/trunk/voip/jocall.cxx (original)
+++ sofaswitch/trunk/voip/jocall.cxx Mon Aug 6 21:03:57 2007
@@ -158,6 +158,11 @@
OpalCall::OnReleased(connection);
}
+void MyOpalCall::SendThisMessageTo(const PString & message, const PString & destination)
+{
+ comms.SendThisMessageTo(message, destination);
+}
+
void MyOpalCall::OnCleared()
{
PTRACE(2, "on cleared of this call " << myToken);
@@ -176,7 +181,13 @@
void MyOpalCall::IncomingCall(const PString &remoteNode)
{
PTRACE(3, "Jocal - incoming call to query the remote controller on ");
+}
+
+void MyOpalCall::QueryAcceptIncomingCall(const PString & remoteController, const PString &remoteParty)
+{
+ PString message = PString("QueryAcceptIncoming ") + remoteParty;
+ SendThisMessageTo(message, remoteController);
}
void MyOpalCall::AcceptThisCall(BOOL doAccept)
Modified: sofaswitch/trunk/voip/jocall.h
==============================================================================
--- sofaswitch/trunk/voip/jocall.h (original)
+++ sofaswitch/trunk/voip/jocall.h Mon Aug 6 21:03:57 2007
@@ -134,6 +134,11 @@
void SendThisDtmf(const PString & userInput ///DTMF to send
);
+ /**This OpalCall descendant is controlled by some remote controller. In
+ this method, this descendant can send a message to that remote
+ controller about something */
+ void SendThisMessageTo(const PString & message, const PString & destination);
+
/**Make the OpalConnections in this call accept/reject this incoming
call. This will move the status of the incoming call to
connecting/releasing
@@ -161,6 +166,10 @@
/**Report the ID (as used by sofaswitch) of this comms instance. */
PString GetOurId() { return comms.GetOurId(); }
+ /**Send a message to the remote controller about an incoming call - and ask
+ for permission to answer it */
+ void QueryAcceptIncomingCall(const PString & remoteController, const PString &remoteParty);
+
protected:
/**Link to our controll manager */
Modified: sofaswitch/trunk/voip/mymanager.cxx
==============================================================================
--- sofaswitch/trunk/voip/mymanager.cxx (original)
+++ sofaswitch/trunk/voip/mymanager.cxx Mon Aug 6 21:03:57 2007
@@ -75,6 +75,7 @@
#include "mymanager.h"
#include "supervisor.h"
#include "udpep.h"
+#include "udpconnection.h"
#define new PNEW
///////////////////////////////////////////////////////////////
@@ -443,11 +444,19 @@
OpalConnection::StringOptions * stringOptions
)
{
+ PTRACE(3, "Manager\tOnIncomingConnection from " << connection);
+
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());
+ /*We, the manager, have an incoming call. It has to be queried back to the
+ remote controller, from the node handling the call itself. We do not want
+ to be responsible for handling setup/teardown of each call The remote
+ controller will send the answer to the newly created connection, who will
+ answer it. It is none of the supervisor's business the managing of answer
+ call yes/no. */
+
+ ((MyOpalCall &)connection.GetCall()).QueryAcceptIncomingCall(GetControllerId(), connection.GetRemotePartyName());
return OpalManager::OnIncomingConnection(connection, options, stringOptions);
}
Modified: sofaswitch/trunk/voip/supervisor.cxx
==============================================================================
--- sofaswitch/trunk/voip/supervisor.cxx (original)
+++ sofaswitch/trunk/voip/supervisor.cxx Mon Aug 6 21:03:57 2007
@@ -67,6 +67,16 @@
PTRACE(3, "Supervisor thread has ended");
}
+void Supervisor::ProcessAnswer(PStringArray &cmds, PString & sender)
+{
+ PAssertAlways("Supervisor should not attempt to answer a call");
+}
+
+void Supervisor::ProcessTransferUdp(PStringArray &cmds, PString & sender)
+{
+ PAssertAlways("Supervisor should not attempt to transfer a call");
+}
+
void Supervisor::ProcessCallNode(PStringArray & cmds, PString & sender)
{
PTRACE(3, "Supervisor:: we can start a call to " << sender);
@@ -115,7 +125,7 @@
void Supervisor::ProcessHangup(PStringArray &cmds, PString & sender)
{
- SendThisMessageTo(cmds[0] + PString(" is not handled by the supervisor - send it to the relevant call "), sender);
+ PAssertAlways("Supervisor should not process a Hangup message");
}
Modified: sofaswitch/trunk/voip/supervisor.h
==============================================================================
--- sofaswitch/trunk/voip/supervisor.h (original)
+++ sofaswitch/trunk/voip/supervisor.h Mon Aug 6 21:03:57 2007
@@ -70,6 +70,10 @@
/**we have received a Call other Node command, so do it and reply accordingly*/
virtual void ProcessCallNode(PStringArray & cmds, PString & sender);
+ /**This method is overridden as an error handler. The supervisor should never
+ receive this message */
+ void ProcessTransferUdp(PStringArray &cmds, PString & sender);
+
/**we have received a query status command, so do it and reply accordingly*/
virtual void ProcessStatusQuery(PStringArray &cmds, PString & sender);
@@ -90,7 +94,7 @@
virtual void ProcessRequestNewId(PStringArray &cmds, PString & sender);
/**Placed here - the child class has this method as pure virtual... */
- virtual void ProcessAnswer(PStringArray &cmds, PString & sender) { }
+ virtual void ProcessAnswer(PStringArray &cmds, PString & sender);
/**Some MessageFrame instances do not have the permission to quit
now. This virtual method determines if this instance is permitted to
Modified: sofaswitch/trunk/voip/udpconnection.cxx
==============================================================================
--- sofaswitch/trunk/voip/udpconnection.cxx (original)
+++ sofaswitch/trunk/voip/udpconnection.cxx Mon Aug 6 21:03:57 2007
@@ -223,6 +223,23 @@
OpalConnection::Release(reason);
}
+void OpalUdpSsConnection::SendThisMessageTo(const PString & message, const PString & destination)
+{
+ ((MyOpalCall &)GetCall()).SendThisMessageTo(message, destination);
+}
+
+void OpalUdpSsConnection::QueryAcceptIncomingCall(const PString & destination)
+{
+ PSafePtr<OpalConnection> otherConn = ownerCall.GetOtherPartyConnection(*this);
+ if (otherConn == NULL) {
+ PTRACE(3, "SETUP\t Cannot query on accept incoming call. Probably because we are making a call.");
+ return;
+ }
+
+ PString message = PString("QueryAcceptIncoming ") + otherConn->GetRemotePartyName();
+
+ ((MyOpalCall &)GetCall()).SendThisMessageTo(message, destination);
+}
PSoundChannel * OpalUdpSsConnection::CreateSoundChannel(BOOL isSource)
{
Modified: sofaswitch/trunk/voip/udpconnection.h
==============================================================================
--- sofaswitch/trunk/voip/udpconnection.h (original)
+++ sofaswitch/trunk/voip/udpconnection.h Mon Aug 6 21:03:57 2007
@@ -194,6 +194,15 @@
CallEndReason reason = EndedByLocalUser ///< Reason for call release
);
+ /**This connection is controlled by some remote controller. This
+ connection has to send a message to that remote controller about
+ something */
+ void SendThisMessageTo(const PString & message, const PString & destination);
+
+ /**There is an incoming call, which has created this udp connection. The incoming
+ call is coming in on a sip/iax2/h.323 connection. We have to send a message to the
+ remote controller, which is done through the MyOpalCall structure */
+ void QueryAcceptIncomingCall(const PString & destination);
//@}
1
0
[Sofaswitch-svn] [commit] r392 - in sofaswitch/trunk/sofa: include/sofa src
by SofaSWITCH SVN 06 Aug '07
by SofaSWITCH SVN 06 Aug '07
06 Aug '07
Author: derek
Date: Mon Aug 6 01:10:17 2007
New Revision: 392
Modified:
sofaswitch/trunk/sofa/include/sofa/messages.h
sofaswitch/trunk/sofa/include/sofa/messlist.h
sofaswitch/trunk/sofa/src/messages.cxx
sofaswitch/trunk/sofa/src/messlist.cxx
Log:
Make the ProcessAnswer method virtual. Fix follow on things.
Modified: sofaswitch/trunk/sofa/include/sofa/messages.h
==============================================================================
--- sofaswitch/trunk/sofa/include/sofa/messages.h (original)
+++ sofaswitch/trunk/sofa/include/sofa/messages.h Mon Aug 6 01:10:17 2007
@@ -185,7 +185,7 @@
/**we have received a command advising us how to answer to the
incoming call, so we act as required and reply accordingly*/
- virtual void ProcessAnswer(PStringArray &cmds, PString & sender);
+ virtual void ProcessAnswer(PStringArray &cmds, PString & sender) = 0;
/**we have received a command advising us that we are to install udp
comms with a particular remote node id. Now, we have to reply
Modified: sofaswitch/trunk/sofa/include/sofa/messlist.h
==============================================================================
--- sofaswitch/trunk/sofa/include/sofa/messlist.h (original)
+++ sofaswitch/trunk/sofa/include/sofa/messlist.h Mon Aug 6 01:10:17 2007
@@ -172,8 +172,11 @@
/**Do the work of actually building a new MessageFrame. This method
will be overridden, to create descendants of MessageFrames, and
- store them in this list. */
- virtual MessageFrame *BuildMessageFrame();
+ store them in this list.
+
+ This method is pure virtual. We DEMAND that the user provides their own
+ interpretation of this method.*/
+ virtual MessageFrame *BuildMessageFrame() = 0;
#ifdef DOC_PLUS_PLUS
/**The thread, which runs to create new and ready to go instances, runs in here */
Modified: sofaswitch/trunk/sofa/src/messages.cxx
==============================================================================
--- sofaswitch/trunk/sofa/src/messages.cxx (original)
+++ sofaswitch/trunk/sofa/src/messages.cxx Mon Aug 6 01:10:17 2007
@@ -680,12 +680,13 @@
SendThisMessageTo(PString("Command ") + cmds[0] + PString(" not handled"), sender);
}
+/*
void MessageFrame::ProcessAnswer(PStringArray &cmds, PString & 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);
}
-
+*/
void MessageFrame::ProcessTransferUdp(PStringArray &cmds, PString & sender)
{
Modified: sofaswitch/trunk/sofa/src/messlist.cxx
==============================================================================
--- sofaswitch/trunk/sofa/src/messlist.cxx (original)
+++ sofaswitch/trunk/sofa/src/messlist.cxx Mon Aug 6 01:10:17 2007
@@ -119,6 +119,7 @@
return NULL;
}
+
MessageFrame *MessageFrameList::GetTheNextMessageFrame()
{
PWaitAndSignal m(mutex);
@@ -257,6 +258,8 @@
return NULL;
}
+/*
+
MessageFrame *MessageFrameListProvider::BuildMessageFrame()
{
PTRACE(3, "Build a mesasge frame ");
@@ -266,6 +269,9 @@
mf->WaitUntilInitialised();
return mf;
}
+*/
+
+
/////////////////////////////////////////////////////////////////////////////
MessageFrameListPending::MessageFrameListPending()
{
1
0
Author: derek
Date: Mon Aug 6 01:04:35 2007
New Revision: 391
Modified:
sofaswitch/trunk/voip/supervisor.h
Log:
Add method, so it compiles correctly.
Modified: sofaswitch/trunk/voip/supervisor.h
==============================================================================
--- sofaswitch/trunk/voip/supervisor.h (original)
+++ sofaswitch/trunk/voip/supervisor.h Mon Aug 6 01:04:35 2007
@@ -88,7 +88,9 @@
communications nodes, that will be controlled only by the remote
node */
virtual void ProcessRequestNewId(PStringArray &cmds, PString & sender);
-
+
+ /**Placed here - the child class has this method as pure virtual... */
+ virtual void ProcessAnswer(PStringArray &cmds, PString & sender) { }
/**Some MessageFrame instances do not have the permission to quit
now. This virtual method determines if this instance is permitted to
1
0
[Sofaswitch-svn] [commit] r390 - in sofaswitch/trunk: callflow/src callflow/tests overview sofa/src voip
by SofaSWITCH SVN 06 Aug '07
by SofaSWITCH SVN 06 Aug '07
06 Aug '07
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.
1
0
Author: derek
Date: Fri Aug 3 00:41:32 2007
New Revision: 389
Modified:
sofaswitch/trunk/voip/jocall.cxx
sofaswitch/trunk/voip/mymanager.cxx
sofaswitch/trunk/voip/udpconnection.cxx
sofaswitch/trunk/voip/udpep.cxx
Log:
Fiddles - try to bring into line with Opal Requirements.
Modified: sofaswitch/trunk/voip/jocall.cxx
==============================================================================
--- sofaswitch/trunk/voip/jocall.cxx (original)
+++ sofaswitch/trunk/voip/jocall.cxx Fri Aug 3 00:41:32 2007
@@ -118,13 +118,8 @@
}
}
}
- PTRACE(3, "Final value of Call::OnSetUp is " << ok);
- return ok;
-
- PTRACE(2, "OnSetup of connection. " << connection.GetToken());
- BOOL res = OpalCall::OnSetUp(connection);
- PTRACE(2, "finished onsetup of connection/call and it gave " << res);
- return res;
+ PTRACE(2, "finished onsetup of connection/call and it gave " << 1);
+ return TRUE;
}
BOOL MyOpalCall::OnAlerting(OpalConnection & connection)
Modified: sofaswitch/trunk/voip/mymanager.cxx
==============================================================================
--- sofaswitch/trunk/voip/mymanager.cxx (original)
+++ sofaswitch/trunk/voip/mymanager.cxx Fri Aug 3 00:41:32 2007
@@ -832,10 +832,32 @@
}
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;
+
- if (MakeConnection(*call, partyA, NULL))
- return TRUE;
-
+ CallSetupFailed:
call->Clear();
PStringStream msg;
msg << "FAILED to make a connection to connect " << partyA << " and " << partyB;
Modified: sofaswitch/trunk/voip/udpconnection.cxx
==============================================================================
--- sofaswitch/trunk/voip/udpconnection.cxx (original)
+++ sofaswitch/trunk/voip/udpconnection.cxx Fri Aug 3 00:41:32 2007
@@ -98,47 +98,42 @@
BOOL OpalUdpSsConnection::SetUpConnection()
{
- remotePartyName = ownerCall.GetOtherPartyConnection(*this)->GetRemotePartyName();
- remotePartyAddress = ownerCall.GetOtherPartyConnection(*this)->GetRemotePartyAddress();
- PString remoteApplication = ownerCall.GetOtherPartyConnection(*this)->GetRemoteApplication();
+ PSafePtr<OpalConnection> otherConn = ownerCall.GetOtherPartyConnection(*this);
+
+ if (otherConn == NULL) {
+ PTRACE(3, "UdpSsConenction\t error - other party is NULL");
+ PAssertAlways("Other Connection is NULL");
+ }
+
+ 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;
+
+ // 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();
}
return TRUE;
- }
-
- {
- PSafePtr<OpalConnection> otherConn = ownerCall.GetOtherPartyConnection(*this);
- if (otherConn == NULL)
- return FALSE;
-
- remotePartyName = otherConn->GetRemotePartyName();
- remotePartyAddress = otherConn->GetRemotePartyAddress();
- remoteApplication = otherConn->GetRemoteApplication();
- }
-
- PTRACE(3, "PCSS\tSetUpConnection(" << remotePartyName << ')');
- phase = AlertingPhase;
- endpoint.OnShowIncoming(*this);
- OnAlerting();
-
- return TRUE;
}
Modified: sofaswitch/trunk/voip/udpep.cxx
==============================================================================
--- sofaswitch/trunk/voip/udpep.cxx (original)
+++ sofaswitch/trunk/voip/udpep.cxx Fri Aug 3 00:41:32 2007
@@ -202,7 +202,7 @@
unsigned int options,
OpalConnection::StringOptions *stringOptions)
{
- return manager.OnIncomingConnection(conn, options, stringOptions);
+ return TRUE;
}
1
0
Author: derek
Date: Thu Aug 2 21:49:27 2007
New Revision: 388
Modified:
sofaswitch/trunk/voip/mymanager.cxx
sofaswitch/trunk/voip/udpep.cxx
Log:
Minor fixes to get it to compile.
Modified: sofaswitch/trunk/voip/mymanager.cxx
==============================================================================
--- sofaswitch/trunk/voip/mymanager.cxx (original)
+++ sofaswitch/trunk/voip/mymanager.cxx Thu Aug 2 21:49:27 2007
@@ -1,5 +1,5 @@
/*
- * mymanager.cxx
+ * mymanager.cxx
*
* The override of the OpalManager, which does the necessary comms with the remote conroller
*
Modified: sofaswitch/trunk/voip/udpep.cxx
==============================================================================
--- sofaswitch/trunk/voip/udpep.cxx (original)
+++ sofaswitch/trunk/voip/udpep.cxx Thu Aug 2 21:49:27 2007
@@ -194,11 +194,6 @@
{
PTRACE(3, "INCOMING CALL from remote node");
incomingConnectionToken = connection.GetToken();
-
- PTime now;
- PString remoteParty = connection.GetRemotePartyName();
-
- ((MyOpalCall &)connection.GetCall()).IncomingCall(remoteParty);
}
1
0
Author: derek
Date: Thu Aug 2 21:24:33 2007
New Revision: 387
Modified:
sofaswitch/trunk/voip/jocall.cxx
sofaswitch/trunk/voip/mymanager.cxx
sofaswitch/trunk/voip/mymanager.h
Log:
Work on getting the alerting right.
Modified: sofaswitch/trunk/voip/jocall.cxx
==============================================================================
--- sofaswitch/trunk/voip/jocall.cxx (original)
+++ sofaswitch/trunk/voip/jocall.cxx Thu Aug 2 21:24:33 2007
@@ -181,8 +181,7 @@
void MyOpalCall::IncomingCall(const PString &remoteNode)
{
PTRACE(3, "Jocal - incoming call to query the remote controller on ");
- comms.SendThisMessageTo(PString("QueryAcceptIncoming ") + remoteNode,
- manager.GetControllerId());
+
}
void MyOpalCall::AcceptThisCall(BOOL doAccept)
Modified: sofaswitch/trunk/voip/mymanager.cxx
==============================================================================
--- sofaswitch/trunk/voip/mymanager.cxx (original)
+++ sofaswitch/trunk/voip/mymanager.cxx Thu Aug 2 21:24:33 2007
@@ -437,6 +437,17 @@
}
+BOOL MyManager::OnIncomingConnection(
+ OpalConnection & connection, ///< Connection that is calling
+ unsigned options, ///< options for new connection
+ OpalConnection::StringOptions * stringOptions
+ )
+{
+ PString message = PString("QueryAcceptIncoming ") + connection.GetRemotePartyName();
+ supervisor.SendThisMessageTo(message, GetControllerId());
+ return TRUE;
+}
+
void MyManager::AcceptThisCall(const PString & uniqueCallId, BOOL doAccept)
{
PTRACE(3, "Accept this call if we can find it " << uniqueCallId);
Modified: sofaswitch/trunk/voip/mymanager.h
==============================================================================
--- sofaswitch/trunk/voip/mymanager.h (original)
+++ sofaswitch/trunk/voip/mymanager.h Thu Aug 2 21:24:33 2007
@@ -80,6 +80,20 @@
/**Where we sit, while waiting for commands & events */
void Main(PArgList & args);
+ /**Call back for answering an incoming call.
+ This function is used for an application to control the answering of
+ incoming calls.
+
+ If TRUE is returned then the connection continues. If FALSE then the
+ connection is aborted.
+
+ Note this function should not block for any length of time.
+ */
+ virtual BOOL OnIncomingConnection(
+ OpalConnection & connection, ///< Connection that is calling
+ unsigned options, ///< options for new connection
+ OpalConnection::StringOptions * stringOptions
+ );
/**A call has been established, and now is running with media in both directions */
virtual void OnEstablishedCall(
1
0
01 Aug '07
Author: derek
Date: Wed Aug 1 19:30:10 2007
New Revision: 386
Added:
sofaswitch/trunk/callflow/tests/mirrorvoip.src
Modified:
sofaswitch/trunk/callflow/tests/makevoipcall.src
Log:
Modify the Make voip call to not mirror sound to sound at the end of the
call.
Add the echo voip module, to answer an incoming voip call, and echo the
received voice back to the sending node.
Modified: sofaswitch/trunk/callflow/tests/makevoipcall.src
==============================================================================
--- sofaswitch/trunk/callflow/tests/makevoipcall.src (original)
+++ sofaswitch/trunk/callflow/tests/makevoipcall.src Wed Aug 1 19:30:10 2007
@@ -1,3 +1,3 @@
-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>9<B>120<B>198<B>120,198,120,253,359,253<special>Tool Tip<ms>Join blocks shape<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>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>2<B>360<B>272<B> extra <special>Tool Tip<ms>Suspend Processing<ms><special> <B><Shape>20<B>336<B>305<B> extra <special>Tool Tip<ms>Death<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>203<B>451<B>203,451,248,452<special>Tool Tip<ms>Join blocks shape<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>188<B>214<B>188,214,188,251,359,252<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>2<B>169<B>538<B> extra <special>Tool Tip<ms>Suspend Processing<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>166<B>171<B>166,171,166,281<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>206<B>141<B>206,141,272,141<special>Tool Tip<ms>Join blocks shape<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>2<B>244<B>139<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>2<ms><special>Timer label (Python code)<ms>self.myId + "thistimer"<ms><special>Python variable: Timer expire info<ms><ms><special> <B><Shape>1<B>88<B>9<B> extra <special>Tool Tip<ms>Start Processing<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>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>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>9<B>166<B>479<B>166,479<special>Tool Tip<ms>Join blocks shape<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>9<B>139<B>116<B>139,116,181,121<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>2<B>211<B>306<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>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>99<B>146<B>99,146,101,269,166,281<special>Tool Tip<ms>Join blocks shape<ms><special> <B><Shape>20<B>229<B>740<B> extra <special>Tool Tip<ms>Death<ms><special> <B><Shape>2<B>258<B>468<B> extra <special>Tool Tip<ms>Suspend Processing<ms><special> <B><Shape>2<B>291<B>710<B> extra <special>Tool Tip<ms>Suspend 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>15<B>226<B>601<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>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>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>
+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>
Added: sofaswitch/trunk/callflow/tests/mirrorvoip.src
==============================================================================
--- (empty file)
+++ sofaswitch/trunk/callflow/tests/mirrorvoip.src Wed Aug 1 19:30:10 2007
@@ -0,0 +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>
1
0