Author: derek Date: Thu Jan 11 21:52:03 2007 New Revision: 230 Modified: sofaswitch/trunk/voip/comms.cxx sofaswitch/trunk/voip/counts.cxx sofaswitch/trunk/voip/jocall.h sofaswitch/trunk/voip/main.cxx sofaswitch/trunk/voip/mymanager.cxx sofaswitch/trunk/voip/mymanager.h sofaswitch/trunk/voip/udpconnection.cxx sofaswitch/trunk/voip/udpep.cxx sofaswitch/trunk/voip/udpep.h sofaswitch/trunk/voip/udpsound.cxx Log: Tidy tidy tidy. Alter log levels to be less verbose. Modified: sofaswitch/trunk/voip/comms.cxx ============================================================================== --- sofaswitch/trunk/voip/comms.cxx (original) +++ sofaswitch/trunk/voip/comms.cxx Thu Jan 11 21:52:03 2007 @@ -241,7 +241,7 @@ PUDPSocket & Comms::GetAudioSocket() { - PTRACE(3, "Return reference to audio socket"); + PTRACE(6, "Return reference to audio socket"); return audioSocket; } //////////////////////////////////////////////////////////////////////////////// Modified: sofaswitch/trunk/voip/counts.cxx ============================================================================== --- sofaswitch/trunk/voip/counts.cxx (original) +++ sofaswitch/trunk/voip/counts.cxx Thu Jan 11 21:52:03 2007 @@ -113,29 +113,24 @@ << ::setw(6) << PString(countDelUdpSoundChannel) << ::setw(6) << PString(countUdpSoundChannel - countDelUdpSoundChannel) << ::setw(0); - PTRACE(1, "Get count udp sound channel " << msg); return msg; } -void DecComms() { ++countDelComms; } -void DecMyManager() { ++countDelMyManager; } -void DecMyOpalCall() { ++countDelMyOpalCall; } +void DecComms() { ++countDelComms; } +void DecMyManager() { ++countDelMyManager; } +void DecMyOpalCall() { ++countDelMyOpalCall; } void DecOpalUdpSsConnection() { ++countDelOpalUdpSsConnection; } -void DecOpalUdpSsEndPoint() { ++countDelOpalUdpSsEndPoint; } -void DecSupervisor() { ++countDelSupervisor; } -void DecUdpSoundChannel() { ++countDelUdpSoundChannel; } - -void IncComms() { ++countComms; } -void IncMyManager() { ++countMyManager; } -void IncMyOpalCall() { ++countMyOpalCall; } +void DecOpalUdpSsEndPoint() { ++countDelOpalUdpSsEndPoint; } +void DecSupervisor() { ++countDelSupervisor; } +void DecUdpSoundChannel() { ++countDelUdpSoundChannel; } + +void IncComms() { ++countComms; } +void IncMyManager() { ++countMyManager; } +void IncMyOpalCall() { ++countMyOpalCall; } void IncOpalUdpSsConnection() { ++countOpalUdpSsConnection; } -void IncOpalUdpSsEndPoint() { ++countOpalUdpSsEndPoint; } -void IncSupervisor() { ++countSupervisor; } -void IncUdpSoundChannel() -{ - PTRACE(1, "Inc count udp sound channel"); - ++countUdpSoundChannel; -} +void IncOpalUdpSsEndPoint() { ++countOpalUdpSsEndPoint; } +void IncSupervisor() { ++countSupervisor; } +void IncUdpSoundChannel() { ++countUdpSoundChannel; } Modified: sofaswitch/trunk/voip/jocall.h ============================================================================== --- sofaswitch/trunk/voip/jocall.h (original) +++ sofaswitch/trunk/voip/jocall.h Thu Jan 11 21:52:03 2007 @@ -37,8 +37,8 @@ #endif #include <opal/call.h> +#include "comms.h" -class Comms; class MyManager; /** A class the combines the OpalCall structure from OPAL with our protocol Modified: sofaswitch/trunk/voip/main.cxx ============================================================================== --- sofaswitch/trunk/voip/main.cxx (original) +++ sofaswitch/trunk/voip/main.cxx Thu Jan 11 21:52:03 2007 @@ -107,7 +107,6 @@ "s-server:" "i-id:" "-password:" - "-controller:" #if PTRACING "o-output:" #endif @@ -234,7 +233,6 @@ " -h --help : This help message.\n" " --server srv/id : server to connect to, which labels us as ID \n" " --password pwd : password to use\n" - " --controller cntrl : remote entity which controls us\n" "\n" << endl; return; @@ -277,17 +275,8 @@ PTRACE(3, "Select a default password of " << ourPassword); } - PString ourController; - if (args.HasOption("controller")) { - ourController = args.GetOptionString("controller"); - PTRACE(3, "remote controller is " << ourController); - } else { - ourController = "controller"; - PTRACE(3, "remote controller is set to " << ourController << " which is the default"); - } - LaunchNewId lid(ourId, ourPassword); - opal = new MyManager(lid, ourController, ourId, ourPassword); + opal = new MyManager(lid, ourId, ourPassword); if (opal->Initialise(args)) { opal->Main(args); Modified: sofaswitch/trunk/voip/mymanager.cxx ============================================================================== --- sofaswitch/trunk/voip/mymanager.cxx (original) +++ sofaswitch/trunk/voip/mymanager.cxx Thu Jan 11 21:52:03 2007 @@ -80,7 +80,6 @@ /////////////////////////////////////////////////////////////// MyManager::MyManager(LaunchNewId & _lid, - PString & _controllerId, PString & _ourId, PString & _ourPassword) : lid(_lid), supervisor(*(new Supervisor(lid))) @@ -89,8 +88,6 @@ allocationNumber = 0; IncMyManager(); - - controllerId = _controllerId; ourId = _ourId; ourPassword = _ourPassword; @@ -702,7 +699,7 @@ } PTRACE(3, "Now, we have to leave a wait period"); - cerr << "Allow all the current comms instances to end " << endl; + PThread::Sleep(2000); PTRACE(3, "Finished the 2 second wait for comms to die"); @@ -920,6 +917,12 @@ OpalManager::OnAlerting(connection); } +PString MyManager::GetControllerId() +{ + return supervisor.GetRemoteController(); +} + + /* The comment below is magic for those who use emacs to edit this file. */ /* With the comment below, the tab key does auto indent to 2 spaces. */ Modified: sofaswitch/trunk/voip/mymanager.h ============================================================================== --- sofaswitch/trunk/voip/mymanager.h (original) +++ sofaswitch/trunk/voip/mymanager.h Thu Jan 11 21:52:03 2007 @@ -61,7 +61,7 @@ public: /**Constructor */ - MyManager(LaunchNewId & lid, PString & controllerId, PString & ourId, PString & ourPassword); + MyManager(LaunchNewId & lid, PString & ourId, PString & ourPassword); /**destructor */ ~MyManager(); @@ -136,7 +136,7 @@ PString GetOurId() { return ourId; } /**Return the id of the remote controller */ - PString GetControllerId() { return controllerId; } + PString GetControllerId(); /**Set up a call between two parties. This is used to initiate a call. Incoming calls are "answered" using a @@ -249,11 +249,6 @@ /**The IAX2 endpoint that is used for controlling h323 calls */ IAX2EndPoint * iax2EP; #endif - - /**The unique ID that identifies the remote controller who is - responsible for the overview of this sofaswitch */ - PString controllerId; - /**An enity which could be used when logging in to the server */ PString ourPassword; Modified: sofaswitch/trunk/voip/udpconnection.cxx ============================================================================== --- sofaswitch/trunk/voip/udpconnection.cxx (original) +++ sofaswitch/trunk/voip/udpconnection.cxx Thu Jan 11 21:52:03 2007 @@ -117,7 +117,7 @@ if (mediaStreams.IsEmpty()) phase = ConnectedPhase; else { - PTRACE(3, "ZZZ\t there are " << mediaStreams.GetSize() << " current media stream "); + PTRACE(5, "UdpSs\t there are " << mediaStreams.GetSize() << " current media stream "); phase = EstablishedPhase; OnEstablished(); } Modified: sofaswitch/trunk/voip/udpep.cxx ============================================================================== --- sofaswitch/trunk/voip/udpep.cxx (original) +++ sofaswitch/trunk/voip/udpep.cxx Thu Jan 11 21:52:03 2007 @@ -74,7 +74,13 @@ DecOpalUdpSsEndPoint(); } - +BOOL OpalUdpSsEndPoint::MakeConnection(OpalCall & call, + const PString & remoteParty, + void * userData) +{ + return MakeConnection(call, remoteParty, userData, 0); +} + BOOL OpalUdpSsEndPoint::MakeConnection(OpalCall & call, Modified: sofaswitch/trunk/voip/udpep.h ============================================================================== --- sofaswitch/trunk/voip/udpep.h (original) +++ sofaswitch/trunk/voip/udpep.h Thu Jan 11 21:52:03 2007 @@ -107,6 +107,16 @@ unsigned int options = 0 ///< options to pass to conneciton ); + /**This filler method is identical to that above, and is provided as a + convenience, when working against different library versions.*/ + virtual BOOL MakeConnection( + OpalCall & call, ///< Owner of connection + const PString & party, ///< Remote party to call + void * userData = NULL ///< Arbitrary data to pass to connection + ); + + + /**Get the data formats this endpoint is capable of operating. This provides a list of media data format names that may be used by an OpalMediaStream may be created by a connection from this endpoint. Modified: sofaswitch/trunk/voip/udpsound.cxx ============================================================================== --- sofaswitch/trunk/voip/udpsound.cxx (original) +++ sofaswitch/trunk/voip/udpsound.cxx Thu Jan 11 21:52:03 2007 @@ -59,7 +59,7 @@ audioSocket(_myOpalCall.GetAudioSocket()), isSource(_isSource) { IncUdpSoundChannel(); - PTRACE(3, "ZZZ\tCreate UdpSoundSocket for " << GetSSLabel(isSource)); + PTRACE(6, "ZZZ\tCreate UdpSoundSocket for " << GetSSLabel(isSource)); os_handle = -2; } @@ -68,7 +68,7 @@ os_handle = -1; readQueue.Close(); - PTRACE(3, "UdpSoundChannel " << *this << " destroyed."); + PTRACE(6, "UdpSoundChannel " << *this << " destroyed."); DecUdpSoundChannel(); } @@ -103,7 +103,7 @@ { PTRACE(6, "Write " << amount << " bytes to the socket"); if (!IsOpen()) { - PTRACE(1, "Write failed as this sound channel is closed"); + PTRACE(3, "Write failed as this sound channel is closed"); return FALSE; } @@ -130,7 +130,7 @@ BOOL UdpSoundChannel::Read(void * buffer, PINDEX amount) { if (!IsOpen()) { - PTRACE(1, "Read failed as this sound channel is closed"); + PTRACE(3, "Read failed as this sound channel is closed"); return FALSE; } @@ -147,7 +147,7 @@ PTRACE(1, "The read of a packet from a socket failed for " << GetSSLabel(isSource)); return FALSE; } - PTRACE(4, "The socket provided us with " << audioSocket.GetLastReadCount() << " bytes"); + PTRACE(5, "The socket provided us with " << audioSocket.GetLastReadCount() << " bytes"); readOk = readQueue.Write(readBuffer.GetPointer(), audioSocket.GetLastReadCount()); PTRACE(5, "The readqueue now has a size of " << readQueue.GetLength() << " bytes"); @@ -167,7 +167,7 @@ BOOL UdpSoundChannel::Close() { PTRACE(3, "Close audio channel now for " << GetSSLabel(isSource)); - PTRACE(5, "os_handle or fd = " << os_handle); + PTRACE(6, "os_handle or fd = " << os_handle); audioSocket.Close(); os_handle = -1;
participants (1)
-
SofaSWITCH SVN