[Sofaswitch-svn] [commit] r235 - in sofaswitch/trunk: server voip
Author: derek Date: Tue Jan 16 22:41:35 2007 New Revision: 235 Modified: sofaswitch/trunk/server/main.cxx sofaswitch/trunk/voip/comms.cxx sofaswitch/trunk/voip/udpconnection.cxx sofaswitch/trunk/voip/udpconnection.h Log: Tidy up the formatting of messages, add new callback to the voip module. Add more options, so handle more possibilities for the voipNode:Answer xxxx cmd. Modified: sofaswitch/trunk/server/main.cxx ============================================================================== --- sofaswitch/trunk/server/main.cxx (original) +++ sofaswitch/trunk/server/main.cxx Tue Jan 16 22:41:35 2007 @@ -122,9 +122,6 @@ localManager.WaitForEmpty(); PTRACE(3, "delete the manager, as it is now the end of this program "); - PTRACE(3, "delete the manager, as it is now the end of this program "); - PTRACE(3, "delete the manager, as it is now the end of this program "); - PTRACE(3, "delete the manager, as it is now the end of this program "); } //////////////////////////////////////////////////////////////////////////////// @@ -696,7 +693,7 @@ PStringStream msg; msg << GetNow() - << ::setw(30) << sourceId << " : " + << " " <<sourceId << ::setw(25) << " " << ::setw(0) << txt << endl; PWaitAndSignal m(outputMutex); cerr << msg; @@ -827,15 +824,16 @@ void TcpConnection::SendThisMessage(PBYTEArray & message) { - PTRACE(1, "SEND " << PString((const char *)message.GetPointer(), message.GetSize())); + PTRACE(1, "SEND " + << PString((const char *)message.GetPointer(), message.GetSize())); writeMessageLock.Wait(); messagesSocket.Write(message.GetPointer(), message.GetSize()); writeMessageLock.Signal(); IncCountSent(); if (reportSentMessages) { PStringStream msg; - msg << GetNow() << ::setw(30) - << " " << ::setw(0) << "-->" + msg << GetNow() << ::setw(18) + << " " << sourceId << ::setw(0) << " --> " << PString((const char *)message.GetPointer(), message.GetSize() - 1) << endl; PWaitAndSignal m(outputMutex); @@ -843,7 +841,7 @@ } } -//////////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////// void TcpConnectionList::Initialise() { Modified: sofaswitch/trunk/voip/comms.cxx ============================================================================== --- sofaswitch/trunk/voip/comms.cxx (original) +++ sofaswitch/trunk/voip/comms.cxx Tue Jan 16 22:41:35 2007 @@ -184,11 +184,12 @@ BOOL doAnswer = FALSE; BOOL doAnswerDefined= FALSE; if (cmds.GetSize() > 1) { - if (cmds[1] *= "true") { + if ((cmds[1] *= "true") || (cmds[1] *= "yes") || (cmds[1] *= "accept")) { doAnswer = TRUE; doAnswerDefined = TRUE; } - if (cmds[1] *= "false") { + + if ((cmds[1] *= "false") || (cmds[1] *= "no") || (cmds[1] *= "reject")) { doAnswer = FALSE; doAnswerDefined = TRUE; } @@ -200,7 +201,8 @@ if (!doAnswerDefined) { PTRACE(0, "Answer command did not correctly specify what to do "); - return; + PTRACE(0, "The command \"" << cmds[1] << "\" was not understood -- sorry"); + doAnswer = FALSE; } if(!doAnswer) { PTRACE(3, "Reject this call"); Modified: sofaswitch/trunk/voip/udpconnection.cxx ============================================================================== --- sofaswitch/trunk/voip/udpconnection.cxx (original) +++ sofaswitch/trunk/voip/udpconnection.cxx Tue Jan 16 22:41:35 2007 @@ -168,6 +168,11 @@ return new OpalAudioMediaStream(mediaFormat, sessionID, isSource, 2, soundChannel); } +void OpalUdpSsConnection::CloseMediaStreams() +{ + PTRACE(5, "OpalUdpSsConnection::CloseMediaStreams"); + OpalConnection::CloseMediaStreams(); +} BOOL OpalUdpSsConnection::OnOpenMediaStream(OpalMediaStream & mediaStream) { @@ -187,6 +192,12 @@ return TRUE; } +void OpalUdpSsConnection::Release(CallEndReason reason) +{ + ((MyOpalCall &)(GetCall())).CloseThisId(); + OpalConnection::Release(reason); +} + PSoundChannel * OpalUdpSsConnection::CreateSoundChannel(BOOL isSource) { Modified: sofaswitch/trunk/voip/udpconnection.h ============================================================================== --- sofaswitch/trunk/voip/udpconnection.h (original) +++ sofaswitch/trunk/voip/udpconnection.h Tue Jan 16 22:41:35 2007 @@ -161,6 +161,10 @@ virtual BOOL SendUserInputString( const PString & value /// String value of indication ); + + /**Close media streams for session. + */ + virtual void CloseMediaStreams(); //@} /**@name New operations */ @@ -178,6 +182,20 @@ virtual PSoundChannel * CreateSoundChannel( BOOL isSource // Direction for channel ); + + /**Release the current connection. + This removes the connection from the current call. The call may + continue if there are other connections still active on it. If this was + the last connection for the call then the call is disposed of as well. + + Note that this function will return quickly as the release and + disposal of the connections is done by another thread. + */ + virtual void Release( + CallEndReason reason = EndedByLocalUser ///< Reason for call release + ); + + //@}
participants (1)
-
SofaSWITCH SVN