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 2006
- 3 participants
- 13 discussions
Author: derek
Date: Tue Aug 15 01:08:05 2006
New Revision: 67
Modified:
sofaswitch/trunk/voip/Makefile
sofaswitch/trunk/voip/comms.cxx
sofaswitch/trunk/voip/counts.cxx
sofaswitch/trunk/voip/counts.h
sofaswitch/trunk/voip/jocall.cxx
sofaswitch/trunk/voip/mymanager.cxx
sofaswitch/trunk/voip/mymanager.h
sofaswitch/trunk/voip/overview.cxx
sofaswitch/trunk/voip/udpconnection.cxx
sofaswitch/trunk/voip/udpep.cxx
sofaswitch/trunk/voip/udpep.h
sofaswitch/trunk/voip/udpsound.cxx
Log:
Excise unused Endpoint class.
Remove counts for this unused class.
Modified: sofaswitch/trunk/voip/Makefile
==============================================================================
--- sofaswitch/trunk/voip/Makefile (original)
+++ sofaswitch/trunk/voip/Makefile Tue Aug 15 01:08:05 2006
@@ -36,12 +36,12 @@
jocall.cxx \
main.cxx \
mymanager.cxx \
- myudpep.cxx \
supervisor.cxx \
udpconnection.cxx \
udpep.cxx \
udpsound.cxx
+# myudpep.cxx \
ifneq (,$(findstring x86_64, $(MACHTYPE)))
Modified: sofaswitch/trunk/voip/comms.cxx
==============================================================================
--- sofaswitch/trunk/voip/comms.cxx (original)
+++ sofaswitch/trunk/voip/comms.cxx Tue Aug 15 01:08:05 2006
@@ -44,7 +44,7 @@
{
IncComms();
myOpalCall = NULL;
- PTRACE(3, "Construct a Comms structrue ");
+ PTRACE(3, "Construct a Comms structure ");
}
Comms::~Comms()
Modified: sofaswitch/trunk/voip/counts.cxx
==============================================================================
--- sofaswitch/trunk/voip/counts.cxx (original)
+++ sofaswitch/trunk/voip/counts.cxx Tue Aug 15 01:08:05 2006
@@ -36,35 +36,22 @@
/////////////////////////////////////////////////////////////////////////////
-PAtomicInteger countAudioDelay;
PAtomicInteger countComms;
PAtomicInteger countMyManager;
PAtomicInteger countMyOpalCall;
-PAtomicInteger countMyUdpSsEndPoint;
PAtomicInteger countOpalUdpSsConnection;
PAtomicInteger countOpalUdpSsEndPoint;
PAtomicInteger countSupervisor;
PAtomicInteger countUdpSoundChannel;
-PAtomicInteger countDelAudioDelay;
PAtomicInteger countDelComms;
PAtomicInteger countDelMyManager;
PAtomicInteger countDelMyOpalCall;
-PAtomicInteger countDelMyUdpSsEndPoint;
PAtomicInteger countDelOpalUdpSsConnection;
PAtomicInteger countDelOpalUdpSsEndPoint;
PAtomicInteger countDelSupervisor;
PAtomicInteger countDelUdpSoundChannel;
-PString GetCountAudioDelay()
-{
- PStringStream msg;
- msg << ::setw(6) << PString(countAudioDelay)
- << ::setw(6) << PString(countDelAudioDelay)
- << ::setw(6) << PString(countAudioDelay - countDelAudioDelay) << ::setw(0);
- return msg;
-}
-
PString GetCountComms()
{
PStringStream msg;
@@ -92,15 +79,6 @@
return msg;
}
-PString GetCountMyUdpSsEndPoint()
-{
- PStringStream msg;
- msg << ::setw(6) << PString(countMyUdpSsEndPoint)
- << ::setw(6) << PString(countDelMyUdpSsEndPoint)
- << ::setw(6) << PString(countMyUdpSsEndPoint - countDelMyUdpSsEndPoint) << ::setw(0);
- return msg;
-}
-
PString GetCountOpalUdpSsConnection()
{
PStringStream msg;
@@ -133,29 +111,31 @@
PStringStream msg;
msg << ::setw(6) << PString(countUdpSoundChannel)
<< ::setw(6) << PString(countDelUdpSoundChannel)
- << ::setw(6) << PString(countUdpSoundChannel - countDelUdpSoundChannel) << ::setw(0);
+ << ::setw(6) << PString(countUdpSoundChannel - countDelUdpSoundChannel)
+ << ::setw(0);
+ PTRACE(1, "Get count udp sound channel " << msg);
return msg;
}
-void DecAudioDelay() { ++countDelAudioDelay; }
void DecComms() { ++countDelComms; }
void DecMyManager() { ++countDelMyManager; }
void DecMyOpalCall() { ++countDelMyOpalCall; }
-void DecMyUdpSsEndPoint() { ++countDelMyUdpSsEndPoint; }
void DecOpalUdpSsConnection() { ++countDelOpalUdpSsConnection; }
void DecOpalUdpSsEndPoint() { ++countDelOpalUdpSsEndPoint; }
void DecSupervisor() { ++countDelSupervisor; }
void DecUdpSoundChannel() { ++countDelUdpSoundChannel; }
-void IncAudioDelay() { ++countAudioDelay; }
void IncComms() { ++countComms; }
void IncMyManager() { ++countMyManager; }
void IncMyOpalCall() { ++countMyOpalCall; }
-void IncMyUdpSsEndPoint() { ++countMyUdpSsEndPoint; }
void IncOpalUdpSsConnection() { ++countOpalUdpSsConnection; }
void IncOpalUdpSsEndPoint() { ++countOpalUdpSsEndPoint; }
void IncSupervisor() { ++countSupervisor; }
-void IncUdpSoundChannel() { ++countUdpSoundChannel; }
+void IncUdpSoundChannel()
+{
+ PTRACE(1, "Inc count udp sound channel");
+ ++countUdpSoundChannel;
+}
Modified: sofaswitch/trunk/voip/counts.h
==============================================================================
--- sofaswitch/trunk/voip/counts.h (original)
+++ sofaswitch/trunk/voip/counts.h Tue Aug 15 01:08:05 2006
@@ -55,10 +55,6 @@
void IncMyOpalCall();
PString GetCountMyOpalCall();
-void DecMyUdpSsEndPoint();
-void IncMyUdpSsEndPoint();
-PString GetCountMyUdpSsEndPoint();
-
void DecOpalUdpSsConnection();
void IncOpalUdpSsConnection();
PString GetCountOpalUdpSsConnection();
Modified: sofaswitch/trunk/voip/jocall.cxx
==============================================================================
--- sofaswitch/trunk/voip/jocall.cxx (original)
+++ sofaswitch/trunk/voip/jocall.cxx Tue Aug 15 01:08:05 2006
@@ -41,11 +41,11 @@
#include <opal/call.h>
-#include "jocall.h"
#include "comms.h"
-#include "udpconnection.h"
-#include "mymanager.h"
#include "counts.h"
+#include "jocall.h"
+#include "mymanager.h"
+#include "udpconnection.h"
#define new PNEW
Modified: sofaswitch/trunk/voip/mymanager.cxx
==============================================================================
--- sofaswitch/trunk/voip/mymanager.cxx (original)
+++ sofaswitch/trunk/voip/mymanager.cxx Tue Aug 15 01:08:05 2006
@@ -73,8 +73,9 @@
#include "comms.h"
#include "jocall.h"
#include "mymanager.h"
-#include "myudpep.h"
#include "supervisor.h"
+#include "udpep.h"
+
#define new PNEW
///////////////////////////////////////////////////////////////
@@ -236,7 +237,7 @@
///////////////////////////////////////
// Create UDP Sound System handler
- udpssEP = new MyUdpSsEndPoint(*this);
+ udpssEP = new OpalUdpSsEndPoint(*this);
#if OPAL_H323
@@ -489,16 +490,12 @@
<< PString(deadComms.GetSize()) << endl;
status << "--------------" << endl;
- status << " AudioDelay count is "
- << GetCountAudioDelay() << endl;
status << " Comms count is "
<< GetCountComms() << endl;
status << " MyManager count is "
<< GetCountMyManager() << endl;
status << " MyOpalCall count is "
<< GetCountMyOpalCall() << endl;
- status << " MyUdpSsEndPoint count is "
- << GetCountMyUdpSsEndPoint() << endl;
status << " OpalUdpSsConnection count is "
<< GetCountOpalUdpSsConnection() << endl;
status << " OpalUdpSsEndPoint count is "
Modified: sofaswitch/trunk/voip/mymanager.h
==============================================================================
--- sofaswitch/trunk/voip/mymanager.h (original)
+++ sofaswitch/trunk/voip/mymanager.h Tue Aug 15 01:08:05 2006
@@ -44,10 +44,10 @@
class H323EndPoint;
class IAX2EndPoint;
-class MyUdpSsEndPoint;
+class LaunchNewId;
+class OpalUdpSsEndPoint;
class SIPEndPoint;
class Supervisor;
-class LaunchNewId;
////////////////////////////////////////////////////////////////////////////////
@@ -233,7 +233,7 @@
/**The sound system endpoint that we use to control talk to the
remote sofa switch nodes */
- MyUdpSsEndPoint * udpssEP;
+ OpalUdpSsEndPoint * udpssEP;
#if OPAL_H323
/**The H323 endpoint that is used for controlling h323 calls */
Modified: sofaswitch/trunk/voip/overview.cxx
==============================================================================
--- sofaswitch/trunk/voip/overview.cxx (original)
+++ sofaswitch/trunk/voip/overview.cxx Tue Aug 15 01:08:05 2006
@@ -79,15 +79,14 @@
\subsection subsecKeyClasses The following classes are used in ssvoip
+\li AudioDelay - An adaptive delay thread
\li Comms - Does the comms with the remote controller
-\li MyOpalCall - Descendent of OpalCall
-\li VoipProcess - The master class, which contains main(int argc, char** argv)
\li MyManager - Does the work of controlling things
-\li MyUdpSsEndPoint - manages the creation & handling of MyUdpSsConnections
-\li Supervisor - The comms instance for the manager
+\li MyOpalCall - Descendent of OpalCall
\li OpalUdpSsConnection - Connection that does the actual handling of UDP based sound for one call
\li OpalUdpSsEndPoint - manages the creation & handling of MyUdpSsConnections
-\li AudioDelay - An adaptive delay thread
+\li Supervisor - The comms instance for the manager
\li UdpSoundChannel - Descendant of PSoundChannel, which does the work of putting the audio on/off the UDP socket
+\li VoipProcess - The master class, which contains main(int argc, char** argv)
*/
Modified: sofaswitch/trunk/voip/udpconnection.cxx
==============================================================================
--- sofaswitch/trunk/voip/udpconnection.cxx (original)
+++ sofaswitch/trunk/voip/udpconnection.cxx Tue Aug 15 01:08:05 2006
@@ -134,7 +134,8 @@
PString OpalUdpSsConnection::GetDestinationAddress()
{
- return endpoint.OnGetDestination(*this);
+ PTRACE(3, "Now call GetDestinationAddress");
+ return endpoint.OnGetDestination(*this);
}
@@ -151,9 +152,10 @@
}
-OpalMediaStream * OpalUdpSsConnection::CreateMediaStream(const OpalMediaFormat & mediaFormat,
- unsigned sessionID,
- BOOL isSource)
+OpalMediaStream * OpalUdpSsConnection::CreateMediaStream(
+ const OpalMediaFormat & mediaFormat,
+ unsigned sessionID,
+ BOOL isSource)
{
if (sessionID != OpalMediaFormat::DefaultAudioSessionID)
return OpalConnection::CreateMediaStream(mediaFormat, sessionID, isSource);
@@ -169,41 +171,45 @@
BOOL OpalUdpSsConnection::OnOpenMediaStream(OpalMediaStream & mediaStream)
{
- if (!OpalConnection::OnOpenMediaStream(mediaStream))
- return FALSE;
-
- if (mediaStream.IsSource()) {
- OpalMediaPatch * patch = mediaStream.GetPatch();
- if (patch != NULL && mediaStream.GetSessionID() == OpalMediaFormat::DefaultAudioSessionID) {
- silenceDetector->SetParameters(endpoint.GetManager().GetSilenceDetectParams());
- patch->AddFilter(silenceDetector->GetReceiveHandler(), OpalPCM16);
+ PTRACE(3, "OnOpenMediaStream for " << mediaStream);
+ if (!OpalConnection::OnOpenMediaStream(mediaStream))
+ return FALSE;
+
+ if (mediaStream.IsSource()) {
+ OpalMediaPatch * patch = mediaStream.GetPatch();
+ if (patch != NULL &&
+ (mediaStream.GetSessionID() == OpalMediaFormat::DefaultAudioSessionID)) {
+ silenceDetector->SetParameters(endpoint.GetManager().GetSilenceDetectParams());
+ patch->AddFilter(silenceDetector->GetReceiveHandler(), OpalPCM16);
+ }
}
- }
-
- return TRUE;
+
+ return TRUE;
}
PSoundChannel * OpalUdpSsConnection::CreateSoundChannel(BOOL isSource)
{
- UdpSoundChannel * soundChannel =
- new UdpSoundChannel((MyOpalCall &)(GetCall()), isSource);
+ PTRACE(1, "Create UDP Sound Channel ");
- PString deviceName("udpsound");
-
- if (soundChannel->Open(deviceName,
- isSource ? PSoundChannel::Recorder
- : PSoundChannel::Player)) {
- PTRACE(3, "UdpSs\tOpened sound channel for " << (isSource ? "record" : "play") << "ing.");
-
- return soundChannel;
- }
-
- PTRACE(1, "UdpSs\tCould not open sound channel for " << (isSource ? "record" : "play")
- << "ing: ");
-
- delete soundChannel;
- return NULL;
+ UdpSoundChannel * soundChannel =
+ new UdpSoundChannel((MyOpalCall &)(GetCall()), isSource);
+
+ PString deviceName("udpsound");
+
+ if (soundChannel->Open(deviceName,
+ isSource ? PSoundChannel::Recorder : PSoundChannel::Player)) {
+ PTRACE(3, "UdpSs\tOpened sound channel for " << (isSource ? "record" : "play")
+ << "ing.");
+
+ return soundChannel;
+ }
+
+ PTRACE(1, "UdpSs\tCould not open sound channel for " << (isSource ? "record" : "play")
+ << "ing: ");
+
+ delete soundChannel;
+ return NULL;
}
Modified: sofaswitch/trunk/voip/udpep.cxx
==============================================================================
--- sofaswitch/trunk/voip/udpep.cxx (original)
+++ sofaswitch/trunk/voip/udpep.cxx Tue Aug 15 01:08:05 2006
@@ -44,13 +44,12 @@
#include <opal/patch.h>
#include <opal/manager.h>
-
-#include "udpep.h"
-#include "udpconnection.h"
#include "counts.h"
+#include "jocall.h"
+#include "udpconnection.h"
+#include "udpep.h"
#include "udpsound.h"
-
#define new PNEW
/////////////////////////////////////////////////////////////////////////////
@@ -107,7 +106,25 @@
return TRUE;
}
+PString OpalUdpSsEndPoint::OnGetDestination(const OpalUdpSsConnection & /*connection*/)
+{
+ PTRACE(1, "OnGetDestination " << destinationAddress);
+ PString destination;
+
+ if (destinationAddress.IsEmpty()) {
+ cout << "Enter destination address? " << flush;
+ cin >> destination;
+ }
+ else {
+ destination = destinationAddress;
+ destinationAddress = PString();
+ }
+
+ return destination;
+}
+
+
OpalMediaFormatList OpalUdpSsEndPoint::GetMediaFormats() const
{
OpalMediaFormatList formats;
@@ -124,7 +141,8 @@
void * /*userData*/,
const PString & newToken)
{
- return new OpalUdpSsConnection(call, *this, newToken);
+ PTRACE(1, "Create opalUdpSsConnection");
+ return new OpalUdpSsConnection(call, *this, newToken);
}
@@ -148,5 +166,27 @@
{
return PSafePtrCast<OpalConnection, OpalUdpSsConnection>(GetConnectionWithLock(token, mode));
}
+
+
+void OpalUdpSsEndPoint::OnShowIncoming(const OpalUdpSsConnection & connection)
+{
+ PTRACE(3, "INCOMING CALL from remote node");
+ incomingConnectionToken = connection.GetToken();
+
+ PTime now;
+ PString remoteParty = connection.GetRemotePartyName();
+
+ ((MyOpalCall &)connection.GetCall()).IncomingCall(remoteParty);
+}
+
+
+BOOL OpalUdpSsEndPoint::OnShowOutgoing(const OpalUdpSsConnection & connection)
+{
+ //PTime now;
+ //cout << connection.GetRemotePartyName() << " is ringing on "
+ // << now.AsString("w h:mma") << " ..." << endl;
+ return TRUE;
+}
+
//////////////////////////END Of FILE/////////////////////////////////////
Modified: sofaswitch/trunk/voip/udpep.h
==============================================================================
--- sofaswitch/trunk/voip/udpep.h (original)
+++ sofaswitch/trunk/voip/udpep.h Tue Aug 15 01:08:05 2006
@@ -149,7 +149,7 @@
*/
virtual PString OnGetDestination(
const OpalUdpSsConnection & connection /// Connection having event
- ) = 0;
+ );
/**Call back to indicate that remote is ringing.
If FALSE is returned the call is aborted.
@@ -158,7 +158,7 @@
*/
virtual void OnShowIncoming(
const OpalUdpSsConnection & connection /// Connection having event
- ) = 0;
+ );
/**Accept the incoming connection.
*/
@@ -173,7 +173,7 @@
*/
virtual BOOL OnShowOutgoing(
const OpalUdpSsConnection & connection /// Connection having event
- ) = 0;
+ );
/**Call back to indicate that the remote user has indicated something.
If FALSE is returned the call is aborted.
@@ -197,6 +197,12 @@
/**Counter, which is used to create unique UDP connection tokens*/
PAtomicInteger connectionTokenIndex;
+
+ /**Identifying token of the other connection in this call */
+ PString incomingConnectionToken;
+
+ /**the remote node we are talking to */
+ PString destinationAddress;
};
#endif // __OPAL_UDPEP_H
Modified: sofaswitch/trunk/voip/udpsound.cxx
==============================================================================
--- sofaswitch/trunk/voip/udpsound.cxx (original)
+++ sofaswitch/trunk/voip/udpsound.cxx Tue Aug 15 01:08:05 2006
@@ -222,14 +222,12 @@
AudioDelay::AudioDelay()
{
- IncAudioDelay();
firstTime = TRUE;
error = 0;
}
AudioDelay::~AudioDelay()
{
- DecAudioDelay();
}
void AudioDelay::Restart()
1
0
Author: derek
Date: Sun Aug 13 21:43:50 2006
New Revision: 66
Modified:
sofaswitch/trunk/controller/basecall.py
sofaswitch/trunk/controller/testmcu.py
sofaswitch/trunk/controller/testmcu3.py
sofaswitch/trunk/controller/testmcu3_time.py
sofaswitch/trunk/controller/testmcu3a.py
sofaswitch/trunk/controller/testmcu3b.py
sofaswitch/trunk/controller/testmcurec.py
sofaswitch/trunk/controller/testonemcu.py
sofaswitch/trunk/controller/testonevoip.py
sofaswitch/trunk/controller/testsound.py
Log:
Finish changover, to remove the ss prefix to sofaswitch component names.
Modified: sofaswitch/trunk/controller/basecall.py
==============================================================================
--- sofaswitch/trunk/controller/basecall.py (original)
+++ sofaswitch/trunk/controller/basecall.py Sun Aug 13 21:43:50 2006
@@ -227,7 +227,7 @@
def send_id_request_to(self, fromNode):
''' send a REQUESTNEWID message to the remote node The remote
- node could be just the name (like ssam) or it could be for a
+ node could be just the name (like am) or it could be for a
new id, with an additional arguement. Like, we want to ask
for a newid in room xxx of the mcu.
'''
@@ -391,13 +391,13 @@
self.incomingNode = rn
self.waited = time.time()
- print 'request new id of ssam'
- self.amNode = self.request_new_id('ssam', 2.0)
+ print 'request new id of am'
+ self.amNode = self.request_new_id('am', 2.0)
self.test = None
if self.amNode == self.test:
print 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
- print ' The remote node of ssam did not tell us a new node we can talk with'
+ print ' The remote node of am did not tell us a new node we can talk with'
self.send_message_to('answer false', self.incomingNode)
self.send_message_to('hangup', self.incomingNode)
return False
@@ -424,7 +424,7 @@
return
- def make_call_to(self, remote_node, localNode='ssam'):
+ def make_call_to(self, remote_node, localNode='am'):
""" make a voip call to some node. When we receive a callestablished message, or a
terminating message, return.
The return value is either True (call worked) or False (call Failed)
Modified: sofaswitch/trunk/controller/testmcu.py
==============================================================================
--- sofaswitch/trunk/controller/testmcu.py (original)
+++ sofaswitch/trunk/controller/testmcu.py Sun Aug 13 21:43:50 2006
@@ -22,8 +22,8 @@
counter = 0
-node1 = "ssmcu room"
-node2 = "ssam"
+node1 = "mcu room"
+node2 = "am"
soughtNodes = [node1, node2]
for i in range(0, 100):
Modified: sofaswitch/trunk/controller/testmcu3.py
==============================================================================
--- sofaswitch/trunk/controller/testmcu3.py (original)
+++ sofaswitch/trunk/controller/testmcu3.py Sun Aug 13 21:43:50 2006
@@ -38,8 +38,8 @@
Reads audio from sendFile,and puts that to the conference
"""
- self.oNode1 = "ssmcu room"
- self.oNode2 = "ssam"
+ self.oNode1 = "mcu room"
+ self.oNode2 = "am"
self.myRxFile = rxFile
self.mySendFile = sendFile
self.myController = cont
@@ -97,7 +97,7 @@
memberE = OneMember("membereRecord.wav", "../prompts/sample_message.wav", controller)
thread.start_new_thread(memberE.play_file_x_times, (10,))
-mcuNode = controller.request_new_id("ssmcu room", 2)
+mcuNode = controller.request_new_id("mcu room", 2)
if mcuNode == None:
print 'failed to get mcu node for ssmcu room'
controller.terminate_now()
Modified: sofaswitch/trunk/controller/testmcu3_time.py
==============================================================================
--- sofaswitch/trunk/controller/testmcu3_time.py (original)
+++ sofaswitch/trunk/controller/testmcu3_time.py Sun Aug 13 21:43:50 2006
@@ -38,8 +38,8 @@
Reads audio from sendFile,and puts that to the conference
"""
- self.oNode1 = "ssmcu room"
- self.oNode2 = "ssam"
+ self.oNode1 = "mcu room"
+ self.oNode2 = "am"
self.mySendFile = sendFile
self.myController = cont
self.soughtNodes = [self.oNode1, self.oNode2]
Modified: sofaswitch/trunk/controller/testmcu3a.py
==============================================================================
--- sofaswitch/trunk/controller/testmcu3a.py (original)
+++ sofaswitch/trunk/controller/testmcu3a.py Sun Aug 13 21:43:50 2006
@@ -38,8 +38,8 @@
Reads audio from sendFile,and puts that to the conference
"""
- self.oNode1 = "ssmcu room"
- self.oNode2 = "ssam"
+ self.oNode1 = "mcu room"
+ self.oNode2 = "am"
self.mySendFile = sendFile
self.myController = cont
self.soughtNodes = [self.oNode1, self.oNode2]
Modified: sofaswitch/trunk/controller/testmcu3b.py
==============================================================================
--- sofaswitch/trunk/controller/testmcu3b.py (original)
+++ sofaswitch/trunk/controller/testmcu3b.py Sun Aug 13 21:43:50 2006
@@ -38,8 +38,8 @@
Reads audio from sendFile,and puts that to the conference
"""
- self.oNode1 = "ssmcu room"
- self.oNode2 = "ssam"
+ self.oNode1 = "mcu room"
+ self.oNode2 = "am"
self.mySendFile = sendFile
self.myController = cont
self.soughtNodes = [self.oNode1, self.oNode2]
Modified: sofaswitch/trunk/controller/testmcurec.py
==============================================================================
--- sofaswitch/trunk/controller/testmcurec.py (original)
+++ sofaswitch/trunk/controller/testmcurec.py Sun Aug 13 21:43:50 2006
@@ -37,8 +37,8 @@
Reads audio from sendFile,and puts that to the conference
"""
- self.oNode1 = "ssmcu room"
- self.oNode2 = "ssam"
+ self.oNode1 = "mcu room"
+ self.oNode2 = "am"
self.mySendFile = sendFile
self.myController = cont
self.soughtNodes = [self.oNode1, self.oNode2]
Modified: sofaswitch/trunk/controller/testonemcu.py
==============================================================================
--- sofaswitch/trunk/controller/testonemcu.py (original)
+++ sofaswitch/trunk/controller/testonemcu.py Sun Aug 13 21:43:50 2006
@@ -34,7 +34,7 @@
controller.connect_socket_start_threads()
# print 'now start a call pair on iteration ', i
- mcuNode = controller.request_new_id("ssmcu room", 2)
+ mcuNode = controller.request_new_id("mcu room", 2)
if mcuNode == None:
print 'mcu node is null - exit'
Modified: sofaswitch/trunk/controller/testonevoip.py
==============================================================================
--- sofaswitch/trunk/controller/testonevoip.py (original)
+++ sofaswitch/trunk/controller/testonevoip.py Sun Aug 13 21:43:50 2006
@@ -64,7 +64,7 @@
controller.connect_socket_start_threads()
# print 'now start a call pair on iteration ', i
- voipNode = controller.request_new_id("ssvoip", 2)
+ voipNode = controller.request_new_id("voip", 2)
if voipNode == None:
print 'voip node is null - exit'
Modified: sofaswitch/trunk/controller/testsound.py
==============================================================================
--- sofaswitch/trunk/controller/testsound.py (original)
+++ sofaswitch/trunk/controller/testsound.py Sun Aug 13 21:43:50 2006
@@ -24,7 +24,7 @@
for i in calls:
print 'Iteration ', i
- amNode = controller.request_new_id("ssam", 2)
+ amNode = controller.request_new_id("am", 2)
controller.send_message_to('transferudp sound', amNode)
1
0
[Sofaswitch-svn] [commit] r65 - in sofaswitch/trunk: . controller server
by SofaSWITCH SVN 14 Aug '06
by SofaSWITCH SVN 14 Aug '06
14 Aug '06
Author: derek
Date: Sun Aug 13 21:22:15 2006
New Revision: 65
Modified:
sofaswitch/trunk/Makefile
sofaswitch/trunk/controller/testoneam.py
sofaswitch/trunk/controller/testserver.py
sofaswitch/trunk/server/main.cxx
sofaswitch/trunk/server/main.h
Log:
Minor tidyups.
Modified: sofaswitch/trunk/Makefile
==============================================================================
--- sofaswitch/trunk/Makefile (original)
+++ sofaswitch/trunk/Makefile Sun Aug 13 21:22:15 2006
@@ -36,6 +36,14 @@
@cd server ; make both
@cd sound ; make both
+all2:
+ @cd sofa ; make -j 2 both
+ @cd am ; make -j 2 both
+ @cd voip ; make -j 2 both
+ @cd mcu ; make -j 2 both
+ @cd server ; make -j 2 both
+ @cd sound ; make -j 2 both
+
doc:
Modified: sofaswitch/trunk/controller/testoneam.py
==============================================================================
--- sofaswitch/trunk/controller/testoneam.py (original)
+++ sofaswitch/trunk/controller/testoneam.py Sun Aug 13 21:22:15 2006
@@ -23,7 +23,7 @@
## each iteration is done in a new fork.
expstart = time.time()
-maxcalls = 200
+maxcalls = 20
calls = range(maxcalls)
for i in calls:
@@ -34,7 +34,7 @@
controller.connect_socket_start_threads()
# print 'now start a call pair on iteration ', i
- am1Node = controller.request_new_id("ssam", 2)
+ am1Node = controller.request_new_id("am", 2)
if am1Node == None:
print 'am 1 node is null - exit'
Modified: sofaswitch/trunk/controller/testserver.py
==============================================================================
--- sofaswitch/trunk/controller/testserver.py (original)
+++ sofaswitch/trunk/controller/testserver.py Sun Aug 13 21:22:15 2006
@@ -20,7 +20,7 @@
controller.LaunchGetUniqueIds()
-numMessages = 10000
+numMessages = 100
## We get five instances of nodes, controller, cont1, cont2, cont3, and cont4
@@ -50,7 +50,7 @@
for k in range(numMessages):
for f in others:
controller.send_message_to('hello from ' + controller.myId, f)
- time.sleep(r.randint(2,100)/1000)
+ time.sleep(r.randint(100,1000)/1000)
print 'END of me'
time.sleep(1)
Modified: sofaswitch/trunk/server/main.cxx
==============================================================================
--- sofaswitch/trunk/server/main.cxx (original)
+++ sofaswitch/trunk/server/main.cxx Sun Aug 13 21:22:15 2006
@@ -131,16 +131,16 @@
Manager::Manager()
{
- connectionCount = 0;
- bogusCount= 0;
- keepRunning = TRUE;
- connectionsActive.SetAutoDeleteObjects();
- isQuitting = FALSE;
+ connectionCount = 0;
+ bogusCount= 0;
+ keepRunning = TRUE;
+ connectionsActive.SetAutoDeleteObjects();
+ isQuitting = FALSE;
}
Manager::~Manager()
{
- PTRACE(3, "Manager\tDestructor");
+ PTRACE(3, "Manager\tDestructor");
}
void Manager::WaitForEmpty()
Modified: sofaswitch/trunk/server/main.h
==============================================================================
--- sofaswitch/trunk/server/main.h (original)
+++ sofaswitch/trunk/server/main.h Sun Aug 13 21:22:15 2006
@@ -358,6 +358,7 @@
the object to be deleted from the list. We simply need to
delete it. */
virtual void DeleteObject(PObject * object) const;
+
} connectionsActive;
#ifdef DOC_PLUS_PLUS
1
0
Author: derek
Date: Thu Aug 10 00:49:29 2006
New Revision: 64
Modified:
sofaswitch/trunk/callflow/callflow.cpp
sofaswitch/trunk/callflow/dnd.cpp
Log:
Remove message about icon file name from taskbar on startup.
Resize the connection circles to radius 2 (from 5).
Modified: sofaswitch/trunk/callflow/callflow.cpp
==============================================================================
--- sofaswitch/trunk/callflow/callflow.cpp (original)
+++ sofaswitch/trunk/callflow/callflow.cpp Thu Aug 10 00:49:29 2006
@@ -99,17 +99,12 @@
::wxInitAllImageHandlers();
wxIcon myIcon ;
wxString sFile = wxString ( argv[0] ).BeforeLast (wxFILE_SEP_PATH) + (wxFILE_SEP_PATH) + wxT("callflow.ico");
- frame->SetStatusText(sFile);
- if ( !wxFileExists ( sFile ))
- {
+ if ( !wxFileExists ( sFile )) {
sFile = wxGetInstallPrefix() ;
sFile = sFile + wxT( "callflow.ico" ) ;
- frame->SetStatusText(sFile);
}
- if ( wxFileExists ( sFile ))
- {
- frame->SetStatusText(sFile);
+ if ( wxFileExists ( sFile )) {
myIcon.CopyFromBitmap(wxBitmap(wxImage(sFile)));
frame->SetIcon(myIcon);
}
Modified: sofaswitch/trunk/callflow/dnd.cpp
==============================================================================
--- sofaswitch/trunk/callflow/dnd.cpp (original)
+++ sofaswitch/trunk/callflow/dnd.cpp Thu Aug 10 00:49:29 2006
@@ -623,7 +623,7 @@
ioPointsLinked = false;
if (style == Connected)
- dc.DrawCircle(locn, 5);
+ dc.DrawCircle(locn, 2);
}
void DndShape::DrawBox(wxDC &dc, int xOff, int yOff, int width, int height)
1
0
Author: mjerris
Date: Thu Aug 10 00:37:26 2006
New Revision: 63
Modified:
sofaswitch/trunk/sofa/src/messages.cxx
Log:
Compile changes for msvc 2005.
Modified: sofaswitch/trunk/sofa/src/messages.cxx
==============================================================================
--- sofaswitch/trunk/sofa/src/messages.cxx (original)
+++ sofaswitch/trunk/sofa/src/messages.cxx Thu Aug 10 00:37:26 2006
@@ -248,6 +248,7 @@
}
}
+#ifdef TCP_KEEPIDLE
if (!messagesSocket.SetOption(TCP_KEEPIDLE, 10, IPPROTO_TCP)) {
PTRACE(1, "SetOption(TCP_KEEPIDLE 2) failed: " << messagesSocket.GetErrorText());
if (!keepGoing) {
@@ -255,7 +256,9 @@
return;
}
}
+#endif
+#ifdef TCP_KEEPCNT
if (!messagesSocket.SetOption(TCP_KEEPCNT, 2, IPPROTO_TCP)) {
PTRACE(1, "SetOption(TCP_KEEPCNT 2) failed: " << messagesSocket.GetErrorText());
if (!keepGoing) {
@@ -263,7 +266,9 @@
return;
}
}
+#endif
+#ifdef TCP_KEEPINTVL
if (!messagesSocket.SetOption(TCP_KEEPINTVL, 10, IPPROTO_TCP)) {
PTRACE(1, "SetOption(TCP_KEEPINTVL 2) failed: " << messagesSocket.GetErrorText());
if (!keepGoing) {
@@ -271,6 +276,7 @@
return;
}
}
+#endif
messagesSocket.SetReadTimeout(PMaxTimeInterval);
@@ -312,7 +318,7 @@
PINDEX maxm = 2000;
PBYTEArray data(maxm);
- PINDEX consecutiveReadNulls = 10;
+#define consecutiveReadNulls 10
PINDEX readSize[consecutiveReadNulls];
PINDEX readIndex = 0;
PINDEX ir;
1
0
Author: derek
Date: Thu Aug 10 00:34:04 2006
New Revision: 62
Modified:
sofaswitch/trunk/server/main.cxx
sofaswitch/trunk/server/main.h
Log:
Split up a long long method into two "longish" methods.
Makes it much more readable as to what is going on.
Modified: sofaswitch/trunk/server/main.cxx
==============================================================================
--- sofaswitch/trunk/server/main.cxx (original)
+++ sofaswitch/trunk/server/main.cxx Thu Aug 10 00:34:04 2006
@@ -703,12 +703,51 @@
cerr << msg;
}
+ if (ProcessedAsServerCommand(txt))
+ return;
+ PTRACE(1, "READ \"" << txt << "\" of size " << txt.GetSize());
+ PINDEX l = txt.Find(':');
+ if (l == P_MAX_INDEX) {
+ PTRACE(3, "Could not find a colon in \"" << txt << "\", of size " << txt.GetLength());
+ return;
+ }
+ PString dest = txt.Left(l).Trim();
+ PString msg = txt.Mid(l + 1).Trim();
+
+ PTRACE(3, "Read in " << dest << "--:--" << msg);
+ // PTRACE(0, ::setw(32) << sourceId << " " <<txt );
+ PBYTEArray outMessage;
+ outMessage.SetSize(sourceId.GetLength() + 1 + msg.GetLength() + 1);
+ memcpy(outMessage.GetPointer(), sourceId.GetPointer(), sourceId.GetLength());
+ outMessage[sourceId.GetLength()] = ':';
+ memcpy(outMessage.GetPointer() + sourceId.GetLength() + 1, msg.GetPointer(), msg.GetLength());
+ outMessage[outMessage.GetSize() - 1] = 0;
+ // cerr << " Send " << PTime().AsString("hh:mm.ss.uuu") << " "
+ // << sourceId << ":" << msg << endl << endl;
+ PSafePtr <TcpConnection> conn = manager.GetConnectionWithLock(dest, PSafeReadOnly);
+ if (conn != NULL) {
+ PTRACE(3, "Found connection for id of " << dest);
+ conn->SendThisMessage(outMessage);
+ } else {
+ PTRACE(1, "Fail to send the message "
+ << PString((const char *)outMessage.GetPointer(), outMessage.GetSize())
+ << " to " << dest);
+ PTRACE(1, " as could not get a lock");
+ PTRACE(1, sourceId << " is sorry");
+ IncCountDropped();
+ }
+
+ return;
+}
+
+BOOL TcpConnection::ProcessedAsServerCommand(const PString & txt)
+{
if (txt *= PString("quitnow")) {
PTRACE(3, "QUIT now as have read in the command \"" << txt << "\"");
messagesSocket.Close();
manager.QuitNow();
- return;
+ return TRUE;
}
if (txt.Left(6) *= PString("WhoAmI")){
@@ -717,13 +756,13 @@
memcpy(answer.GetPointer(), sourceId.GetPointer(), sourceId.GetLength());
answer[sourceId.GetLength()] = 0;
SendThisMessage(answer);
- return;
+ return TRUE;
}
if (txt.Left(19) *= PString("AdviseOnTermination")) {
PStringArray msg = txt.Tokenise(" ");
adviseOnTermination = msg[1];
- return;
+ return TRUE;
}
if (txt.Left(6) *= PString("status")) {
@@ -741,7 +780,7 @@
memcpy(answer.GetPointer(), msg.GetPointer(), msg.GetLength());
answer[msg.GetLength()] = 0;
SendThisMessage(answer);
- return;
+ return TRUE;
}
#ifdef PMEMORY_CHECK
@@ -756,7 +795,7 @@
PFile::Create + PFile::Truncate)) {
PTRACE(3, "Failed to open the specified file " << fileName
<< " to dump memory to");
- return;
+ return TRUE;
}
PMemoryHeap::DumpStatistics();
@@ -765,12 +804,10 @@
PMemoryHeap::DumpObjectsSince(0, result);
outputFile.WriteLine(result);
outputFile.Close();
- return;
+ return TRUE;
}
#endif
-
- PTRACE(1, "READ \"" << txt << "\" of size " << txt.GetSize());
if (txt == PString("list")) {
PStringStream msg;
PStringArray listNodes;
@@ -783,40 +820,10 @@
memcpy(answer.GetPointer(), msg.GetPointer(), msg.GetLength());
answer[msg.GetLength()] = 0;
SendThisMessage(answer);
+ return TRUE;
}
- PINDEX l = txt.Find(':');
- if (l == P_MAX_INDEX) {
- PTRACE(3, "Could not find a colon in \"" << txt << "\", of size " << txt.GetLength());
- return;
- }
- PString dest = txt.Left(l).Trim();
- PString msg = txt.Mid(l + 1).Trim();
-
- PTRACE(3, "Read in " << dest << "--:--" << msg);
- // PTRACE(0, ::setw(32) << sourceId << " " <<txt );
- PBYTEArray outMessage;
- outMessage.SetSize(sourceId.GetLength() + 1 + msg.GetLength() + 1);
- memcpy(outMessage.GetPointer(), sourceId.GetPointer(), sourceId.GetLength());
- outMessage[sourceId.GetLength()] = ':';
- memcpy(outMessage.GetPointer() + sourceId.GetLength() + 1, msg.GetPointer(), msg.GetLength());
- outMessage[outMessage.GetSize() - 1] = 0;
- // cerr << " Send " << PTime().AsString("hh:mm.ss.uuu") << " "
- // << sourceId << ":" << msg << endl << endl;
- PSafePtr <TcpConnection> conn = manager.GetConnectionWithLock(dest, PSafeReadOnly);
- if (conn != NULL) {
- PTRACE(3, "Found connection for id of " << dest);
- conn->SendThisMessage(outMessage);
- } else {
- PTRACE(1, "Fail to send the message "
- << PString((const char *)outMessage.GetPointer(), outMessage.GetSize())
- << " to " << dest);
- PTRACE(1, " as could not get a lock");
- PTRACE(1, sourceId << " is sorry");
- IncCountDropped();
- }
-
- return;
+ return FALSE;
}
void TcpConnection::SendThisMessage(PBYTEArray & message)
Modified: sofaswitch/trunk/server/main.h
==============================================================================
--- sofaswitch/trunk/server/main.h (original)
+++ sofaswitch/trunk/server/main.h Thu Aug 10 00:34:04 2006
@@ -34,8 +34,6 @@
#include <ptlib/sockets.h>
#include <ptlib/safecoll.h>
-
-
class TcpConnectionList;
class TcpConnection;
class Manager;
@@ -108,6 +106,16 @@
/**Now, we have exactly one message, not multiple messages. Process
it on */
void ProcessOneTextMessage(const PString & txt);
+
+ /**There are several messages which are not to be passed on to some other
+ node. Instead, these messages are commands to this server. Commands to
+ this server are processed here.
+
+ return TRUE If the supplied text is a command to this server,
+
+ return FALSE if the supplied text is to be passsed on another node.
+ (typical case) */
+ BOOL ProcessedAsServerCommand(const PString & text);
/**Send the supplied message to the node on this socket */
void SendThisMessage(PBYTEArray & msg);
1
0
Author: mjerris
Date: Wed Aug 9 13:52:05 2006
New Revision: 61
Modified:
sofaswitch/trunk/server/main.cxx
sofaswitch/trunk/server/main.h
Log:
Compile changes for msvc 2005.
Modified: sofaswitch/trunk/server/main.cxx
==============================================================================
--- sofaswitch/trunk/server/main.cxx (original)
+++ sofaswitch/trunk/server/main.cxx Wed Aug 9 13:52:05 2006
@@ -24,7 +24,9 @@
*
*/
+#ifndef _MSC_VER
#pragma implementation "main.h"
+#endif
#include <ptclib/random.h>
@@ -517,20 +519,26 @@
cerr << "SetOption(keepalive) failed: " << messagesSocket.GetErrorText() << endl;
}
+#ifdef TCP_KEEPIDLE
if (!messagesSocket.SetOption(TCP_KEEPIDLE, 10, IPPROTO_TCP)) {
PTRACE(1, "SetOption(TCP_KEEPIDLE 2) failed: " << messagesSocket.GetErrorText());
cerr << "SetOption(TCP_KEEPIDLE 2) failed: " << messagesSocket.GetErrorText() << endl;
}
-
+#endif
+
+#ifdef TCP_KEEPCNT
if (!messagesSocket.SetOption(TCP_KEEPCNT, 2, IPPROTO_TCP)) {
PTRACE(1, "SetOption(TCP_KEEPCNT 2) failed: " << messagesSocket.GetErrorText());
cerr << "SetOption(TCP_KEEPCNT 2) failed: " << messagesSocket.GetErrorText() << endl;
}
-
+#endif
+
+#ifdef TCP_KEEPINTVL
if (!messagesSocket.SetOption(TCP_KEEPINTVL, 10, IPPROTO_TCP)) {
PTRACE(1, "SetOption(TCP_KEEPINTVL 2) failed: " << messagesSocket.GetErrorText());
cerr << "SetOption(TCP_KEEPINTVL 2) failed: " << messagesSocket.GetErrorText() << endl;
}
+#endif
if (!messagesSocket.IsOpen()) {
PTRACE(1, "Main socket is not open. This is bad ");
Modified: sofaswitch/trunk/server/main.h
==============================================================================
--- sofaswitch/trunk/server/main.h (original)
+++ sofaswitch/trunk/server/main.h Wed Aug 9 13:52:05 2006
@@ -26,7 +26,9 @@
#ifndef _MAIN_H
#define _MAIN_H
+#ifndef _MSC_VER
#pragma interface
+#endif
#include <ptlib.h>
#include <ptlib/sockets.h>
1
0
[Sofaswitch-svn] [commit] r60 - in sofaswitch/trunk: . am mcu sofa/include/sofa sofa/src sound voip
by SofaSWITCH SVN 08 Aug '06
by SofaSWITCH SVN 08 Aug '06
08 Aug '06
Author: derek
Date: Tue Aug 8 19:07:15 2006
New Revision: 60
Modified:
sofaswitch/trunk/am/main.cxx
sofaswitch/trunk/am/main.h
sofaswitch/trunk/am/supervisor.cxx
sofaswitch/trunk/mcu/Makefile
sofaswitch/trunk/mcu/audio.h
sofaswitch/trunk/mcu/comms.h
sofaswitch/trunk/mcu/conferenceroom.h
sofaswitch/trunk/mcu/main.cxx
sofaswitch/trunk/mcu/main.h
sofaswitch/trunk/mcu/manager.cxx
sofaswitch/trunk/mcu/manager.h
sofaswitch/trunk/mcu/member.h
sofaswitch/trunk/mcu/participant.h
sofaswitch/trunk/mcu/supervisor.cxx
sofaswitch/trunk/mcu/supervisor.h
sofaswitch/trunk/mcu/version.h
sofaswitch/trunk/message.cxx
sofaswitch/trunk/sofa/include/sofa/messages.h
sofaswitch/trunk/sofa/src/messages.cxx
sofaswitch/trunk/sound/audio.h
sofaswitch/trunk/sound/comms.h
sofaswitch/trunk/started.cxx
sofaswitch/trunk/voip/Makefile
sofaswitch/trunk/voip/docs.cfg
sofaswitch/trunk/voip/main.cxx
sofaswitch/trunk/voip/main.h
sofaswitch/trunk/voip/mymanager.h
sofaswitch/trunk/voip/overview.cxx
sofaswitch/trunk/voip/supervisor.cxx
sofaswitch/trunk/voip/version.h
Log:
Remove the SS prefix to applications like voip, am and mcu.
This is done at the code level, and public Id level.
Update the server docs to describe the adviseontermination,
connection with no id, and whoami commands.
Modified: sofaswitch/trunk/am/main.cxx
==============================================================================
--- sofaswitch/trunk/am/main.cxx (original)
+++ sofaswitch/trunk/am/main.cxx Tue Aug 8 19:07:15 2006
@@ -37,19 +37,19 @@
-PCREATE_PROCESS(SsAmProcess);
+PCREATE_PROCESS(AmProcess);
///////////////////////////////////////////////////////////////
-SsAmProcess::SsAmProcess()
- : PProcess("Derek Smithies Code factory", "SsAm",
+AmProcess::AmProcess()
+ : PProcess("Derek Smithies Code factory", "Am",
MAJOR_VERSION, MINOR_VERSION, BUILD_TYPE, BUILD_NUMBER)
{
}
-void SsAmProcess::Main()
+void AmProcess::Main()
{
// Get and parse all of the command line arguments.
@@ -115,7 +115,7 @@
ourId = args.GetOptionString("id");
PTRACE(3, "our ID is " << ourId);
} else {
- ourId = "ssam";
+ ourId = "am";
PTRACE(3, "Select a default ID of "<< ourId);
}
Modified: sofaswitch/trunk/am/main.h
==============================================================================
--- sofaswitch/trunk/am/main.h (original)
+++ sofaswitch/trunk/am/main.h Tue Aug 8 19:07:15 2006
@@ -24,8 +24,8 @@
*
*/
-#ifndef _SsAm_MAIN_H
-#define _SsAm_MAIN_H
+#ifndef _Am_MAIN_H
+#define _Am_MAIN_H
#include <ptlib.h>
@@ -36,13 +36,13 @@
class Manager;
/**The class that launches everything */
-class SsAmProcess : public PProcess
+class AmProcess : public PProcess
{
- PCLASSINFO(SsAmProcess, PProcess);
+ PCLASSINFO(AmProcess, PProcess);
public:
/**Constructor */
- SsAmProcess();
+ AmProcess();
/**The main thread of execution starts here */
void Main();
@@ -51,8 +51,8 @@
Manager * GetManager() { return opal; }
/**Catch all which can be used anywhere to access this class */
- static SsAmProcess & Current()
- { return (SsAmProcess &)PProcess::Current(); }
+ static AmProcess & Current()
+ { return (AmProcess &)PProcess::Current(); }
protected:
@@ -63,7 +63,7 @@
};
-#endif // _SsAm_MAIN_H
+#endif // _Am_MAIN_H
// End of File ///////////////////////////////////////////////////////////////
Modified: sofaswitch/trunk/am/supervisor.cxx
==============================================================================
--- sofaswitch/trunk/am/supervisor.cxx (original)
+++ sofaswitch/trunk/am/supervisor.cxx Tue Aug 8 19:07:15 2006
@@ -61,7 +61,7 @@
void Supervisor::OnTermination()
{
- Manager *mgr = SsAmProcess::Current().GetManager();
+ Manager *mgr = AmProcess::Current().GetManager();
mgr->RemoveAllCalls();
PTRACE(3, "Destructor Supervisor thread has ended");
@@ -79,7 +79,7 @@
void Supervisor::ProcessStatusQuery(PStringArray &cmds, PString & sender)
{
- Manager *mgr = SsAmProcess::Current().GetManager();
+ Manager *mgr = AmProcess::Current().GetManager();
PStringStream status;
status << PString("Current Status:----------- ")
<< endl
@@ -112,13 +112,13 @@
{
SetRemoteController(sender);
PTRACE(3, "Supervisor says::End everything now");
- SsAmProcess::Current().GetManager()->EndEverything();
+ AmProcess::Current().GetManager()->EndEverything();
PTRACE(3, "Supervisor says::End everything now, and it has been initiated.");
}
void Supervisor::ProcessRequestNewId(PStringArray &/*cmds*/, PString & sender)
{
- SsAmProcess::Current().GetManager()->RequestNewId(sender);
+ AmProcess::Current().GetManager()->RequestNewId(sender);
}
void Supervisor::SilentlyEndAll()
@@ -126,6 +126,6 @@
PTRACE(1, "Silently end all, as this node has lost comms with the server");
PTRACE(3, "Give the other nodes a chance to exit");
sleep(2);
- SsAmProcess::Current().GetManager()->EndEverything();
+ AmProcess::Current().GetManager()->EndEverything();
}
// End of File ///////////////////////////////////////////////////////////////
Modified: sofaswitch/trunk/mcu/Makefile
==============================================================================
--- sofaswitch/trunk/mcu/Makefile (original)
+++ sofaswitch/trunk/mcu/Makefile Tue Aug 8 19:07:15 2006
@@ -32,7 +32,7 @@
#
#
-PROG = ssmcu
+PROG = mcu
SOURCES := \
audio.cxx \
Modified: sofaswitch/trunk/mcu/audio.h
==============================================================================
--- sofaswitch/trunk/mcu/audio.h (original)
+++ sofaswitch/trunk/mcu/audio.h Tue Aug 8 19:07:15 2006
@@ -27,8 +27,8 @@
*
*/
-#ifndef _SsMcu_AUDIO_H
-#define _SsMcu_AUDIO_H
+#ifndef _Mcu_AUDIO_H
+#define _Mcu_AUDIO_H
#ifdef P_USE_PRAGMA
#pragma interface
@@ -128,4 +128,4 @@
-#endif // _SsMcu_AUDIO_MAIN_H
+#endif // _Mcu_AUDIO_MAIN_H
Modified: sofaswitch/trunk/mcu/comms.h
==============================================================================
--- sofaswitch/trunk/mcu/comms.h (original)
+++ sofaswitch/trunk/mcu/comms.h Tue Aug 8 19:07:15 2006
@@ -26,8 +26,8 @@
*
*/
-#ifndef _SsMcu_COMMS_H
-#define _SsMcu_COMMS_H
+#ifndef _Mcu_COMMS_H
+#define _Mcu_COMMS_H
#ifdef P_USE_PRAGMA
#pragma interface
@@ -221,7 +221,7 @@
Comms *comms;
};
-#endif // _SsMcu_COMMS_H
+#endif // _Mcu_COMMS_H
Modified: sofaswitch/trunk/mcu/conferenceroom.h
==============================================================================
--- sofaswitch/trunk/mcu/conferenceroom.h (original)
+++ sofaswitch/trunk/mcu/conferenceroom.h Tue Aug 8 19:07:15 2006
@@ -26,8 +26,8 @@
*
*/
-#ifndef _SsMcu_CONFERENCE_ROOM_H
-#define _SsMcu_CONFERENCE_ROOM_H
+#ifndef _Mcu_CONFERENCE_ROOM_H
+#define _Mcu_CONFERENCE_ROOM_H
#include <ptlib.h>
@@ -145,7 +145,7 @@
/////////////////////////////////////////////////////////////////////////////
-#endif // _SsMcu_CONFERENCE_ROOM_H
+#endif // _Mcu_CONFERENCE_ROOM_H
// End of File ///////////////////////////////////////////////////////////////
Modified: sofaswitch/trunk/mcu/main.cxx
==============================================================================
--- sofaswitch/trunk/mcu/main.cxx (original)
+++ sofaswitch/trunk/mcu/main.cxx Tue Aug 8 19:07:15 2006
@@ -40,19 +40,19 @@
-PCREATE_PROCESS(SsMcuProcess);
+PCREATE_PROCESS(McuProcess);
///////////////////////////////////////////////////////////////
-SsMcuProcess::SsMcuProcess()
- : PProcess("Derek Smithies Code factory", "SsMcu",
+McuProcess::McuProcess()
+ : PProcess("Derek Smithies Code factory", "Mcu",
MAJOR_VERSION, MINOR_VERSION, BUILD_TYPE, BUILD_NUMBER)
{
}
-void SsMcuProcess::Main()
+void McuProcess::Main()
{
// Get and parse all of the command line arguments.
@@ -119,7 +119,7 @@
ourId = args.GetOptionString("id");
PTRACE(3, "our ID is " << ourId);
} else {
- ourId = "ssmcu";
+ ourId = "mcu";
PTRACE(3, "Select a default ID of " << ourId);
}
Modified: sofaswitch/trunk/mcu/main.h
==============================================================================
--- sofaswitch/trunk/mcu/main.h (original)
+++ sofaswitch/trunk/mcu/main.h Tue Aug 8 19:07:15 2006
@@ -23,8 +23,8 @@
*
*/
-#ifndef _SsMcu_MAIN_H
-#define _SsMcu_MAIN_H
+#ifndef _Mcu_MAIN_H
+#define _Mcu_MAIN_H
#ifdef P_USE_PRAGMA
#pragma interface
@@ -39,13 +39,13 @@
class Manager;
/**The class that launches everything */
-class SsMcuProcess : public PProcess
+class McuProcess : public PProcess
{
- PCLASSINFO(SsMcuProcess, PProcess);
+ PCLASSINFO(McuProcess, PProcess);
public:
/**Constructor */
- SsMcuProcess();
+ McuProcess();
/**The main thread of execution starts here */
void Main();
@@ -54,8 +54,8 @@
Manager * GetManager() { return opal; }
/**Catch all which can be used anywhere to access this class */
- static SsMcuProcess & Current()
- { return (SsMcuProcess &)PProcess::Current(); }
+ static McuProcess & Current()
+ { return (McuProcess &)PProcess::Current(); }
protected:
@@ -66,7 +66,7 @@
};
-#endif // _SsMcu_MAIN_H
+#endif // _Mcu_MAIN_H
// End of File ///////////////////////////////////////////////////////////////
Modified: sofaswitch/trunk/mcu/manager.cxx
==============================================================================
--- sofaswitch/trunk/mcu/manager.cxx (original)
+++ sofaswitch/trunk/mcu/manager.cxx Tue Aug 8 19:07:15 2006
@@ -270,7 +270,7 @@
PTRACE(3, "ProcessStatusQuery " << cmds);
result << endl;
- result << "ssmcu:Current Status :------------------" << endl;
+ result << "mcu:Current Status :------------------" << endl;
result << "Comms instance count :" << GetCountComms() << endl;
result << "Member instance count :" << GetCountMembers() << endl;
result << "Participant instance count:" << GetCountParticipants() << endl;
Modified: sofaswitch/trunk/mcu/manager.h
==============================================================================
--- sofaswitch/trunk/mcu/manager.h (original)
+++ sofaswitch/trunk/mcu/manager.h Tue Aug 8 19:07:15 2006
@@ -25,8 +25,8 @@
*
*/
-#ifndef _SsMcu_MANAGER_H
-#define _SsMcu_MANAGER_H
+#ifndef _Mcu_MANAGER_H
+#define _Mcu_MANAGER_H
#ifdef P_USE_PRAGMA
@@ -86,7 +86,7 @@
/**Return the send to address that is stored in this class instance*/
- BOOL GetSendToAddress(const PString &SsMcuToken, PIPSocket::Address & address, PINDEX & portNo);
+ BOOL GetSendToAddress(const PString &McuToken, PIPSocket::Address & address, PINDEX & portNo);
/**Return a reference to the pyython launcher for this program */
LaunchNewId & GetLaunchNewId() { return lid; }
@@ -249,7 +249,7 @@
-#endif // _SsMcu_MANAGER_H
+#endif // _Mcu_MANAGER_H
// End of File ///////////////////////////////////////////////////////////////
Modified: sofaswitch/trunk/mcu/member.h
==============================================================================
--- sofaswitch/trunk/mcu/member.h (original)
+++ sofaswitch/trunk/mcu/member.h Tue Aug 8 19:07:15 2006
@@ -24,8 +24,8 @@
*
*/
-#ifndef _SsMcu_MEMBER_H
-#define _SsMcu_MEMBER_H
+#ifndef _Mcu_MEMBER_H
+#define _Mcu_MEMBER_H
#include <ptlib.h>
@@ -259,7 +259,7 @@
};
-#endif // _SsMcu_MEMBER_H
+#endif // _Mcu_MEMBER_H
// End of File ///////////////////////////////////////////////////////////////
Modified: sofaswitch/trunk/mcu/participant.h
==============================================================================
--- sofaswitch/trunk/mcu/participant.h (original)
+++ sofaswitch/trunk/mcu/participant.h Tue Aug 8 19:07:15 2006
@@ -24,8 +24,8 @@
*
*/
-#ifndef _SsMcu_Participant_H
-#define _SsMcu_Participant_H
+#ifndef _Mcu_Participant_H
+#define _Mcu_Participant_H
#include <ptlib.h>
@@ -220,7 +220,7 @@
PString key;
};
-#endif // _SsMcu_Participant_H
+#endif // _Mcu_Participant_H
// End of File ///////////////////////////////////////////////////////////////
Modified: sofaswitch/trunk/mcu/supervisor.cxx
==============================================================================
--- sofaswitch/trunk/mcu/supervisor.cxx (original)
+++ sofaswitch/trunk/mcu/supervisor.cxx Tue Aug 8 19:07:15 2006
@@ -63,7 +63,7 @@
void Supervisor::ProcessStatusQuery(PStringArray &cmds, PString & sender)
{
PString status;
- status = SsMcuProcess::Current().GetManager()->ProcessStatusQuery(cmds);
+ status = McuProcess::Current().GetManager()->ProcessStatusQuery(cmds);
SendThisMessageTo(status, sender);
}
@@ -83,7 +83,7 @@
{
SetRemoteController(sender);
PTRACE(3, "Supervisor says::End everything now");
- SsMcuProcess::Current().GetManager()->EndEverything();
+ McuProcess::Current().GetManager()->EndEverything();
}
@@ -107,7 +107,7 @@
return;
}
- SsMcuProcess::Current().GetManager()->RequestNewId(sender, cmds);
+ McuProcess::Current().GetManager()->RequestNewId(sender, cmds);
}
void Supervisor::SilentlyEndAll()
@@ -115,6 +115,6 @@
PTRACE(1, "Silently end all, as this node has lost comms with the server");
PTRACE(3, "Give the other nodes a chance to exit");
sleep(2);
- SsMcuProcess::Current().GetManager()->EndEverything();
+ McuProcess::Current().GetManager()->EndEverything();
}
// End of File ///////////////////////////////////////////////////////////////
Modified: sofaswitch/trunk/mcu/supervisor.h
==============================================================================
--- sofaswitch/trunk/mcu/supervisor.h (original)
+++ sofaswitch/trunk/mcu/supervisor.h Tue Aug 8 19:07:15 2006
@@ -27,8 +27,8 @@
*
*/
-#ifndef _SsMcu_SUPERVISOR_H
-#define _SsMcu_SUPERVISOR_H
+#ifndef _Mcu_SUPERVISOR_H
+#define _Mcu_SUPERVISOR_H
#ifdef P_USE_PRAGMA
#pragma interface
@@ -106,7 +106,7 @@
};
-#endif // _SsMcu_SUPERVISOR_H
+#endif // _Mcu_SUPERVISOR_H
Modified: sofaswitch/trunk/mcu/version.h
==============================================================================
--- sofaswitch/trunk/mcu/version.h (original)
+++ sofaswitch/trunk/mcu/version.h Tue Aug 8 19:07:15 2006
@@ -23,8 +23,8 @@
*
*/
-#ifndef _SsMcu_VERSION_H
-#define _SsMcu_VERSION_H
+#ifndef _Mcu_VERSION_H
+#define _Mcu_VERSION_H
#define MAJOR_VERSION 1
#define MINOR_VERSION 0
@@ -32,7 +32,7 @@
#define BUILD_NUMBER 0
-#endif // _SsMcu_VERSION_H
+#endif // _Mcu_VERSION_H
// End of File ///////////////////////////////////////////////////////////////
Modified: sofaswitch/trunk/message.cxx
==============================================================================
--- sofaswitch/trunk/message.cxx (original)
+++ sofaswitch/trunk/message.cxx Tue Aug 8 19:07:15 2006
@@ -32,10 +32,11 @@
Worker/Supervisor has one TCP connection to the server, for
sending/receiving messages relevant to/from the server.
-We are opposed to "micro management". Thus, a Supervisor is not
-required to worry about the details of any one voice circuit. In fact,
-the only contact a Supervisor will have with any one voice circuit is
-to create the Worker to handle that voice circuit.
+We are opposed to "micro management". Thus, a Supervisor is not required to
+worry about the details of any one voice circuit. In fact, the only control a
+Supervisor will have over any voice circuit is to create the Worker to handle
+that voice circuit. Note however that the Supervisor will be able to report
+the status of individual workers/voice circuits.
Similarily, when two Workers have to arrange the transfer of audio
data between themselves, it is none of the Controller's business. The
@@ -66,12 +67,18 @@
TCPConnection class has been added to the internal list, full
bidirectional comms is now possible with node "switch".
+In some cases, the connecting node has no idea what unique ID to specify. It
+will (in this case) use the string "?" and let the server assign a unique ID.
+The connecting node can then use the command "whoami" to enquire of the server
+to find out what unique ID was assigned.
+
+
The server assumes all remote nodes will correctly choose a valid
unique ID. My preference is that the supervisor connects with a
-label such as "controller", "ssvoip", or "ssam". Workers spawned by
+label such as "controller", "voip", or "am". Workers spawned by
that supervisor have a number appended to the supervisor's
-label. Thus, the voip supervisor connects as "ssvoip". All workers
-spawned by the voip supervisor will be called "ssvoip1", "ssvoip2",
+label. Thus, the voip supervisor connects as "voip". All workers
+spawned by the voip supervisor will be called "voip1", "voip2",
etc. This naming scheme makes debugging somewhat easier, as you can
identify, from the label, the origin/destination of a message.
@@ -193,6 +200,16 @@
similar to the notion of presence as used in XMPP,
except that here, presence is driven by the client.
</td></tr>
+<tr><td> whoami </td><td> A request to the server to advise us who we
+ are. This command is useful when we are some controller who
+ has connected to the server and asked the server to generate
+ a unique Id for us. It is also a debugging tool from the command
+ prompt case - we can enquire of the server to check our ID.
+</td></tr>
+<tr><td>adviseontermination remNode</td></td>This commands the server to (on this node
+ terminating) send a message to the specified node (remNode). The message
+ will advise remNode that this this node has died.
+</td></tr>
</table>
</center>
@@ -200,25 +217,25 @@
Below is the sequence of three messages, as sent by worker nodes, to
setup the transfer of audio beteen the worker nodes of voip41 (voice
-over ip worker) and ssam3 (answering machine worker). Note that
+over ip worker) and am3 (answering machine worker). Note that
controller10 is a worker node in the controller, and is responsible
for handling one call.
<center>
<table>
-<tr><td> controller10 </td><td> sends </td><td> voip41: transferudp ssam3 </td><td>(worker to worker)</td></tr>
-<tr><td> voip41 </td><td> sends </td><td> ssam3: 192.168.1.109:62054 </td><td>(worker to worker)</td></tr>
-<tr><td> ssam3 </td><td> sends </td><td> voip41: 192.168.1.54: 45021 done</td><td>(worker to worker)</td></tr>
+<tr><td> controller10 </td><td> sends </td><td> voip41: transferudp am3 </td><td>(worker to worker)</td></tr>
+<tr><td> voip41 </td><td> sends </td><td> am3: 192.168.1.109:62054 </td><td>(worker to worker)</td></tr>
+<tr><td> am3 </td><td> sends </td><td> voip41: 192.168.1.54: 45021 done</td><td>(worker to worker)</td></tr>
</table>
</center>
-The controller10 tells voip41 that it has to send audio to the ssam3
+The controller10 tells voip41 that it has to send audio to the am3
node. Once the controller has sent this message, the controller has no
further news on if anything has happened. voip41 receives the
-transferudp message and advises ssam3 of an ip/port address. This
-second message in the transfer advises ssam3 of where to send audio
-data to. ssam3, on receipt of message 2, can start sending audio to
-the address specified in message 2. ssam3 then advises voip41 of the
+transferudp message and advises am3 of an ip/port address. This
+second message in the transfer advises am3 of where to send audio
+data to. am3, on receipt of message 2, can start sending audio to
+the address specified in message 2. am3 then advises voip41 of the
address that voip41 should send audio to. When voip41 receives message
3, voip41 can start sending audio to 192.168.1.54:45021. On receipt of
message 3, voip 41 will send no more messages, as message 3 contains
@@ -231,9 +248,9 @@
<center>
<table>
-<tr><td> voip41</td><td> receives </td><td> controller10: transferudp ssam3 </td><td> (worker to worker)</td></tr>
-<tr><td> ssam3 </td><td> receives </td><td> voip41: 192.168.1.109:62054 </td><td> (worker to worker)</td></tr>
-<tr><td> voip41</td><td> receives </td><td> ssam3: 192.168.1.54:45021 done </td><td> (worker to worker)</td></tr>
+<tr><td> voip41</td><td> receives </td><td> controller10: transferudp am3 </td><td> (worker to worker)</td></tr>
+<tr><td> am3 </td><td> receives </td><td> voip41: 192.168.1.109:62054 </td><td> (worker to worker)</td></tr>
+<tr><td> voip41</td><td> receives </td><td> am3: 192.168.1.54:45021 done </td><td> (worker to worker)</td></tr>
</table>
</center>
@@ -252,7 +269,7 @@
<center>
<table>
<tr><td> controller10 </td><td> sends </td><td> voip:requestnewid </td><td>(worker to supervisor) </td></tr>
-<tr><td> voip </td><td> sends </td><td> controller10:requestnewid voip20 </td><td>(worker to worker) </td></tr>
+<tr><td> voip </td><td> sends </td><td> controller10:requestnewid voip20 </td><td>(worker to worker) </td></tr>
</table>
</center>
@@ -269,10 +286,10 @@
<center>
<table>
-<tr><td> controller10 </td> <td>sends</td> <td> voip:requestnewid </td><td> (worker to supervisor) </td></tr>
-<tr><td> voip </td> </td> <td>sends</td> <td> controller10:requestnewid voip20 </td><td> (worker to worker) </td></tr>
-<tr><td> controller10 </td> <td>sends</td> <td> voip20:callnode h323:h323.voxgratia.org</td><td> (worker to worker)</td></tr>
-<tr><td> voip20 </td> <td>sends</td> <td> controller10: callestablished voip20 </td><td> (worker to worker)</td></tr>
+<tr><td> controller10 </td> <td>sends</td> <td> voip:requestnewid </td><td> (worker to supervisor) </td></tr>
+<tr><td> voip </td> </td> <td>sends</td> <td> controller10:requestnewid voip20 </td><td> (worker to worker) </td></tr>
+<tr><td> controller10 </td> <td>sends</td> <td> voip20:callnode h323:h323.voxgratia.org</td><td> (worker to worker) </td></tr>
+<tr><td> voip20 </td> <td>sends</td> <td> controller10: callestablished voip20 </td><td> (worker to worker) </td></tr>
</table>
</center>
@@ -297,14 +314,14 @@
</center>
Once the controller know who the worker nodes are, it can start the transferudp
-sequence. However if the voip worker and ssam worker complete the transferudp
+sequence. However if the voip worker and am worker complete the transferudp
sequence before the call is established (from the voip perspective), and the
-controller then tells the ssam worker the announcement file, the very first
+controller then tells the am worker the announcement file, the very first
part of the announcement file will not be heard by the remote voip node.
Consequently,
-the ssam announcement file should be set after the call is established. The ssam
-received message file can be set at any time. Although, setting the ssam announcement
+the am announcement file should be set after the call is established. The am
+received message file can be set at any time. Although, setting the am announcement
file too late will mean that the first part of the incoming voice call will be missed.
\section secExampleOutgoingCall Example of creating outgoing voip call.
@@ -313,7 +330,7 @@
In this example, the box at 192.168.1.100 is being asked to call the node at box 192.168.1.200.
The answering machine resides at address 192.168.1.2.
-The box at 192.168.1.100 has registered with the controller under the basename of ssvoip_send,
+The box at 192.168.1.100 has registered with the controller under the basename of voip_send,
as it is responsible for initiating calls with remote computers.
Notice that in \ref secExampleIncomingCall and \ref secExampleOutgoingCall
@@ -322,26 +339,26 @@
we could have placed the incoming and outgoing ends of the call on the same
sofaswitch voip application.
-In this example, ssvoip_send1 reported to the contrcontroller2 let the call
+In this example, voip_send1 reported to the contrcontroller2 let the call
run for 5 seconds, and then sent a hangup message to the two worker nodes managed by controller2.
<center>
<table>
-<tr><th> send time</th><th> sent by </th><th> message </th></tr>
-<tr><td> 0:31.493 </td><td> controller1 </td><td> ssvoip_send:REQUESTNEWID </td></tr>
-<tr><td> 0:31.494 </td><td> controller1 </td><td> ssam:REQUESTNEWID </td></tr>
-<tr><td> 0:31.494 </td><td> ssvoip_send </td><td> controller1:REQUESTNEWID ssvoip_send1 </td></tr>
-<tr><td> 0:31.495 </td><td> ssam </td><td> controller1:REQUESTNEWID ssam1 </td></tr>
-<tr><td> 0:31.586 </td><td> controller1 </td><td> ssvoip_send1:callnode h323:192.168.1.200 </td></tr>
-<tr><td> 0:31.586 </td><td> controller1 </td><td> ssam1:setannouncementfile sample_message.wav </td></tr>
-<tr><td> 0:31.626 </td><td> controller1 </td><td> ssam1:setreceivedmsgfile recorded_ssam1.wav </td></tr>
-<tr><td> 0:31.990 </td><td> ssvoip_send1 </td><td> controller1:CallEstablished ssvoip_send1 </td></tr>
-<tr><td> 0:31.991 </td><td> controller1 </td><td> ssvoip_send1:transferudp ssam1 </td></tr>
-<tr><td> 0:31.992 </td><td> ssvoip_send1 </td><td> ssam1:transferudp ssam1 192.168.1.100:60000 </td></tr>
-<tr><td> 0:31.999 </td><td> ssam1 </td><td> ssvoip_send1:transferudp ssam1 192.168.1.2:64000 done</td></tr>
-<tr><td> 0:37.017 </td><td> ssvoip_send1 </td><td> controller1:Terminating </td></tr>
-<tr><td> 0:37.017 </td><td> controller1 </td><td> ssam1:hangup </td></tr>
-<tr><td> 0:37.018 </td><td> ssam1 </td><td> controller1:Terminating </td></tr>
+<tr><th> send time</th><th> sent by </th><th> message </th></tr>
+<tr><td> 0:31.493 </td><td> controller1 </td><td> voip_send:REQUESTNEWID </td></tr>
+<tr><td> 0:31.494 </td><td> controller1 </td><td> am:REQUESTNEWID </td></tr>
+<tr><td> 0:31.494 </td><td> voip_send </td><td> controller1:REQUESTNEWID voip_send1 </td></tr>
+<tr><td> 0:31.495 </td><td> am </td><td> controller1:REQUESTNEWID am1 </td></tr>
+<tr><td> 0:31.586 </td><td> controller1 </td><td> voip_send1:callnode h323:192.168.1.200 </td></tr>
+<tr><td> 0:31.586 </td><td> controller1 </td><td> am1:setannouncementfile sample_message.wav </td></tr>
+<tr><td> 0:31.626 </td><td> controller1 </td><td> am1:setreceivedmsgfile recorded_am1.wav </td></tr>
+<tr><td> 0:31.990 </td><td> voip_send1 </td><td> controller1:CallEstablished voip_send1 </td></tr>
+<tr><td> 0:31.991 </td><td> controller1 </td><td> voip_send1:transferudp am1 </td></tr>
+<tr><td> 0:31.992 </td><td> voip_send1 </td><td> am1:transferudp am1 192.168.1.100:60000 </td></tr>
+<tr><td> 0:31.999 </td><td> am1 </td><td> voip_send1:transferudp am1 192.168.1.2:64000 done </td></tr>
+<tr><td> 0:37.017 </td><td> voip_send1 </td><td> controller1:Terminating </td></tr>
+<tr><td> 0:37.017 </td><td> controller1 </td><td> am1:hangup </td></tr>
+<tr><td> 0:37.018 </td><td> am1 </td><td> controller1:Terminating </td></tr>
</table>
</center>
@@ -350,7 +367,7 @@
an incoming call from the node at box 192.168.1.100.
The answering machine resides at address 192.168.1.2.
The box at 192.168.1.100 has registered with the controller under the basename
-of ssvoip_rec, as it is responsible for processing incoming voip calls.
+of voip_rec, as it is responsible for processing incoming voip calls.
Notice that in \ref secExampleIncomingCall and \ref secExampleOutgoingCall
we have shown "both ends" of the voip call.Incoming, and outgoing. One
@@ -363,22 +380,22 @@
<center>
<table>
-<tr><th> send time</th><th> sent by </th><th> message </th></tr>
-<tr><td> 0:31.871 </td><td> ssvoip_rec2 </td><td> controller:QueryAcceptIncoming derek [192.168.1.100] </td></tr>
-<tr><td> 0:31.874 </td><td> controller2 </td><td> ssam:REQUESTNEWID </td></tr>
-<tr><td> 0:31.875 </td><td> ssam </td><td> controller2:REQUESTNEWID ssam2 </td></tr>
-<tr><td> 0:31.966 </td><td> controller2 </td><td> ssvoip_rec2:answer true </td></tr>
-<tr><td> 0:31.966 </td><td> controller2 </td><td> ssam2:setannouncementfile sample_message.wav </td></tr>
-<tr><td> 0:31.984 </td><td> ssvoip_rec2 </td><td> controller2:CallEstablished ssvoip_rec2 </td></tr>
-<tr><td> 0:31.984 </td><td> controller2 </td><td> ssam2:setreceivedmsgfile recorded_ssam2.wav </td></tr>
-<tr><td> 0:31.984 </td><td> controller2 </td><td> ssvoip_rec2:transferudp ssam2 </td></tr>
-<tr><td> 0:32.049 </td><td> ssvoip_rec2 </td><td> controller2:CallEstablished ssvoip_rec2 </td></tr>
-<tr><td> 0:32.049 </td><td> ssvoip_rec2 </td><td> ssam2:transferudp ssam2 192.168.1.200:60001 </td></tr>
-<tr><td> 0:32.050 </td><td> ssam2 </td><td> ssvoip_rec2:transferudp ssam2 192.168.1.2:64001 done </td></tr>
-<tr><td> 0:36.966 </td><td> controller2 </td><td> ssvoip_rec2:hangup </td></tr>
-<tr><td> 0:36.966 </td><td> controller2 </td><td> ssam2:hangup </td></tr>
-<tr><td> 0:36.967 </td><td> ssvoip_rec2 </td><td> controller2:Terminating </td></tr>
-<tr><td> 0:36.967 </td><td> ssam2 </td><td> controller2:Terminating </td></tr>
+<tr><th> send time</th><th> sent by </th><th> message </th></tr>
+<tr><td> 0:31.871 </td><td> voip_rec2 </td><td> controller:QueryAcceptIncoming derek [192.168.1.100] </td></tr>
+<tr><td> 0:31.874 </td><td> controller2 </td><td> am:REQUESTNEWID </td></tr>
+<tr><td> 0:31.875 </td><td> am </td><td> controller2:REQUESTNEWID am2 </td></tr>
+<tr><td> 0:31.966 </td><td> controller2 </td><td> voip_rec2:answer true </td></tr>
+<tr><td> 0:31.966 </td><td> controller2 </td><td> am2:setannouncementfile sample_message.wav </td></tr>
+<tr><td> 0:31.984 </td><td> voip_rec2 </td><td> controller2:CallEstablished voip_rec2 </td></tr>
+<tr><td> 0:31.984 </td><td> controller2 </td><td> am2:setreceivedmsgfile recorded_am2.wav </td></tr>
+<tr><td> 0:31.984 </td><td> controller2 </td><td> voip_rec2:transferudp am2 </td></tr>
+<tr><td> 0:32.049 </td><td> voip_rec2 </td><td> controller2:CallEstablished voip_rec2 </td></tr>
+<tr><td> 0:32.049 </td><td> voip_rec2 </td><td> am2:transferudp am2 192.168.1.200:60001 </td></tr>
+<tr><td> 0:32.050 </td><td> am2 </td><td> voip_rec2:transferudp am2 192.168.1.2:64001 done </td></tr>
+<tr><td> 0:36.966 </td><td> controller2 </td><td> voip_rec2:hangup </td></tr>
+<tr><td> 0:36.966 </td><td> controller2 </td><td> am2:hangup </td></tr>
+<tr><td> 0:36.967 </td><td> voip_rec2 </td><td> controller2:Terminating </td></tr>
+<tr><td> 0:36.967 </td><td> am2 </td><td> controller2:Terminating </td></tr>
</table>
</center>
Modified: sofaswitch/trunk/sofa/include/sofa/messages.h
==============================================================================
--- sofaswitch/trunk/sofa/include/sofa/messages.h (original)
+++ sofaswitch/trunk/sofa/include/sofa/messages.h Tue Aug 8 19:07:15 2006
@@ -382,11 +382,11 @@
PString GetServer() { return remoteServer; }
protected:
- /**The id to use as a base for all further ID's - eg beta/ssvoip */
+ /**The id to use as a base for all further ID's - eg beta/voip */
PString ourBaseId;
/**The Id of this particular node, to register with the server as.
- a valid ourNodeId would be ssvoip. */
+ a valid ourNodeId would be voip (for a voip node). */
PString ourNodeId;
/**The password to use for all logins to the remote message server */
Modified: sofaswitch/trunk/sofa/src/messages.cxx
==============================================================================
--- sofaswitch/trunk/sofa/src/messages.cxx (original)
+++ sofaswitch/trunk/sofa/src/messages.cxx Tue Aug 8 19:07:15 2006
@@ -900,7 +900,7 @@
message << "AdviseOnTermination " << rc;
PBYTEArray binary;
binary.SetSize(message.GetSize());
- memcpy(binary.GetPointer(), message.(), message.GetLength());
+ memcpy(binary.GetPointer(), message.GetPointer(), message.GetLength());
binary[message.GetLength()] = 0;
writeMessageLock.Wait();
Modified: sofaswitch/trunk/sound/audio.h
==============================================================================
--- sofaswitch/trunk/sound/audio.h (original)
+++ sofaswitch/trunk/sound/audio.h Tue Aug 8 19:07:15 2006
@@ -18,6 +18,7 @@
#define _AUDIO_H
#include <ptlib/sockets.h>
+#include <ptlib/sound.h>
/////////////////////////////////////////////////////////////////////////////
/**The base class for reading and writing audio from/to the sound
Modified: sofaswitch/trunk/sound/comms.h
==============================================================================
--- sofaswitch/trunk/sound/comms.h (original)
+++ sofaswitch/trunk/sound/comms.h Tue Aug 8 19:07:15 2006
@@ -33,6 +33,7 @@
#include <ptlib.h>
+#include <ptlib/sound.h>
#include <sofa/messages.h>
class JOCall;
Modified: sofaswitch/trunk/started.cxx
==============================================================================
--- sofaswitch/trunk/started.cxx (original)
+++ sofaswitch/trunk/started.cxx Tue Aug 8 19:07:15 2006
@@ -203,10 +203,10 @@
Once the server is running, start the answering machine with
\code
-./ob_linux_x86_r/ssam -s machine_running_server
+./ob_linux_x86_r/am -s machine_running_server
\endcode
-For the test script to work, we expect that ssam is launched from a directory
+For the test script to work, we expect that am is launched from a directory
containing a 16bit, 8khz sound file, called "sample_message.wav"
In the controller directory, there is a python script that will connect the audio
@@ -219,16 +219,16 @@
The server reports the following messages.
\code
-controller : ssam:REQUESTNEWID
- ssam : controller:REQUESTNEWID ssam1
-controller : ssam1:transferudp sound
- ssam1 : controller:OutgoingCall ssam1
- ssam1 : sound:transferudp sound 10.0.0.5:64000
- sound : ssam1:transferudp sound 10.0.0.5:61000 done
-controller : ssam1:setannouncementfile sample_message.wav
-controller : ssam1:setreceivedmsgfile derek.wav
-controller : ssam1:hangup
- ssam1 : controller:Terminating
+controller : am:REQUESTNEWID
+ am : controller:REQUESTNEWID am1
+controller : am1:transferudp sound
+ am1 : controller:OutgoingCall am1
+ am1 : sound:transferudp sound 10.0.0.5:64000
+ sound : am1:transferudp sound 10.0.0.5:61000 done
+controller : am1:setannouncementfile sample_message.wav
+controller : am1:setreceivedmsgfile derek.wav
+controller : am1:hangup
+ am1 : controller:Terminating
\endcode
The messages are in four groups.
@@ -236,7 +236,7 @@
The answering machine supervisor sends a message back to the controller, advising
the controller of the new identity.
-\li The controller tells the new identy (ssam1) to connect audio streams with the "sound"
+\li The controller tells the new identy (am1) to connect audio streams with the "sound"
identity. Notice that the controller is not aware of the address used to transfer audio.
\li The controller tells the answering machine identity to play audio from the file
@@ -245,23 +245,23 @@
\li Advisement notices (call setup, call terminating)
As before, this simple test can be extended by running the "client.py" python script file described above.
-You can enquire of the answering machine for status information (command "ssam:status full") and you
+You can enquire of the answering machine for status information (command "am:status full") and you
will see what is available. The answerine machine will reply back
\code
-ssam:status full
-ssam:Current Status:-----------
+am:status full
+am:Current Status:-----------
Comms instance count 61 50 11
Consumer instance count 50 50 0
pre, active & dead calls 0 1 0
Current active nodes:
- ssam51
+ am51
\endcode
These figures are designed to provide some diagnostic information about what is going on.
There main purpose is tell you the counts of constructed/allocated class instances, and therefore
provide some guide as to if the system is leaking memory.
-There are 11 Comms instances currently availble. One is used in an active call (ssam51), and the
+There are 11 Comms instances currently availble. One is used in an active call (am51), and the
remaining 10 have connected to the message server. These remaining 10 are therefore ready for
immediate use, should they be requested by the controller.
@@ -288,18 +288,18 @@
current nodes
controller
sound
- ssam
- ssam51
- ssam52
- ssam53
- ssam54
- ssam55
- ssam56
- ssam57
- ssam58
- ssam59
- ssam60
- ssam61
+ am
+ am51
+ am52
+ am53
+ am54
+ am55
+ am56
+ am57
+ am58
+ am59
+ am60
+ am61
test
\endcode
@@ -312,11 +312,11 @@
The list contains 15 nodes, which is correct. "Controller" is there, who
is running the "testsound.py" script file. "sound" is there, who is
-managing the sound card, and is an endpoint for the test. "ssam" is
+managing the sound card, and is an endpoint for the test. "am" is
there, who is the supervisor of the answering machine. "test" is there,
which is the identity of the node from the "client.py" python script.
-"ssam51" is there, who is the current active answering machine node.
-Nodes "ssam52..ssam61" are the nodes ssam has prebuilt, which are ready for use.
+"am51" is there, who is the current active answering machine node.
+Nodes "am52..am61" are the nodes am has prebuilt, which are ready for use.
\section secTestSoundAmMcu Test sound card, Answering Machine and Conference
In this section, we create a more complex example, which consists of one
@@ -328,9 +328,9 @@
simply by speaking into the microphone.
The conference utility has to be compiled (make both) and invoked. The command
-line args are identical to ssam.
+line args are identical to am.
\code
-./ob_linux_x86_r/ssmcu -s machine_running_server
+./ob_linux_x86_r/mcu -s machine_running_server
\endcode
The script "testmcu3.py" has to be invoked. This will add a member to the
@@ -343,10 +343,10 @@
has been started, and is waiting for the user to terminate it. Please do not terminate this
script. This script has created a conference room with one member.
-In the "client.py" window, we type "ssmcu:status", to get the status of the mcu as a whole.
+In the "client.py" window, we type "mcu:status", to get the status of the mcu as a whole.
\code
-ssmcu:status
-ssmcu:ssmcu:Current Status :------------------
+mcu:status
+mcu:mcu:Current Status :------------------
Comms instance count : 12 1 11
Member instance count : 2 1 1
Participant instance count: 2 2 0
@@ -368,11 +368,11 @@
is essential N squared, because every member has links to every other
member in each cnference room.
-Additional information can be obtained with the command "ssmcu:status room",
+Additional information can be obtained with the command "mcu:status room",
to get information about the activities in room. This command reports:
\code
-ssmcu:status room
-ssmcu:ssmcu:Current Status :------------------
+mcu:status room
+mcu:mcu:Current Status :------------------
Comms instance count : 12 1 11
Member instance count : 2 1 1
Participant instance count: 2 2 0
@@ -380,13 +380,13 @@
room:room members:1
Available members is 1
- member ssmcu2
+ member mcu2
Participants in Conference room "room" are::
- -ssmcu2
+ -mcu2
Duration Info
- -ssmcu2 19:14.462 mins:secs.msecs
+ -mcu2 19:14.462 mins:secs.msecs
\endcode
See? It has told us that in conference room "room" the names of the available members,
@@ -441,14 +441,14 @@
\li The dotted lines with arrows indicate audio flow
\li The dotted thick lines (no arrows) indicate a flow of control signals.
\li Note that all control signals go via the server.
-\li We have shown the ssmcu as containing one conference room (denoted by the hexagon and word "room").
- However, ssmcu could manage multiple conference rooms.
-\li There are three entities in the conference room, ssmcu1, ssmcu2 and ssmcu3.
-\li The conference room "room" was created by ssmcu by the command, "ssmcu:REQUESTNEWID room". The
- next time this command was sent to ssmcu, a new node was created (ssmcu2) and then placed in
+\li We have shown the mcu as containing one conference room (denoted by the hexagon and word "room").
+ However, mcu could manage multiple conference rooms.
+\li There are three entities in the conference room, mcu1, mcu2 and mcu3.
+\li The conference room "room" was created by mcu by the command, "mcu:REQUESTNEWID room". The
+ next time this command was sent to mcu, a new node was created (mcu2) and then placed in
the specified conference room.
-\li The entities 'ssam', 'ssmcu', and 'controller' are supervisor style nodes.
-\li The entities 'ssam1', 'ssam2', 'ssmcu1', 'ssmcu2' are worker nodes.
+\li The entities 'am', 'mcu', and 'controller' are supervisor style nodes.
+\li The entities 'am1', 'am2', 'mcu1', 'mcu2' are worker nodes.
\li The sound program is designed to work with just one card. Consequently, it made little sense
to put in a Supervisor/Worker feature. From a code perspective, sound is wrong. One day, I
will add a supervisor to sound.
@@ -468,7 +468,7 @@
defaults to localhost.
\li -i will specify the id this utility uses when connecting to the
message server. Each utility has its own default id. For example, the
- voip executable has an id of "ssvoip"
+ voip executable has an id of "voip"
\li -v report program version info.
*/
Modified: sofaswitch/trunk/voip/Makefile
==============================================================================
--- sofaswitch/trunk/voip/Makefile (original)
+++ sofaswitch/trunk/voip/Makefile Tue Aug 8 19:07:15 2006
@@ -28,7 +28,7 @@
#
#
-PROG = ssvoip
+PROG = voip
SOURCES := \
comms.cxx \
Modified: sofaswitch/trunk/voip/docs.cfg
==============================================================================
--- sofaswitch/trunk/voip/docs.cfg (original)
+++ sofaswitch/trunk/voip/docs.cfg Tue Aug 8 19:07:15 2006
@@ -3,7 +3,7 @@
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
-PROJECT_NAME = "SSVoip, which is Sofa Switch Voip"
+PROJECT_NAME = "Voip, which does voip in the Sofa Switch utilities"
PROJECT_NUMBER =
OUTPUT_DIRECTORY =
#CREATE_SUBDIRS = NO
Modified: sofaswitch/trunk/voip/main.cxx
==============================================================================
--- sofaswitch/trunk/voip/main.cxx (original)
+++ sofaswitch/trunk/voip/main.cxx Tue Aug 8 19:07:15 2006
@@ -65,19 +65,19 @@
-PCREATE_PROCESS(SsVoipProcess);
+PCREATE_PROCESS(VoipProcess);
///////////////////////////////////////////////////////////////
-SsVoipProcess::SsVoipProcess()
- : PProcess("Open Phone Abstraction Library", "SsVoip",
+VoipProcess::VoipProcess()
+ : PProcess("Open Phone Abstraction Library", "Voip",
MAJOR_VERSION, MINOR_VERSION, BUILD_TYPE, BUILD_NUMBER)
{
}
-void SsVoipProcess::Main()
+void VoipProcess::Main()
{
cout << GetName()
<< " Version " << GetVersion(TRUE)
@@ -262,7 +262,7 @@
ourId = args.GetOptionString("id");
PTRACE(3, "our ID is " << ourId);
} else {
- ourId = "ssvoip";
+ ourId = "voip";
PTRACE(3, "Select a default ID of " << ourId);
}
@@ -273,7 +273,7 @@
ourPassword = args.GetOptionString("password");
PTRACE(3, "our password is " << ourPassword);
} else {
- ourPassword = "ssvoip";
+ ourPassword = "voip";
PTRACE(3, "Select a default password of " << ourPassword);
}
Modified: sofaswitch/trunk/voip/main.h
==============================================================================
--- sofaswitch/trunk/voip/main.h (original)
+++ sofaswitch/trunk/voip/main.h Tue Aug 8 19:07:15 2006
@@ -27,8 +27,8 @@
*
*/
-#ifndef _SsVoip_MAIN_H
-#define _SsVoip_MAIN_H
+#ifndef _Voip_MAIN_H
+#define _Voip_MAIN_H
#include <ptlib.h>
@@ -44,13 +44,13 @@
class MyManager;
/**The class that launches everything */
-class SsVoipProcess : public PProcess
+class VoipProcess : public PProcess
{
- PCLASSINFO(SsVoipProcess, PProcess);
+ PCLASSINFO(VoipProcess, PProcess);
public:
/**Constructor */
- SsVoipProcess();
+ VoipProcess();
/**The main thread of execution starts here */
void Main();
@@ -59,8 +59,8 @@
MyManager * GetManager() { return opal; }
/**Catch all which can be used anywhere to access this class */
- static SsVoipProcess & Current()
- { return (SsVoipProcess &)PProcess::Current(); }
+ static VoipProcess & Current()
+ { return (VoipProcess &)PProcess::Current(); }
protected:
@@ -71,7 +71,7 @@
};
-#endif // _SsVoip_MAIN_H
+#endif // _Voip_MAIN_H
// End of File ///////////////////////////////////////////////////////////////
Modified: sofaswitch/trunk/voip/mymanager.h
==============================================================================
--- sofaswitch/trunk/voip/mymanager.h (original)
+++ sofaswitch/trunk/voip/mymanager.h Tue Aug 8 19:07:15 2006
@@ -28,8 +28,8 @@
*
*/
-#ifndef _SsVoip_MANAGER_H
-#define _SsVoip_MANAGER_H
+#ifndef _Voip_MANAGER_H
+#define _Voip_MANAGER_H
#ifdef P_USE_PRAGMA
@@ -270,7 +270,7 @@
-#endif // _SsVoip_MANAGER_H
+#endif // _Voip_MANAGER_H
// End of File ///////////////////////////////////////////////////////////////
Modified: sofaswitch/trunk/voip/overview.cxx
==============================================================================
--- sofaswitch/trunk/voip/overview.cxx (original)
+++ sofaswitch/trunk/voip/overview.cxx Tue Aug 8 19:07:15 2006
@@ -81,7 +81,7 @@
\li Comms - Does the comms with the remote controller
\li MyOpalCall - Descendent of OpalCall
-\li SsVoipProcess - The master class, which contains main(int argc, char** argv)
+\li VoipProcess - The master class, which contains main(int argc, char** argv)
\li MyManager - Does the work of controlling things
\li MyUdpSsEndPoint - manages the creation & handling of MyUdpSsConnections
\li Supervisor - The comms instance for the manager
Modified: sofaswitch/trunk/voip/supervisor.cxx
==============================================================================
--- sofaswitch/trunk/voip/supervisor.cxx (original)
+++ sofaswitch/trunk/voip/supervisor.cxx Tue Aug 8 19:07:15 2006
@@ -77,13 +77,13 @@
}
PString anyCommsId;
- SsVoipProcess::Current().GetManager()->StartCall(cmds[1], sender, anyCommsId);
+ VoipProcess::Current().GetManager()->StartCall(cmds[1], sender, anyCommsId);
}
void Supervisor::ProcessStatusQuery(PStringArray &cmds, PString & sender)
{
PString status;
- status = SsVoipProcess::Current().GetManager()->GetStatusInfo();
+ status = VoipProcess::Current().GetManager()->GetStatusInfo();
SendThisMessageTo(status, sender);
}
@@ -103,14 +103,14 @@
{
SetRemoteController(sender);
PTRACE(3, "Supervisor says::End everything now");
- SsVoipProcess::Current().GetManager()->EndEverything();
+ VoipProcess::Current().GetManager()->EndEverything();
PTRACE(3, "Supervisor says::End everything now, and it has been initiated.");
}
void Supervisor::SilentlyEndAll()
{
PTRACE(3, "Supervisor says::End everything now");
- SsVoipProcess::Current().GetManager()->EndEverything();
+ VoipProcess::Current().GetManager()->EndEverything();
}
void Supervisor::ProcessHangup(PStringArray &cmds, PString & sender)
@@ -121,7 +121,7 @@
void Supervisor::ProcessRequestNewId(PStringArray &/*cmds*/, PString & sender)
{
- SsVoipProcess::Current().GetManager()->RequestNewId(sender);
+ VoipProcess::Current().GetManager()->RequestNewId(sender);
}
// End of File ///////////////////////////////////////////////////////////////
Modified: sofaswitch/trunk/voip/version.h
==============================================================================
--- sofaswitch/trunk/voip/version.h (original)
+++ sofaswitch/trunk/voip/version.h Tue Aug 8 19:07:15 2006
@@ -1,7 +1,7 @@
/*
* version.h
*
- * Version number header file for SSVoip
+ * Version number header file for Voip
*
* An application to control voip via messages from a remote node
*
@@ -35,8 +35,8 @@
* openh323: v1.12.3 CVS tag:
*/
-#ifndef _SSVoip_VERSION_H
-#define _SSVoip_VERSION_H
+#ifndef _Voip_VERSION_H
+#define _Voip_VERSION_H
#define MAJOR_VERSION 1
#define MINOR_VERSION 0
@@ -44,7 +44,7 @@
#define BUILD_NUMBER 0
-#endif // _SSVoip_VERSION_H
+#endif // _Voip_VERSION_H
// End of File ///////////////////////////////////////////////////////////////
1
0
08 Aug '06
Author: derek
Date: Tue Aug 8 18:08:02 2006
New Revision: 59
Modified:
sofaswitch/trunk/server/main.cxx
sofaswitch/trunk/server/main.h
sofaswitch/trunk/sofa/src/messages.cxx
Log:
Add ability for server to generate a unique ID. This is useful for when there are
multiple controllers, and we don't know the id of the other controllers.
Add command to query server, and ask the server what our id is. This command is used
when we ask the server to assign us an ID.
Add facility so that when node X dies on the server, the server will advise node Y.
This is useful to handle the case when node X crashes.
Modified: sofaswitch/trunk/server/main.cxx
==============================================================================
--- sofaswitch/trunk/server/main.cxx (original)
+++ sofaswitch/trunk/server/main.cxx Tue Aug 8 18:08:02 2006
@@ -254,6 +254,14 @@
void Manager::AppendRunning(PSafePtr<TcpConnection> conn, const PString & id)
{
PTRACE(3, "Manager\tAppendRunning " << *conn);
+
+ if (id == PString("?")) {
+ conn->GenerateSourceId();
+ PTRACE(3, "ADD " << conn->GetSourceId() << " which is a random Id");
+ connectionsActive.SetAt(conn->GetSourceId(), conn);
+ return;
+ }
+
if (connectionsActive.Contains(id)) {
cerr << " ERROR - CANNOT add this id " << id << " it already exits" << endl;
PTRACE(3, "Cannot cope with duplicate instances of the id " << id);
@@ -347,6 +355,24 @@
TcpConnection::~TcpConnection()
{
PTRACE(3, "Destroy this connection " << *this << " now");
+
+ if (!adviseOnTermination.IsEmpty()) {
+ PStringStream msg;
+ cerr << "send terminating message to "<< adviseOnTermination << " from "
+ << sourceId << endl;
+ msg << sourceId << ":Terminating";
+ PSafePtr <TcpConnection> conn = manager.GetConnectionWithLock(adviseOnTermination,
+ PSafeReadOnly);
+ if (conn != NULL) {
+ PBYTEArray binary;
+ binary.SetSize(msg.GetSize());
+ memcpy(binary.GetPointer(), msg.GetPointer(), msg.GetLength());
+ binary[msg.GetSize()] = 0;
+ conn->SendThisMessage(binary);
+ }
+
+ }
+
PWaitAndSignal m(incomingLock);
if (incomingMessages != NULL) {
@@ -361,7 +387,14 @@
DecCountTcpConnections();
}
+void TcpConnection::GenerateSourceId()
+{
+ PINDEX thisId = manager.GetNewUniqueId();
+ PString newId = psprintf("c%d", thisId);
+ AssignSourceId(newId);
+}
+
void TcpConnection::StartRunning()
{
/* If the messagesSocket is bad/closed, the incomingMessages thread
@@ -668,6 +701,21 @@
messagesSocket.Close();
manager.QuitNow();
return;
+ }
+
+ if (txt.Left(6) *= PString("WhoAmI")){
+ PBYTEArray answer;
+ answer.SetSize(sourceId.GetLength() + 1);
+ memcpy(answer.GetPointer(), sourceId.GetPointer(), sourceId.GetLength());
+ answer[sourceId.GetLength()] = 0;
+ SendThisMessage(answer);
+ return;
+ }
+
+ if (txt.Left(19) *= PString("AdviseOnTermination")) {
+ PStringArray msg = txt.Tokenise(" ");
+ adviseOnTermination = msg[1];
+ return;
}
if (txt.Left(6) *= PString("status")) {
Modified: sofaswitch/trunk/server/main.h
==============================================================================
--- sofaswitch/trunk/server/main.h (original)
+++ sofaswitch/trunk/server/main.h Tue Aug 8 18:08:02 2006
@@ -68,6 +68,12 @@
accept it */
void AssignSourceId(PString & newId) { sourceId = newId; }
+ /**The remote node has no idea what to use for a source ID. Consequently, we have to
+generate a source ID here, and advise the remote node what the source
+ID is. This method will alos assign the source id to this class. This method
+is called wwhen this class is created. */
+ void GenerateSourceId();
+
/**Report the source id as used by this connection */
PString GetSourceId() { return sourceId; }
@@ -193,6 +199,11 @@
on a random number. It is used to uniquely identify this class,
wherever it is */
PString globalUniqueId;
+
+ /** Set the node to advise on death of this connection. For example, the
+ voip node for one circuit will use this, as a means to advise the
+ controller that it has died. */
+ PString adviseOnTermination;
};
////////////////////////////////////////////////////////////////////////////////
@@ -324,6 +335,9 @@
used on those TcpConnection instances that do not start up
correctly */
PString GetNextBogusId();
+
+ /**Get the index of the next unique ID that we are generating */
+ PINDEX GetNewUniqueId() { return ++uniqueIdGenerator; }
protected:
/**The thread safe list of connections that we manage */
@@ -352,6 +366,9 @@
/**The count of all threads that have beeen spawned to process messages*/
PAtomicInteger connectionCount;
+
+ /**The count of all the number of unique ID's we have created */
+ PAtomicInteger uniqueIdGenerator;
/**A class that manages the list of available TcpConnection threads */
TcpConnectionList availableTcpConnections;
Modified: sofaswitch/trunk/sofa/src/messages.cxx
==============================================================================
--- sofaswitch/trunk/sofa/src/messages.cxx (original)
+++ sofaswitch/trunk/sofa/src/messages.cxx Tue Aug 8 18:08:02 2006
@@ -449,7 +449,6 @@
PTRACE(3, "Failed to send message " << messagesSocket.GetErrorText());
}
writeMessageLock.Signal();
-
}
void MessageFrame::ProcessMessage(PString message, PString sender)
@@ -896,6 +895,17 @@
{
remoteController = rc;
PTRACE(3, "SET Remote controller to " << remoteController);
+
+ PStringStream message;
+ message << "AdviseOnTermination " << rc;
+ PBYTEArray binary;
+ binary.SetSize(message.GetSize());
+ memcpy(binary.GetPointer(), message.(), message.GetLength());
+ binary[message.GetLength()] = 0;
+
+ writeMessageLock.Wait();
+ messagesSocket.Write(binary.GetPointer(), binary.GetSize());
+ writeMessageLock.Signal();
}
1
0
Author: derek
Date: Tue Aug 8 00:27:32 2006
New Revision: 58
Removed:
sofaswitch/trunk/prompts/dtmf_*.wav
Log:
Remove this file, as windows/linux don't like the filename.
1
0