[Sofaswitch-svn] [commit] r67 - sofaswitch/trunk/voip
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()
participants (1)
-
SofaSWITCH SVN