You can subscribe to this list here.
| 2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2009 |
Jan
(5) |
Feb
(6) |
Mar
(1) |
Apr
(8) |
May
(5) |
Jun
(12) |
Jul
(38) |
Aug
|
Sep
|
Oct
(11) |
Nov
(21) |
Dec
(6) |
| 2010 |
Jan
(16) |
Feb
(15) |
Mar
(11) |
Apr
(1) |
May
|
Jun
(3) |
Jul
(13) |
Aug
|
Sep
(17) |
Oct
(16) |
Nov
|
Dec
(3) |
| 2011 |
Jan
(8) |
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Vyacheslav F. <vf...@us...> - 2010-10-06 16:34:20
|
Update of /cvsroot/t38modem/t38modem/h323lib In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv8303 Added Files: audio_chan.cxx audio_chan.h Log Message: Initial revision --- NEW FILE: audio_chan.cxx --- /* * audio_chan.cxx * * T38FAX Pseudo Modem * * Copyright (c) 2010 Vyacheslav Frolov * * t38modem Project * * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See * the License for the specific language governing rights and limitations * under the License. * * The Original Code is t38modem. * * The Initial Developer of the Original Code is Vyacheslav Frolov * * Contributor(s): * * $Log: audio_chan.cxx,v $ * Revision 1.1 2010/10/06 16:34:10 vfrolov * Initial revision * */ #include <ptlib.h> #include "audio_chan.h" #include "../audio.h" #include "../pmodem.h" #define new PNEW /////////////////////////////////////////////////////////////// ModemAudioChannel::ModemAudioChannel(PBoolean out, PseudoModem * pmodem) : audioEngine(pmodem->NewPtrAudioEngine()) , outDirection(out) { if (audioEngine != NULL) { if (outDirection) audioEngine->OpenOut(EngineBase::HOWNEROUT(this)); else audioEngine->OpenIn(EngineBase::HOWNERIN(this)); } } ModemAudioChannel::~ModemAudioChannel() { if (audioEngine != NULL) { if (outDirection) audioEngine->CloseOut(EngineBase::HOWNEROUT(this)); else audioEngine->CloseIn(EngineBase::HOWNERIN(this)); ReferenceObject::DelPointer(audioEngine); } } PBoolean ModemAudioChannel::Read(void * buffer, PINDEX amount) { if (!audioEngine->Read(EngineBase::HOWNEROUT(this), buffer, amount)) return FALSE; lastReadCount = amount; return TRUE; } PBoolean ModemAudioChannel::Write(const void * buffer, PINDEX len) { if (!audioEngine->Write(EngineBase::HOWNERIN(this), buffer, len)) return FALSE; lastWriteCount = len; return TRUE; } /////////////////////////////////////////////////////////////// --- NEW FILE: audio_chan.h --- /* * audio_chan.h * * T38FAX Pseudo Modem * * Copyright (c) 2010 Vyacheslav Frolov * * t38modem Project * * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See * the License for the specific language governing rights and limitations * under the License. * * The Original Code is t38modem. * * The Initial Developer of the Original Code is Vyacheslav Frolov * * Contributor(s): * * $Log: audio_chan.h,v $ * Revision 1.1 2010/10/06 16:34:10 vfrolov * Initial revision * */ #ifndef _AUDIO_CHAN_H #define _AUDIO_CHAN_H /////////////////////////////////////////////////////////////// class AudioEngine; class PseudoModem; /////////////////////////////////////////////////////////////// class ModemAudioChannel : public PChannel { PCLASSINFO(ModemAudioChannel, PChannel); public: /**@name Construction */ //@{ ModemAudioChannel(PBoolean out, PseudoModem * pmodem); ~ModemAudioChannel(); //@} /**@name Operations */ //@{ PBoolean IsOK() const { return audioEngine != NULL; } PBoolean Read(void * buffer, PINDEX amount); PBoolean Write(const void * buffer, PINDEX len); //@} private: AudioEngine * audioEngine; PBoolean outDirection; }; /////////////////////////////////////////////////////////////// #endif // _AUDIO_CHAN_H |
|
From: Vyacheslav F. <vf...@us...> - 2010-10-06 10:13:31
|
Update of /cvsroot/t38modem/t38modem In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv10599 Modified Files: pmodeme.cxx Log Message: Fixed previous fix Index: pmodeme.cxx =================================================================== RCS file: /cvsroot/t38modem/t38modem/pmodeme.cxx,v retrieving revision 1.98 retrieving revision 1.99 diff -C2 -d -r1.98 -r1.99 *** pmodeme.cxx 6 Oct 2010 09:06:48 -0000 1.98 --- pmodeme.cxx 6 Oct 2010 10:13:23 -0000 1.99 *************** *** 25,28 **** --- 25,31 ---- * * $Log$ + * Revision 1.99 2010/10/06 10:13:23 vfrolov + * Fixed previous fix + * * Revision 1.98 2010/10/06 09:06:48 vfrolov * Fixed crash at dialing reset (reported by gorod225) *************** *** 3690,3695 **** PString resp = RC_PREF(); ! if (currentClassEngine && P.ModemClassId() == EngineBase::mcAudio) { ! currentClassEngine->ResetModemState(); resp += RC_OK(); } else { --- 3693,3700 ---- PString resp = RC_PREF(); ! if (currentClassEngine || P.ModemClassId() == EngineBase::mcAudio) { ! if (currentClassEngine) ! currentClassEngine->ResetModemState(); ! resp += RC_OK(); } else { |
|
From: Vyacheslav F. <vf...@us...> - 2010-10-06 09:06:57
|
Update of /cvsroot/t38modem/t38modem In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv17025 Modified Files: pmodeme.cxx Log Message: Fixed crash at dialing reset (reported by gorod225) Index: pmodeme.cxx =================================================================== RCS file: /cvsroot/t38modem/t38modem/pmodeme.cxx,v retrieving revision 1.97 retrieving revision 1.98 diff -C2 -d -r1.97 -r1.98 *** pmodeme.cxx 29 Sep 2010 11:52:59 -0000 1.97 --- pmodeme.cxx 6 Oct 2010 09:06:48 -0000 1.98 *************** *** 25,28 **** --- 25,31 ---- * * $Log$ + * Revision 1.98 2010/10/06 09:06:48 vfrolov + * Fixed crash at dialing reset (reported by gorod225) + * * Revision 1.97 2010/09/29 11:52:59 vfrolov * Redesigned engine attaching/detaching *************** *** 3687,3691 **** PString resp = RC_PREF(); ! if (currentClassEngine || P.ModemClassId() == EngineBase::mcAudio) { currentClassEngine->ResetModemState(); resp += RC_OK(); --- 3690,3694 ---- PString resp = RC_PREF(); ! if (currentClassEngine && P.ModemClassId() == EngineBase::mcAudio) { currentClassEngine->ResetModemState(); resp += RC_OK(); |
|
From: Vyacheslav F. <vf...@us...> - 2010-09-29 11:53:08
|
Update of /cvsroot/t38modem/t38modem In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv18488 Modified Files: enginebase.cxx enginebase.h pmodem.h pmodeme.cxx pmodeme.h pmodemi.cxx pmodemi.h t38engine.h Log Message: Redesigned engine attaching/detaching Index: pmodeme.cxx =================================================================== RCS file: /cvsroot/t38modem/t38modem/pmodeme.cxx,v retrieving revision 1.96 retrieving revision 1.97 diff -C2 -d -r1.96 -r1.97 *** pmodeme.cxx 22 Sep 2010 15:51:13 -0000 1.96 --- pmodeme.cxx 29 Sep 2010 11:52:59 -0000 1.97 *************** *** 25,28 **** --- 25,31 ---- * * $Log$ + * Revision 1.97 2010/09/29 11:52:59 vfrolov + * Redesigned engine attaching/detaching + * * Revision 1.96 2010/09/22 15:51:13 vfrolov * Moved ResetModemState() to EngineBase *************** *** 722,725 **** --- 725,747 ---- #endif /////////////////////////////////////////////////////////////// + enum ModemClassEngine { + mceAudio, + mceT38, + mceNumberOfItems, + }; + + #if PTRACING + static ostream & operator<<(ostream & out, ModemClassEngine mce) + { + switch (mce) { + case mceAudio: return out << "mceAudio"; + case mceT38: return out << "mceT38"; + default: break; + } + + return out << "mce" << INT(mce); + } + #endif + /////////////////////////////////////////////////////////////// #define DeclareResultCode(name, v0, v1) \ PString name() const { return P.asciiResultCodes() ? (v1) : (v0); } *************** *** 739,746 **** //@{ PBoolean Request(PStringToString &request); ! PBoolean Attach(T38Engine *_t38engine); ! void Detach(T38Engine *_t38engine) { PWaitAndSignal mutexWait(Mutex); _Detach(_t38engine); } ! PBoolean Attach(AudioEngine *_audioEngine); ! void Detach(AudioEngine *_audioEngine) { PWaitAndSignal mutexWait(Mutex); _Detach(_audioEngine); } void OnParentStop(); void HandleData(const PBYTEArray &buf, PBYTEArray &bresp); --- 761,765 ---- //@{ PBoolean Request(PStringToString &request); ! EngineBase *NewPtrEngine(ModemClassEngine mce); void OnParentStop(); void HandleData(const PBYTEArray &buf, PBYTEArray &bresp); *************** *** 857,862 **** } ! void _Detach(T38Engine *_t38engine); ! void _Detach(AudioEngine *_audioEngine); void _ClearCall(); --- 876,881 ---- } ! void _AttachEngine(ModemClassEngine mce); ! void _DetachEngine(ModemClassEngine mce); void _ClearCall(); *************** *** 865,877 **** ModemEngine &parent; - T38Engine *t38engine; - AudioEngine *audioEngine; - - enum { - mceAudio, - mceFax, - mceNumberOfItems, - }; - EngineBase *activeEngines[mceNumberOfItems]; EngineBase *currentClassEngine; --- 884,887 ---- *************** *** 924,943 **** } ! void OnHook() { ! lastOnHookActivity = PTime(); ! ! if (off_hook) { ! timerBusy.Stop(); ! timeout.Stop(); ! off_hook = FALSE; ! callDirection = cdUndefined; ! forceFaxMode = FALSE; ! state = stCommand; ! subState = 0; ! TRACE_STATE(4, "ModemEngineBody::OnHook:"); ! } ! ! _ClearCall(); ! } void SetCallState(CallState newState) { --- 934,938 ---- } ! void OnHook(); void SetCallState(CallState newState) { *************** *** 982,986 **** break; case EngineBase::mcFax: ! currentClassEngine = activeEngines[mceFax]; break; default: --- 977,981 ---- break; case EngineBase::mcFax: ! currentClassEngine = activeEngines[mceT38]; break; default: *************** *** 1060,1083 **** } ! PBoolean ModemEngine::Attach(T38Engine *t38engine) const { ! return body && body->Attach(t38engine); ! } ! void ModemEngine::Detach(T38Engine *t38engine) const ! { ! if( body ) ! body->Detach(t38engine); ! } ! PBoolean ModemEngine::Attach(AudioEngine *audioEngine) const ! { ! return body && body->Attach(audioEngine); } ! void ModemEngine::Detach(AudioEngine *audioEngine) const { ! if( body ) ! body->Detach(audioEngine); } --- 1055,1080 ---- } ! T38Engine *ModemEngine::NewPtrT38Engine() const { ! if (!body) ! return NULL; ! EngineBase *engine = body->NewPtrEngine(mceT38); ! PAssert(engine == NULL || PIsDescendant(engine, T38Engine), PInvalidCast); ! ! return (T38Engine *)engine; } ! AudioEngine *ModemEngine::NewPtrAudioEngine() const { ! if (!body) ! return NULL; ! ! EngineBase *engine = body->NewPtrEngine(mceAudio); ! ! PAssert(engine == NULL || PIsDescendant(engine, AudioEngine), PInvalidCast); ! ! return (AudioEngine *)engine; } *************** *** 1176,1181 **** ModemEngineBody::ModemEngineBody(ModemEngine &_parent, const PNotifier &_callbackEndPoint) : parent(_parent), - t38engine(NULL), - audioEngine(NULL), currentClassEngine(NULL), callbackEndPoint(_callbackEndPoint), --- 1173,1176 ---- *************** *** 1225,1228 **** --- 1220,1243 ---- } + void ModemEngineBody::OnHook() + { + lastOnHookActivity = PTime(); + + if (off_hook) { + timerBusy.Stop(); + timeout.Stop(); + off_hook = FALSE; + callDirection = cdUndefined; + forceFaxMode = FALSE; + state = stCommand; + subState = 0; + //_DetachEngine(mceT38); + //_DetachEngine(mceAudio); + TRACE_STATE(4, "ModemEngineBody::OnHook:"); + } + + _ClearCall(); + } + void ModemEngineBody::_ClearCall() { *************** *** 1242,1259 **** pPlayTone = NULL; } - - if (!CallToken().IsEmpty() && t38engine && t38engine->SendingNotCompleted()) { - Mutex.Signal(); - myPTRACE(2, "ModemEngineBody::_ClearCall: T.38 sending is not completed"); - PThread::Sleep(100); - Mutex.Wait(); - } } ! if (t38engine) ! _Detach(t38engine); ! ! if (audioEngine) ! _Detach(audioEngine); if (!CallToken().IsEmpty()) { --- 1257,1264 ---- pPlayTone = NULL; } } ! _DetachEngine(mceT38); ! _DetachEngine(mceAudio); if (!CallToken().IsEmpty()) { *************** *** 1320,1323 **** --- 1325,1329 ---- if (state == stConnectWait && !pPlayTone && P.ModemClassId() == EngineBase::mcAudio) { + _AttachEngine(mceAudio); SetState(stConnectHandle, chConnected); timerRing.Start(5000); *************** *** 1392,1564 **** } ! PBoolean ModemEngineBody::Attach(T38Engine *_t38engine) { ! if (_t38engine == NULL) { ! myPTRACE(1, "ModemEngineBody::Attach _t38engine==NULL"); ! return FALSE; ! } ! ! PTRACE(1, "ModemEngineBody::Attach t38engine " << state); PWaitAndSignal mutexWait(Mutex); ! if (callState == cstCleared || callState == cstReleasing) { ! myPTRACE(1, "ModemEngineBody::Request: call already in " << callState << " state"); ! return FALSE; ! } ! ! for (;;) { ! if (t38engine != NULL) { ! if (t38engine == _t38engine) { ! myPTRACE(1, "ModemEngineBody::Attach t38engine already Attached"); ! return TRUE; ! } ! ! myPTRACE(1, "ModemEngineBody::Attach Other t38engine already Attached"); ! return FALSE; ! } ! ! if (_t38engine->TryLockModemCallback()) { ! if (!_t38engine->Attach(engineCallback)) { ! myPTRACE(1, "ModemEngineBody::Attach Can't Attach engineCallback to _t38engine"); ! _t38engine->UnlockModemCallback(); ! return FALSE; ! } ! _t38engine->UnlockModemCallback(); ! activeEngines[mceFax] = t38engine = _t38engine; ! break; ! } ! ! Mutex.Signal(); ! PThread::Sleep(20); ! Mutex.Wait(); ! } ! ! t38engine->ChangeModemClass(P.ModemClassId()); ! t38engine->SendOnIdle(sendOnIdle); ! if (P.ModemClassId() == EngineBase::mcFax) ! currentClassEngine = t38engine; ! if (state == stReqModeAckWait) { ! SetState(stReqModeAckHandle); ! timeout.Stop(); ! parent.SignalDataReady(); } ! myPTRACE(1, "ModemEngineBody::Attach t38engine Attached"); ! return TRUE; } ! void ModemEngineBody::_Detach(T38Engine *_t38engine) { ! if (_t38engine == NULL) { ! myPTRACE(1, "ModemEngineBody::_Detach _t38engine==NULL"); ! return; ! } ! for (;;) { ! if (t38engine != _t38engine) { ! myPTRACE(1, "ModemEngineBody::_Detach " << (t38engine ? "Other" : "No") << " t38engine was Attached"); ! return; ! } ! if (_t38engine->TryLockModemCallback()) { ! _t38engine->Detach(engineCallback); ! _t38engine->UnlockModemCallback(); ! activeEngines[mceFax] = t38engine = NULL; ! break; } ! Mutex.Signal(); ! PThread::Sleep(20); ! Mutex.Wait(); ! } ! ! if (P.ModemClassId() == EngineBase::mcFax) { ! currentClassEngine = NULL; ! parent.SignalDataReady(); ! } ! ! myPTRACE(1, "ModemEngineBody::_Detach t38engine Detached"); ! } ! ! PBoolean ModemEngineBody::Attach(AudioEngine *_audioEngine) ! { ! if (_audioEngine == NULL) { ! myPTRACE(1, "ModemEngineBody::Attach _audioEngine==NULL"); ! return FALSE; } ! PTRACE(1, "ModemEngineBody::Attach audioEngine " << state); ! ! PWaitAndSignal mutexWait(Mutex); ! if (callState == cstCleared || callState == cstReleasing) { ! myPTRACE(1, "ModemEngineBody::Request: call already in " << callState << " state"); ! return FALSE; ! } ! for (;;) { ! if (audioEngine != NULL) { ! if (audioEngine == _audioEngine) { ! myPTRACE(1, "ModemEngineBody::Attach audioEngine already Attached"); ! return TRUE; } ! myPTRACE(1, "ModemEngineBody::Attach Other audioEngine already Attached"); ! return FALSE; ! } ! ! if (_audioEngine->TryLockModemCallback()) { ! if (!_audioEngine->Attach(engineCallback)) { ! myPTRACE(1, "ModemEngineBody::Attach Can't Attach engineCallback to _audioEngine"); ! _audioEngine->UnlockModemCallback(); ! return FALSE; } - _audioEngine->UnlockModemCallback(); - activeEngines[mceAudio] = audioEngine = _audioEngine; break; ! } ! ! Mutex.Signal(); ! PThread::Sleep(20); ! Mutex.Wait(); ! } ! ! audioEngine->ChangeModemClass(P.ModemClassId()); ! audioEngine->SendOnIdle(sendOnIdle); ! ! if (P.ModemClassId() == EngineBase::mcAudio) { ! currentClassEngine = audioEngine; ! } ! ! if (state == stConnectHandle && subState == chWaitAudioEngine) { ! SetSubState(chAudioEngineAttached); ! timeout.Stop(); ! parent.SignalDataReady(); } ! myPTRACE(1, "ModemEngineBody::Attach audioEngine Attached"); ! return TRUE; } ! void ModemEngineBody::_Detach(AudioEngine *_audioEngine) { ! if (_audioEngine == NULL) { ! myPTRACE(1, "ModemEngineBody::_Detach _audioEngine==NULL"); return; - } ! for (;;) { ! if (audioEngine != _audioEngine) { ! myPTRACE(1, "ModemEngineBody::_Detach " << (audioEngine ? "Other" : "No") << " audioEngine was Attached"); return; ! } ! if (_audioEngine->TryLockModemCallback()) { ! _audioEngine->Detach(engineCallback); ! _audioEngine->UnlockModemCallback(); ! activeEngines[mceAudio] = audioEngine = NULL; break; } --- 1398,1508 ---- } ! EngineBase *ModemEngineBody::NewPtrEngine(ModemClassEngine mce) { ! PAssert(mce == mceT38 || mce == mceAudio, "mce is not valid"); PWaitAndSignal mutexWait(Mutex); ! _AttachEngine(mce); ! if (activeEngines[mce]) { ! activeEngines[mce]->AddReference(); ! myPTRACE(1, "ModemEngineBody::NewPtrEngine created pointer for engine " << mce); } ! return activeEngines[mce]; } ! void ModemEngineBody::_AttachEngine(ModemClassEngine mce) { ! PAssert(mce == mceT38 || mce == mceAudio, "mce is not valid"); ! if (activeEngines[mce] == NULL) { ! EngineBase *engine; ! switch (mce) { ! case mceT38: ! engine = new T38Engine(parent.ptyName()); ! break; ! case mceAudio: ! engine = new AudioEngine(parent.ptyName()); ! break; ! default: ! myPTRACE(1, parent.ptyName() << " ModemEngineBody::_AttachEngine Invalid mce " << mce); ! return; } ! if (engine->TryLockModemCallback()) { ! if (!engine->Attach(engineCallback)) { ! myPTRACE(1, parent.ptyName() << " ModemEngineBody::_AttachEngine Can't attach engineCallback to " << mce); ! engine->UnlockModemCallback(); ! ReferenceObject::DelPointer(engine); ! return; ! } ! engine->UnlockModemCallback(); ! activeEngines[mce] = engine; ! } else { ! myPTRACE(1, parent.ptyName() << " ModemEngineBody::_AttachEngine Can't lock ModemCallback for " << mce); ! ReferenceObject::DelPointer(engine); ! return; ! } } ! activeEngines[mce]->ChangeModemClass(P.ModemClassId()); ! activeEngines[mce]->SendOnIdle(sendOnIdle); ! switch (mce) { ! case mceT38: ! if (P.ModemClassId() == EngineBase::mcFax) ! currentClassEngine = activeEngines[mce]; ! if (state == stReqModeAckWait) { ! SetState(stReqModeAckHandle); ! timeout.Stop(); ! parent.SignalDataReady(); ! } ! break; ! case mceAudio: ! if (P.ModemClassId() == EngineBase::mcAudio) { ! currentClassEngine = activeEngines[mce]; } ! if (state == stConnectHandle && subState == chWaitAudioEngine) { ! SetSubState(chAudioEngineAttached); ! timeout.Stop(); ! parent.SignalDataReady(); } break; ! default: ! break; } ! myPTRACE(1, "ModemEngineBody::_AttachEngine Attached " << mce); } ! void ModemEngineBody::_DetachEngine(ModemClassEngine mce) { ! PAssert(mce == mceT38 || mce == mceAudio, "mce is not valid"); ! ! if (activeEngines[mce] == NULL) return; ! if (!CallToken().IsEmpty() && activeEngines[mce]->SendingNotCompleted()) { ! Mutex.Signal(); ! myPTRACE(2, "ModemEngineBody::_DetachEngine: sending is not completed for " << mce); ! PThread::Sleep(100); ! Mutex.Wait(); ! ! if (activeEngines[mce] == NULL) return; ! } ! for (;;) { ! if (activeEngines[mce]->TryLockModemCallback()) { ! activeEngines[mce]->Detach(engineCallback); ! activeEngines[mce]->UnlockModemCallback(); ! ReferenceObject::DelPointer(activeEngines[mce]); ! activeEngines[mce] = NULL; break; } *************** *** 1567,1578 **** PThread::Sleep(20); Mutex.Wait(); } ! if (P.ModemClassId() == EngineBase::mcAudio) { ! currentClassEngine = NULL; ! parent.SignalDataReady(); } ! myPTRACE(1, "ModemEngineBody::_Detach audioEngine Detached"); } --- 1511,1537 ---- PThread::Sleep(20); Mutex.Wait(); + + if (activeEngines[mce] == NULL) + return; } ! switch (mce) { ! case mceT38: ! if (P.ModemClassId() == EngineBase::mcFax) { ! currentClassEngine = NULL; ! parent.SignalDataReady(); ! } ! break; ! case mceAudio: ! if (P.ModemClassId() == EngineBase::mcAudio) { ! currentClassEngine = NULL; ! parent.SignalDataReady(); ! } ! break; ! default: ! break; } ! myPTRACE(1, "ModemEngineBody::_DetachEngine Detached " << mce); } *************** *** 3947,3951 **** { SetState(stSendAckWait); ! if( !t38engine || !t38engine->SendStop(moreFrames, NextSeq()) ) { SetState(stSendAckHandle); timeout.Stop(); --- 3906,3910 ---- { SetState(stSendAckWait); ! if( !activeEngines[mceT38] || !activeEngines[mceT38]->SendStop(moreFrames, NextSeq()) ) { SetState(stSendAckHandle); timeout.Stop(); *************** *** 3958,3962 **** switch(subState) { case chConnected: ! if (!audioEngine) { SetSubState(chWaitAudioEngine); timeout.Start(60000); --- 3917,3921 ---- switch(subState) { case chConnected: ! if (!activeEngines[mceAudio]) { SetSubState(chWaitAudioEngine); timeout.Start(60000); *************** *** 3966,3989 **** case chAudioEngineAttached: if (pPlayTone) { ! if (!audioEngine) { SetSubState(chWaitAudioEngine); break; } ! if (!audioEngine->IsOpenOut()) break; PBoolean err = FALSE; ! if (audioEngine && audioEngine->SendStart(EngineBase::dtRaw, 0)) { PINDEX len = pPlayTone->GetSize(); if (len) { const PInt16 *ps = pPlayTone->GetPointer(); ! audioEngine->Send(ps, len*sizeof(*ps)); } SetSubState(chWaitPlayTone); ! if (audioEngine->SendStop(FALSE, NextSeq())) { timeout.Start(60000); } else { --- 3925,3948 ---- case chAudioEngineAttached: if (pPlayTone) { ! if (!activeEngines[mceAudio]) { SetSubState(chWaitAudioEngine); break; } ! if (!activeEngines[mceAudio]->IsOpenOut()) break; PBoolean err = FALSE; ! if (activeEngines[mceAudio]->SendStart(EngineBase::dtRaw, 0)) { PINDEX len = pPlayTone->GetSize(); if (len) { const PInt16 *ps = pPlayTone->GetPointer(); ! activeEngines[mceAudio]->Send(ps, len*sizeof(*ps)); } SetSubState(chWaitPlayTone); ! if (activeEngines[mceAudio]->SendStop(FALSE, NextSeq())) { timeout.Start(60000); } else { *************** *** 4034,4038 **** } else ! if (t38engine) { SetState(stReqModeAckHandle); timeout.Stop(); --- 3993,3997 ---- } else ! if (activeEngines[mceT38]) { SetState(stReqModeAckHandle); timeout.Stop(); *************** *** 4072,4078 **** dataType = EngineBase::dtCed; SetState(stSend); ! if (t38engine && t38engine->SendStart(dataType, 3000)) { SetState(stSendAckWait); ! if (!t38engine->SendStop(FALSE, NextSeq())) { resp = RC_ERROR(); SetState(stCommand); --- 4031,4037 ---- dataType = EngineBase::dtCed; SetState(stSend); ! if (activeEngines[mceT38] && activeEngines[mceT38]->SendStart(dataType, 3000)) { SetState(stSendAckWait); ! if (!activeEngines[mceT38]->SendStop(FALSE, NextSeq())) { resp = RC_ERROR(); SetState(stCommand); Index: enginebase.h =================================================================== RCS file: /cvsroot/t38modem/t38modem/enginebase.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** enginebase.h 22 Sep 2010 15:07:45 -0000 1.10 --- enginebase.h 29 Sep 2010 11:52:59 -0000 1.11 *************** *** 25,28 **** --- 25,31 ---- * * $Log$ + * Revision 1.11 2010/09/29 11:52:59 vfrolov + * Redesigned engine attaching/detaching + * * Revision 1.10 2010/09/22 15:07:45 vfrolov * Added ResetModemState() and OnResetModemState() *************** *** 62,69 **** /////////////////////////////////////////////////////////////// class DataStream; ! class EngineBase : public PObject { ! PCLASSINFO(EngineBase, PObject); public: --- 65,100 ---- /////////////////////////////////////////////////////////////// class DataStream; + /////////////////////////////////////////////////////////////// + class ReferenceObject : public PObject + { + PCLASSINFO(ReferenceObject, PObject); ! public: ! ReferenceObject() : referenceCount(1) {} ! ! void AddReference() { ! PWaitAndSignal mutex(referenceCountMutex); ! ++referenceCount; ! } ! ! static void DelPointer(ReferenceObject * object) { ! PBoolean doDelele; ! ! object->referenceCountMutex.Wait(); ! doDelele = (--object->referenceCount == 0); ! object->referenceCountMutex.Signal(); ! ! if (doDelele) ! delete object; ! } ! ! private: ! PMutex referenceCountMutex; ! unsigned referenceCount; ! }; ! /////////////////////////////////////////////////////////////// ! class EngineBase : public ReferenceObject { ! PCLASSINFO(EngineBase, ReferenceObject); public: *************** *** 109,113 **** /**@name Modem API */ //@{ ! PBoolean IsAttached() const; PBoolean Attach(const PNotifier &callback); void Detach(const PNotifier &callback); --- 140,145 ---- /**@name Modem API */ //@{ ! const PString &Name() const { return name; } ! PBoolean Attach(const PNotifier &callback); void Detach(const PNotifier &callback); *************** *** 135,138 **** --- 167,171 ---- virtual PBoolean SendStop(PBoolean moreFrames, int _callbackParam) = 0; virtual PBoolean isOutBufFull() const = 0; + virtual PBoolean SendingNotCompleted() const { return FALSE; } virtual PBoolean RecvWait(DataType _dataType, int param, int _callbackParam, PBoolean &done) = 0; Index: pmodeme.h =================================================================== RCS file: /cvsroot/t38modem/t38modem/pmodeme.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** pmodeme.h 10 Sep 2008 11:15:00 -0000 1.6 --- pmodeme.h 29 Sep 2010 11:52:59 -0000 1.7 *************** *** 4,8 **** * T38FAX Pseudo Modem * ! * Copyright (c) 2001-2008 Vyacheslav Frolov * * Open H323 Project --- 4,8 ---- * T38FAX Pseudo Modem * ! * Copyright (c) 2001-2010 Vyacheslav Frolov * * Open H323 Project *************** *** 25,28 **** --- 25,31 ---- * * $Log$ + * Revision 1.7 2010/09/29 11:52:59 vfrolov + * Redesigned engine attaching/detaching + * * Revision 1.6 2008/09/10 11:15:00 frolov * Ported to OPAL SVN trunk *************** *** 60,64 **** PCLASSINFO(ModemEngine, ModemThreadChild); public: ! /**@name Construction */ //@{ --- 63,67 ---- PCLASSINFO(ModemEngine, ModemThreadChild); public: ! /**@name Construction */ //@{ *************** *** 71,78 **** PBoolean IsReady() const; PBoolean Request(PStringToString &request) const; ! PBoolean Attach(T38Engine *t38engine) const; ! void Detach(T38Engine *t38engine) const; ! PBoolean Attach(AudioEngine *audioEngine) const; ! void Detach(AudioEngine *audioEngine) const; const PString &modemToken() const { return Parent().modemToken(); } //@} --- 74,80 ---- PBoolean IsReady() const; PBoolean Request(PStringToString &request) const; ! virtual T38Engine *NewPtrT38Engine() const; ! virtual AudioEngine *NewPtrAudioEngine() const; ! const PString &ptyName() const { return Parent().ptyName(); } const PString &modemToken() const { return Parent().modemToken(); } //@} *************** *** 81,87 **** PseudoModemBody &Parent() const { return (PseudoModemBody &)parent; } virtual void Main(); - const PString &ptyName() const { return Parent().ptyName(); } void ToPtyQ(const void *buf, PINDEX count) const { Parent().ToOutPtyQ(buf, count); } ! ModemEngineBody *body; }; --- 83,88 ---- PseudoModemBody &Parent() const { return (PseudoModemBody &)parent; } virtual void Main(); void ToPtyQ(const void *buf, PINDEX count) const { Parent().ToOutPtyQ(buf, count); } ! ModemEngineBody *body; }; Index: pmodem.h =================================================================== RCS file: /cvsroot/t38modem/t38modem/pmodem.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** pmodem.h 8 Jul 2009 18:43:44 -0000 1.9 --- pmodem.h 29 Sep 2010 11:52:59 -0000 1.10 *************** *** 4,8 **** * T38FAX Pseudo Modem * ! * Copyright (c) 2001-2009 Vyacheslav Frolov * * Open H323 Project --- 4,8 ---- * T38FAX Pseudo Modem * ! * Copyright (c) 2001-2010 Vyacheslav Frolov * * Open H323 Project *************** *** 25,28 **** --- 25,31 ---- * * $Log$ + * Revision 1.10 2010/09/29 11:52:59 vfrolov + * Redesigned engine attaching/detaching + * * Revision 1.9 2009/07/08 18:43:44 vfrolov * Added PseudoModem::ttyName() *************** *** 81,88 **** virtual PBoolean CheckRoute(const PString &number) const = 0; virtual PBoolean Request(PStringToString &request) const = 0; ! virtual PBoolean Attach(T38Engine *t38engine) const = 0; ! virtual void Detach(T38Engine *t38engine) const = 0; ! virtual PBoolean Attach(AudioEngine *audioEngine) const = 0; ! virtual void Detach(AudioEngine *audioEngine) const = 0; const PString &ttyName() const { return ttyname; } --- 84,89 ---- virtual PBoolean CheckRoute(const PString &number) const = 0; virtual PBoolean Request(PStringToString &request) const = 0; ! virtual T38Engine *NewPtrT38Engine() const = 0; ! virtual AudioEngine *NewPtrAudioEngine() const = 0; const PString &ttyName() const { return ttyname; } Index: t38engine.h =================================================================== RCS file: /cvsroot/t38modem/t38modem/t38engine.h,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** t38engine.h 22 Sep 2010 15:39:19 -0000 1.39 --- t38engine.h 29 Sep 2010 11:52:59 -0000 1.40 *************** *** 25,28 **** --- 25,31 ---- * * $Log$ + * Revision 1.40 2010/09/29 11:52:59 vfrolov + * Redesigned engine attaching/detaching + * * Revision 1.39 2010/09/22 15:39:19 vfrolov * Moved ResetModemState() to EngineBase *************** *** 202,208 **** public: /**@name Construction */ //@{ ! T38Engine(const PString &_name = ""); ~T38Engine(); //@} --- 205,213 ---- public: + enum { msPerOut = 30 }; + /**@name Construction */ //@{ ! T38Engine(const PString &_name); ~T38Engine(); //@} *************** *** 215,218 **** --- 220,224 ---- virtual PBoolean SendStop(PBoolean moreFrames, int _callbackParam); virtual PBoolean isOutBufFull() const; + virtual PBoolean SendingNotCompleted() const; virtual PBoolean RecvWait(DataType _dataType, int param, int _callbackParam, PBoolean &done); *************** *** 222,227 **** virtual int RecvDiag() const; - PBoolean SendingNotCompleted() const; - void Close() { CloseIn(); CloseOut(); } --- 228,231 ---- *************** *** 273,278 **** virtual void OnCloseOut(); - enum { msPerOut = 30 }; - private: void SignalOutDataReady() { outDataReadySyncPoint.Signal(); } --- 277,280 ---- Index: pmodemi.h =================================================================== RCS file: /cvsroot/t38modem/t38modem/pmodemi.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** pmodemi.h 8 Jul 2009 18:43:44 -0000 1.8 --- pmodemi.h 29 Sep 2010 11:52:59 -0000 1.9 *************** *** 4,8 **** * T38FAX Pseudo Modem * ! * Copyright (c) 2001-2009 Vyacheslav Frolov * * Open H323 Project --- 4,8 ---- * T38FAX Pseudo Modem * ! * Copyright (c) 2001-2010 Vyacheslav Frolov * * Open H323 Project *************** *** 25,28 **** --- 25,31 ---- * * $Log$ + * Revision 1.9 2010/09/29 11:52:59 vfrolov + * Redesigned engine attaching/detaching + * * Revision 1.8 2009/07/08 18:43:44 vfrolov * Added PseudoModem::ttyName() *************** *** 83,90 **** PBoolean CheckRoute(const PString &number) const; PBoolean Request(PStringToString &request) const; ! PBoolean Attach(T38Engine *t38engine) const; ! void Detach(T38Engine *t38engine) const; ! PBoolean Attach(AudioEngine *audioEngine) const; ! void Detach(AudioEngine *audioEngine) const; const PNotifier &GetCallbackEndPoint() const { return callbackEndPoint; } --- 86,91 ---- PBoolean CheckRoute(const PString &number) const; PBoolean Request(PStringToString &request) const; ! virtual T38Engine *NewPtrT38Engine() const; ! virtual AudioEngine *NewPtrAudioEngine() const; const PNotifier &GetCallbackEndPoint() const { return callbackEndPoint; } Index: pmodemi.cxx =================================================================== RCS file: /cvsroot/t38modem/t38modem/pmodemi.cxx,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** pmodemi.cxx 8 Jul 2009 18:43:44 -0000 1.15 --- pmodemi.cxx 29 Sep 2010 11:52:59 -0000 1.16 *************** *** 4,8 **** * T38FAX Pseudo Modem * ! * Copyright (c) 2001-2009 Vyacheslav Frolov * * Open H323 Project --- 4,8 ---- * T38FAX Pseudo Modem * ! * Copyright (c) 2001-2010 Vyacheslav Frolov * * Open H323 Project *************** *** 25,28 **** --- 25,31 ---- * * $Log$ + * Revision 1.16 2010/09/29 11:52:59 vfrolov + * Redesigned engine attaching/detaching + * * Revision 1.15 2009/07/08 18:43:44 vfrolov * Added PseudoModem::ttyName() *************** *** 117,144 **** } ! PBoolean PseudoModemBody::Attach(T38Engine *t38engine) const { PWaitAndSignal mutexWait(Mutex); ! return engine && engine->Attach(t38engine); ! } ! void PseudoModemBody::Detach(T38Engine *t38engine) const ! { ! PWaitAndSignal mutexWait(Mutex); ! if( engine ) ! engine->Detach(t38engine); } ! PBoolean PseudoModemBody::Attach(AudioEngine *audioEngine) const { PWaitAndSignal mutexWait(Mutex); ! return engine && engine->Attach(audioEngine); ! } ! void PseudoModemBody::Detach(AudioEngine *audioEngine) const ! { ! PWaitAndSignal mutexWait(Mutex); ! if (engine) ! engine->Detach(audioEngine); } --- 120,139 ---- } ! T38Engine *PseudoModemBody::NewPtrT38Engine() const { PWaitAndSignal mutexWait(Mutex); ! if (engine == NULL) ! return NULL; ! return engine->NewPtrT38Engine(); } ! AudioEngine *PseudoModemBody::NewPtrAudioEngine() const { PWaitAndSignal mutexWait(Mutex); ! if (engine == NULL) ! return NULL; ! return engine->NewPtrAudioEngine(); } Index: enginebase.cxx =================================================================== RCS file: /cvsroot/t38modem/t38modem/enginebase.cxx,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** enginebase.cxx 22 Sep 2010 15:07:45 -0000 1.10 --- enginebase.cxx 29 Sep 2010 11:52:59 -0000 1.11 *************** *** 25,28 **** --- 25,31 ---- * * $Log$ + * Revision 1.11 2010/09/29 11:52:59 vfrolov + * Redesigned engine attaching/detaching + * * Revision 1.10 2010/09/22 15:07:45 vfrolov * Added ResetModemState() and OnResetModemState() *************** *** 125,134 **** } - PBoolean EngineBase::IsAttached() const - { - PWaitAndSignal mutexWait(Mutex); - return !modemCallback.IsNULL(); - } - PBoolean EngineBase::Attach(const PNotifier &callback) { --- 128,131 ---- |
|
From: Vyacheslav F. <vf...@us...> - 2010-09-29 11:53:07
|
Update of /cvsroot/t38modem/t38modem/opal In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv18488/opal Modified Files: modemep.cxx Log Message: Redesigned engine attaching/detaching Index: modemep.cxx =================================================================== RCS file: /cvsroot/t38modem/t38modem/opal/modemep.cxx,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** modemep.cxx 9 Jul 2010 13:18:13 -0000 1.27 --- modemep.cxx 29 Sep 2010 11:52:59 -0000 1.28 *************** *** 25,28 **** --- 25,31 ---- * * $Log$ + * Revision 1.28 2010/09/29 11:52:59 vfrolov + * Redesigned engine attaching/detaching + * * Revision 1.27 2010/07/09 13:18:13 vfrolov * Fixed help message *************** *** 186,190 **** protected: bool UpdateMediaStreams(OpalConnection &other); - PBoolean Attach(PseudoModem *_pmodem); PDECLARE_NOTIFIER(PThread, ModemConnection, RequestMode); --- 189,192 ---- *************** *** 522,526 **** #pragma warning(default:4355) #endif ! , pmodem(NULL) , audioEngine(NULL) , t38engine(NULL) --- 524,528 ---- #pragma warning(default:4355) #endif ! , pmodem((PseudoModem *)userData) , audioEngine(NULL) , t38engine(NULL) *************** *** 536,542 **** phaseTimer.SetNotifier(PCREATE_NOTIFIER(OnPhaseTimeout)); - - if (userData) - Attach((PseudoModem *)userData); } --- 538,541 ---- *************** *** 546,555 **** if (pmodem != NULL) { - if (t38engine != NULL) - pmodem->Detach(t38engine); - - if (audioEngine != NULL) - pmodem->Detach(audioEngine); - PseudoModem *pmodemTmp = pmodem; --- 545,548 ---- *************** *** 597,604 **** if (t38engine != NULL) ! delete t38engine; if (audioEngine != NULL) ! delete audioEngine; phaseTimer.Stop(); --- 590,597 ---- if (t38engine != NULL) ! ReferenceObject::DelPointer(t38engine); if (audioEngine != NULL) ! ReferenceObject::DelPointer(audioEngine); phaseTimer.Stop(); *************** *** 625,647 **** if (mediaFormat == OpalT38) { ! PAssert(t38engine != NULL, "t38engine is NULL"); ! ! if (!t38engine->IsAttached()) { ! PAssert(pmodem != NULL, "pmodem is NULL"); ! pmodem->Attach(t38engine); ! } ! return new T38ModemMediaStream(*this, sessionID, isSource, t38engine); } ! if (mediaFormat == OpalPCM16) { ! PAssert(audioEngine != NULL, "audioEngine is NULL"); ! ! if (!audioEngine->IsAttached()) { ! PAssert(pmodem != NULL, "pmodem is NULL"); ! pmodem->Attach(audioEngine); ! } ! return new AudioModemMediaStream(*this, mediaFormat, sessionID, isSource, audioEngine); } --- 618,634 ---- if (mediaFormat == OpalT38) { ! if (t38engine == NULL) ! t38engine = pmodem->NewPtrT38Engine(); ! if (t38engine != NULL) ! return new T38ModemMediaStream(*this, sessionID, isSource, t38engine); } ! else if (mediaFormat == OpalPCM16) { ! if (audioEngine == NULL) ! audioEngine = pmodem->NewPtrAudioEngine(); ! if (audioEngine != NULL) ! return new AudioModemMediaStream(*this, mediaFormat, sessionID, isSource, audioEngine); } *************** *** 656,677 **** } - PBoolean ModemConnection::Attach(PseudoModem *_pmodem) - { - if (pmodem != NULL) - return FALSE; - - pmodem = _pmodem; - - PAssert(pmodem != NULL, "pmodem is NULL"); - - if (audioEngine == NULL) - audioEngine = new AudioEngine(pmodem->ptyName()); - - if (t38engine == NULL) - t38engine = new T38Engine(pmodem->ptyName()); - - return TRUE; - } - PBoolean ModemConnection::SetUpConnection() { --- 643,646 ---- *************** *** 739,743 **** } ! if (!Attach(_pmodem)) { myPTRACE(1, "... denied (internal error)"); ep.PMFree(_pmodem); --- 708,712 ---- } ! if (pmodem != NULL) { myPTRACE(1, "... denied (internal error)"); ep.PMFree(_pmodem); *************** *** 746,749 **** --- 715,720 ---- } + pmodem = _pmodem; + PStringToString request; request.SetAt("command", "call"); *************** *** 781,787 **** PAssert(pmodem != NULL, "pmodem is NULL"); - PAssert(audioEngine != NULL, "audioEngine is NULL"); - - pmodem->Attach(audioEngine); PStringToString request; --- 752,755 ---- |
|
From: Vyacheslav F. <vf...@us...> - 2010-09-29 11:53:07
|
Update of /cvsroot/t38modem/t38modem/h323lib In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv18488/h323lib Modified Files: h323ep.cxx t38protocol.cxx t38protocol.h Log Message: Redesigned engine attaching/detaching Index: t38protocol.h =================================================================== RCS file: /cvsroot/t38modem/t38modem/h323lib/t38protocol.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** t38protocol.h 27 Jul 2009 16:09:24 -0000 1.1 --- t38protocol.h 29 Sep 2010 11:52:59 -0000 1.2 *************** *** 4,8 **** * T38FAX Pseudo Modem * ! * Copyright (c) 2009 Vyacheslav Frolov * * Open H323 Project --- 4,8 ---- * T38FAX Pseudo Modem * ! * Copyright (c) 2009-2010 Vyacheslav Frolov * * Open H323 Project *************** *** 25,28 **** --- 25,31 ---- * * $Log$ + * Revision 1.2 2010/09/29 11:52:59 vfrolov + * Redesigned engine attaching/detaching + * * Revision 1.1 2009/07/27 16:09:24 vfrolov * Initial revision *************** *** 34,43 **** #include <t38proto.h> - #include "../t38engine.h" /////////////////////////////////////////////////////////////// class PASN_OctetString; ! ! class T38Protocol : public OpalT38Protocol, public T38Engine { PCLASSINFO(T38Protocol, OpalT38Protocol); --- 37,47 ---- #include <t38proto.h> /////////////////////////////////////////////////////////////// class PASN_OctetString; ! class T38Engine; ! class PseudoModem; ! /////////////////////////////////////////////////////////////// ! class T38Protocol : public OpalT38Protocol { PCLASSINFO(T38Protocol, OpalT38Protocol); *************** *** 47,60 **** /**@name Construction */ //@{ ! T38Protocol(const PString &_name = "") ! : T38Engine(_name), ! in_redundancy(0), ! ls_redundancy(0), ! hs_redundancy(0), ! re_interval(-1) {} //@} /**@name Operations */ //@{ void SetRedundancy( int indication, --- 51,62 ---- /**@name Construction */ //@{ ! T38Protocol(PseudoModem * pmodem); ! ~T38Protocol(); //@} /**@name Operations */ //@{ + PBoolean IsOK() const { return t38engine != NULL; } + void SetRedundancy( int indication, *************** *** 73,77 **** //@} - void EncodeIFPPacket(PASN_OctetString &ifp_packet, const T38_IFP &T38_ifp) const; PBoolean HandleRawIFP(const PASN_OctetString & pdu); PBoolean Originate(); --- 75,78 ---- *************** *** 81,84 **** --- 82,87 ---- private: + T38Engine *t38engine; + int in_redundancy; int ls_redundancy; Index: t38protocol.cxx =================================================================== RCS file: /cvsroot/t38modem/t38modem/h323lib/t38protocol.cxx,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** t38protocol.cxx 27 Jul 2009 16:09:24 -0000 1.1 --- t38protocol.cxx 29 Sep 2010 11:52:59 -0000 1.2 *************** *** 4,8 **** * T38FAX Pseudo Modem * ! * Copyright (c) 2009 Vyacheslav Frolov * * Open H323 Project --- 4,8 ---- * T38FAX Pseudo Modem * ! * Copyright (c) 2009-2010 Vyacheslav Frolov * * Open H323 Project *************** *** 25,28 **** --- 25,31 ---- * * $Log$ + * Revision 1.2 2010/09/29 11:52:59 vfrolov + * Redesigned engine attaching/detaching + * * Revision 1.1 2009/07/27 16:09:24 vfrolov * Initial revision *************** *** 35,42 **** --- 38,62 ---- #include "t38protocol.h" + #include "../t38engine.h" + #include "../pmodem.h" #define new PNEW /////////////////////////////////////////////////////////////// + T38Protocol::T38Protocol(PseudoModem * pmodem) + : t38engine(pmodem->NewPtrT38Engine()) + , in_redundancy(0) + , ls_redundancy(0) + , hs_redundancy(0) + , re_interval(-1) + { + } + + T38Protocol::~T38Protocol() + { + if (t38engine) + ReferenceObject::DelPointer(t38engine); + } + void T38Protocol::SetRedundancy(int indication, int low_speed, int high_speed, int repeat_interval) { *************** *** 50,54 **** re_interval = repeat_interval; ! myPTRACE(3, name << " T38Protocol::SetRedundancy indication=" << in_redundancy << " low_speed=" << ls_redundancy << " high_speed=" << hs_redundancy --- 70,74 ---- re_interval = repeat_interval; ! myPTRACE(3, t38engine->Name() << " T38Protocol::SetRedundancy indication=" << in_redundancy << " low_speed=" << ls_redundancy << " high_speed=" << hs_redundancy *************** *** 69,75 **** #endif ! void T38Protocol::EncodeIFPPacket(PASN_OctetString &ifp_packet, const T38_IFP &T38_ifp) const { ! if (!IS_NATIVE_ASN && T38_ifp.HasOptionalField(T38_IFPPacket::e_data_field)) { T38_IFP ifp = T38_ifp; PINDEX count = ifp.m_data_field.GetSize(); --- 89,95 ---- #endif ! static void EncodeIFPPacket(PASN_OctetString &ifp_packet, const T38_IFP &T38_ifp, PBoolean nativeASN) { ! if (!nativeASN && T38_ifp.HasOptionalField(T38_IFPPacket::e_data_field)) { T38_IFP ifp = T38_ifp; PINDEX count = ifp.m_data_field.GetSize(); *************** *** 90,94 **** if (IS_NATIVE_ASN) { if (pdu.DecodeSubType(ifp)) ! return T38Engine::HandlePacket(ifp); PTRACE(2, "T38\t" T38_IFP_NAME " decode failure:\n " << setprecision(2) << ifp); --- 110,114 ---- if (IS_NATIVE_ASN) { if (pdu.DecodeSubType(ifp)) ! return t38engine->HandlePacket(ifp); PTRACE(2, "T38\t" T38_IFP_NAME " decode failure:\n " << setprecision(2) << ifp); *************** *** 117,126 **** } ! return T38Engine::HandlePacket(ifp); } PBoolean T38Protocol::Originate() { ! RenameCurrentThread(name + "(tx)"); PTRACE(2, "T38\tOriginate, transport=" << *transport); --- 137,146 ---- } ! return t38engine->HandlePacket(ifp); } PBoolean T38Protocol::Originate() { ! RenameCurrentThread(t38engine->Name() + "(tx)"); PTRACE(2, "T38\tOriginate, transport=" << *transport); *************** *** 143,147 **** if (seq < 0) { ! SetPreparePacketTimeout(-1); } else { int timeout = ( --- 163,167 ---- if (seq < 0) { ! t38engine->SetPreparePacketTimeout(-1); } else { int timeout = ( *************** *** 149,161 **** lastifp.m_type_of_msg.GetTag() == T38_Type_of_msg::e_t30_indicator || #endif ! maxRedundancy > 0) ? msPerOut * 3 : -1; if (re_interval > 0 && (timeout <= 0 || timeout > re_interval)) timeout = re_interval; ! SetPreparePacketTimeout(timeout); } ! res = PreparePacket(ifp); #ifdef REPEAT_INDICATOR_SENDING --- 169,181 ---- lastifp.m_type_of_msg.GetTag() == T38_Type_of_msg::e_t30_indicator || #endif ! maxRedundancy > 0) ? t38engine->msPerOut * 3 : -1; if (re_interval > 0 && (timeout <= 0 || timeout > re_interval)) timeout = re_interval; ! t38engine->SetPreparePacketTimeout(timeout); } ! res = t38engine->PreparePacket(ifp); #ifdef REPEAT_INDICATOR_SENDING *************** *** 193,197 **** udptl.m_seq_number = ++seq & 0xFFFF; ! EncodeIFPPacket(udptl.m_primary_ifp_packet, ifp); /* --- 213,217 ---- udptl.m_seq_number = ++seq & 0xFFFF; ! EncodeIFPPacket(udptl.m_primary_ifp_packet, ifp, IS_NATIVE_ASN); /* *************** *** 292,296 **** PBoolean T38Protocol::Answer() { ! RenameCurrentThread(name + "(rx)"); PTRACE(2, "T38\tAnswer, transport=" << *transport); --- 312,316 ---- PBoolean T38Protocol::Answer() { ! RenameCurrentThread(t38engine->Name() + "(rx)"); PTRACE(2, "T38\tAnswer, transport=" << *transport); *************** *** 366,370 **** int nRedundancy = secondary.GetSize(); if (lost > nRedundancy) { ! if (!T38Engine::HandlePacketLost(lost - nRedundancy)) break; #if PTRACING --- 386,390 ---- int nRedundancy = secondary.GetSize(); if (lost > nRedundancy) { ! if (!t38engine->HandlePacketLost(lost - nRedundancy)) break; #if PTRACING *************** *** 397,401 **** if (lost) { ! if (!T38Engine::HandlePacketLost(lost)) break; #if PTRACING --- 417,421 ---- if (lost) { ! if (!t38engine->HandlePacketLost(lost)) break; #if PTRACING *************** *** 431,438 **** void T38Protocol::CleanUpOnTermination() { ! myPTRACE(1, name << " T38Protocol::CleanUpOnTermination"); OpalT38Protocol::CleanUpOnTermination(); ! T38Engine::Close(); } /////////////////////////////////////////////////////////////// --- 451,458 ---- void T38Protocol::CleanUpOnTermination() { ! myPTRACE(1, t38engine->Name() << " T38Protocol::CleanUpOnTermination"); OpalT38Protocol::CleanUpOnTermination(); ! t38engine->Close(); } /////////////////////////////////////////////////////////////// Index: h323ep.cxx =================================================================== RCS file: /cvsroot/t38modem/t38modem/h323lib/h323ep.cxx,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** h323ep.cxx 27 Feb 2010 16:33:29 -0000 1.54 --- h323ep.cxx 29 Sep 2010 11:52:59 -0000 1.55 *************** *** 25,28 **** --- 25,31 ---- * * $Log$ + * Revision 1.55 2010/09/29 11:52:59 vfrolov + * Redesigned engine attaching/detaching + * * Revision 1.54 2010/02/27 16:33:29 vfrolov * Implemented --bearer-capability option *************** *** 695,706 **** if (pmodem != NULL) { - if (t38handler != NULL) { - PAssert(PIsDescendant(t38handler, T38Protocol), PInvalidCast); - pmodem->Detach((T38Protocol *)t38handler); - } - - if (audioEngine != NULL) - pmodem->Detach(audioEngine); - PStringToString request; request.SetAt("command", "clearcall"); --- 698,701 ---- *************** *** 713,718 **** } ! if (audioEngine != NULL) ! delete audioEngine; } --- 708,713 ---- } ! if (audioEngine) ! ReferenceObject::DelPointer(audioEngine); } *************** *** 738,746 **** if (audioEngine == NULL) ! audioEngine = new AudioEngine(pmodem->ptyName()); ! ! pmodem->Attach(audioEngine); ! return TRUE; } --- 733,739 ---- if (audioEngine == NULL) ! audioEngine = pmodem->NewPtrAudioEngine(); ! return audioEngine != NULL; } *************** *** 756,764 **** * at the same time and we should delete it on connection clean */ ! if( t38handler == NULL ) { PTRACE(2, "MyH323Connection::CreateT38ProtocolHandler create new one"); ! t38handler = new T38Protocol(pmodem->ptyName()); ! ep.SetOptions(*this, t38handler); ! pmodem->Attach((T38Protocol *)t38handler); } return t38handler; --- 749,765 ---- * at the same time and we should delete it on connection clean */ ! if (t38handler == NULL) { PTRACE(2, "MyH323Connection::CreateT38ProtocolHandler create new one"); ! ! T38Protocol *t38protocol = new T38Protocol(pmodem); ! ! if (t38protocol && t38protocol->IsOK()) { ! ep.SetOptions(*this, t38protocol); ! ! t38handler = t38protocol; ! } else { ! delete t38protocol; ! PTRACE(1, "MyH323Connection::CreateT38ProtocolHandler can't create"); ! } } return t38handler; |
|
From: Vyacheslav F. <vf...@us...> - 2010-09-22 15:51:22
|
Update of /cvsroot/t38modem/t38modem In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv17815 Modified Files: pmodeme.cxx Log Message: Moved ResetModemState() to EngineBase Index: pmodeme.cxx =================================================================== RCS file: /cvsroot/t38modem/t38modem/pmodeme.cxx,v retrieving revision 1.95 retrieving revision 1.96 diff -C2 -d -r1.95 -r1.96 *** pmodeme.cxx 14 Sep 2010 06:35:10 -0000 1.95 --- pmodeme.cxx 22 Sep 2010 15:51:13 -0000 1.96 *************** *** 25,28 **** --- 25,31 ---- * * $Log$ + * Revision 1.96 2010/09/22 15:51:13 vfrolov + * Moved ResetModemState() to EngineBase + * * Revision 1.95 2010/09/14 06:35:10 vfrolov * Implemented dial string terminated by a semicolon ("ATD<dialstring>;[...]") *************** *** 3700,3705 **** SetState(stCommand); timeout.Stop(); ! if (t38engine) ! t38engine->ResetModemState(); } break; --- 3703,3708 ---- SetState(stCommand); timeout.Stop(); ! if (currentClassEngine) ! currentClassEngine->ResetModemState(); } break; *************** *** 3714,3739 **** timeout.Stop(); ! PString resp = RC_PREF(); ! if (P.ModemClassId() == EngineBase::mcAudio) { ! if (state == stRecv) { ! PBYTEArray _bresp((const BYTE *)"\x10\x03", 2); // add <DLE><ETX> ! myPTRACE(1, "<-- " << PRTHEX(_bresp)); ! bresp.Concatenate(_bresp); ! } ! SetState(stCommand); resp += RC_OK(); } else { ! SetState(stCommand); ! ! if (t38engine) { ! t38engine->ResetModemState(); ! resp += RC_OK(); ! } else { ! OnHook(); ! resp += RC_NO_CARRIER(); ! } } --- 3717,3737 ---- timeout.Stop(); ! if (state == stRecv && (dataCount || P.ModemClassId() == EngineBase::mcAudio)) { ! PBYTEArray _bresp((const BYTE *)"\x10\x03", 2); // add <DLE><ETX> ! myPTRACE(1, "<-- " << PRTHEX(_bresp)); ! bresp.Concatenate(_bresp); ! } ! SetState(stCommand); ! PString resp = RC_PREF(); ! ! if (currentClassEngine || P.ModemClassId() == EngineBase::mcAudio) { ! currentClassEngine->ResetModemState(); resp += RC_OK(); } else { ! OnHook(); ! resp += RC_NO_CARRIER(); } *************** *** 3799,3804 **** resp = RC_NO_CARRIER(); SetState(stCommand); ! if (t38engine) ! t38engine->ResetModemState(); else OnHook(); --- 3797,3802 ---- resp = RC_NO_CARRIER(); SetState(stCommand); ! if (currentClassEngine) ! currentClassEngine->ResetModemState(); else OnHook(); |
|
From: Vyacheslav F. <vf...@us...> - 2010-09-22 15:39:27
|
Update of /cvsroot/t38modem/t38modem In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv16880 Modified Files: t38engine.cxx t38engine.h Log Message: Moved ResetModemState() to EngineBase Replaced _ResetModemState() by OnResetModemState() Index: t38engine.cxx =================================================================== RCS file: /cvsroot/t38modem/t38modem/t38engine.cxx,v retrieving revision 1.69 retrieving revision 1.70 diff -C2 -d -r1.69 -r1.70 *** t38engine.cxx 8 Sep 2010 17:22:23 -0000 1.69 --- t38engine.cxx 22 Sep 2010 15:39:19 -0000 1.70 *************** *** 25,28 **** --- 25,32 ---- * * $Log$ + * Revision 1.70 2010/09/22 15:39:19 vfrolov + * Moved ResetModemState() to EngineBase + * Replaced _ResetModemState() by OnResetModemState() + * * Revision 1.69 2010/09/08 17:22:23 vfrolov * Redesigned modem engine (continue) *************** *** 616,621 **** { EngineBase::OnAttach(); - - _ResetModemState(); } --- 620,623 ---- *************** *** 623,628 **** { EngineBase::OnDetach(); - - _ResetModemState(); SignalOutDataReady(); } --- 625,628 ---- *************** *** 634,647 **** /////////////////////////////////////////////////////////////// // ! void T38Engine::ResetModemState() { ! PWaitAndSignal mutexWaitModem(MutexModem); ! PWaitAndSignal mutexWait(Mutex); ! ! _ResetModemState(); ! } - void T38Engine::_ResetModemState() { if (modStreamIn && modStreamIn->DeleteFirstBuf()) { ! PTRACE(1, name << " ResetModemState modStreamIn->DeleteFirstBuf(), clean"); } --- 634,642 ---- /////////////////////////////////////////////////////////////// // ! void T38Engine::OnResetModemState() { ! EngineBase::OnResetModemState(); if (modStreamIn && modStreamIn->DeleteFirstBuf()) { ! PTRACE(1, name << " T38Engine::OnResetModemState modStreamIn->DeleteFirstBuf(), clean"); } *************** *** 649,656 **** if (stateModem != stmIdle) { if (!isStateModemOut()) { ! myPTRACE(1, name << " ResetModemState stateModem(" << stateModem << ") != stmIdle, reset"); stateModem = stmIdle; } else ! myPTRACE(1, name << " ResetModemState stateModem(" << stateModem << ") != stmIdle"); } --- 644,651 ---- if (stateModem != stmIdle) { if (!isStateModemOut()) { ! myPTRACE(1, name << " T38Engine::OnResetModemState stateModem(" << stateModem << ") != stmIdle, reset"); stateModem = stmIdle; } else ! myPTRACE(1, name << " T38Engine::OnResetModemState stateModem(" << stateModem << ") != stmIdle"); } Index: t38engine.h =================================================================== RCS file: /cvsroot/t38modem/t38modem/t38engine.h,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** t38engine.h 8 Sep 2010 17:22:24 -0000 1.38 --- t38engine.h 22 Sep 2010 15:39:19 -0000 1.39 *************** *** 25,28 **** --- 25,32 ---- * * $Log$ + * Revision 1.39 2010/09/22 15:39:19 vfrolov + * Moved ResetModemState() to EngineBase + * Replaced _ResetModemState() by OnResetModemState() + * * Revision 1.38 2010/09/08 17:22:24 vfrolov * Redesigned modem engine (continue) *************** *** 206,211 **** /**@name Modem API */ //@{ - void ResetModemState(); - virtual void SendOnIdle(DataType _dataType); virtual PBoolean SendStart(DataType _dataType, int param); --- 210,213 ---- *************** *** 264,267 **** --- 266,270 ---- virtual void OnAttach(); virtual void OnDetach(); + virtual void OnResetModemState(); virtual void OnChangeModemClass(); virtual void OnOpenIn(); *************** *** 279,284 **** } - void _ResetModemState(); - private: DataStream bufOut; --- 282,285 ---- |
|
From: Vyacheslav F. <vf...@us...> - 2010-09-22 15:24:00
|
Update of /cvsroot/t38modem/t38modem In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv15409 Modified Files: audio.cxx audio.h Log Message: Added OnResetModemState() Index: audio.h =================================================================== RCS file: /cvsroot/t38modem/t38modem/audio.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** audio.h 8 Sep 2010 17:22:23 -0000 1.6 --- audio.h 22 Sep 2010 15:23:48 -0000 1.7 *************** *** 25,28 **** --- 25,31 ---- * * $Log$ + * Revision 1.7 2010/09/22 15:23:48 vfrolov + * Added OnResetModemState() + * * Revision 1.6 2010/09/08 17:22:23 vfrolov * Redesigned modem engine (continue) *************** *** 89,92 **** --- 92,96 ---- virtual void OnAttach(); virtual void OnDetach(); + virtual void OnResetModemState(); virtual void OnChangeModemClass(); virtual void OnOpenIn(); Index: audio.cxx =================================================================== RCS file: /cvsroot/t38modem/t38modem/audio.cxx,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** audio.cxx 10 Sep 2010 18:00:44 -0000 1.14 --- audio.cxx 22 Sep 2010 15:23:48 -0000 1.15 *************** *** 25,28 **** --- 25,31 ---- * * $Log$ + * Revision 1.15 2010/09/22 15:23:48 vfrolov + * Added OnResetModemState() + * * Revision 1.14 2010/09/10 18:00:44 vfrolov * Cleaned up code *************** *** 129,136 **** { EngineBase::OnDetach(); if (sendAudio) { ! delete sendAudio; ! sendAudio = NULL; } --- 132,148 ---- { EngineBase::OnDetach(); + } + + void AudioEngine::OnResetModemState() + { + EngineBase::OnResetModemState(); if (sendAudio) { ! if (isOpenOut) { ! sendAudio->PutEof(); ! } else { ! delete sendAudio; ! sendAudio = NULL; ! } } |
|
From: Vyacheslav F. <vf...@us...> - 2010-09-22 15:07:54
|
Update of /cvsroot/t38modem/t38modem In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv13955 Modified Files: enginebase.cxx enginebase.h Log Message: Added ResetModemState() and OnResetModemState() Index: enginebase.cxx =================================================================== RCS file: /cvsroot/t38modem/t38modem/enginebase.cxx,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** enginebase.cxx 8 Sep 2010 17:22:23 -0000 1.9 --- enginebase.cxx 22 Sep 2010 15:07:45 -0000 1.10 *************** *** 25,28 **** --- 25,31 ---- * * $Log$ + * Revision 1.10 2010/09/22 15:07:45 vfrolov + * Added ResetModemState() and OnResetModemState() + * * Revision 1.9 2010/09/08 17:22:23 vfrolov * Redesigned modem engine (continue) *************** *** 150,153 **** --- 153,158 ---- { PTRACE(1, name << " OnAttach Attached"); + + OnResetModemState(); } *************** *** 180,183 **** --- 185,202 ---- { myPTRACE(1, name << " OnDetach Detached"); + + OnResetModemState(); + } + + void EngineBase::ResetModemState() { + PWaitAndSignal mutexWaitModem(MutexModem); + PWaitAndSignal mutexWait(Mutex); + + OnResetModemState(); + } + + void EngineBase::OnResetModemState() + { + myPTRACE(1, name << " OnResetModemState"); } Index: enginebase.h =================================================================== RCS file: /cvsroot/t38modem/t38modem/enginebase.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** enginebase.h 8 Sep 2010 17:22:23 -0000 1.9 --- enginebase.h 22 Sep 2010 15:07:45 -0000 1.10 *************** *** 25,28 **** --- 25,31 ---- * * $Log$ + * Revision 1.10 2010/09/22 15:07:45 vfrolov + * Added ResetModemState() and OnResetModemState() + * * Revision 1.9 2010/09/08 17:22:23 vfrolov * Redesigned modem engine (continue) *************** *** 109,112 **** --- 112,116 ---- PBoolean Attach(const PNotifier &callback); void Detach(const PNotifier &callback); + void ResetModemState(); void OpenIn(); *************** *** 144,147 **** --- 148,152 ---- virtual void OnAttach(); virtual void OnDetach(); + virtual void OnResetModemState(); virtual void OnChangeModemClass(); virtual void OnUserInput(const PString & value); |
|
From: Vyacheslav F. <vf...@us...> - 2010-09-14 06:35:18
|
Update of /cvsroot/t38modem/t38modem In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv5347 Modified Files: pmodeme.cxx Log Message: Implemented dial string terminated by a semicolon ("ATD<dialstring>;[...]") Index: pmodeme.cxx =================================================================== RCS file: /cvsroot/t38modem/t38modem/pmodeme.cxx,v retrieving revision 1.94 retrieving revision 1.95 diff -C2 -d -r1.94 -r1.95 *** pmodeme.cxx 10 Sep 2010 18:08:07 -0000 1.94 --- pmodeme.cxx 14 Sep 2010 06:35:10 -0000 1.95 *************** *** 25,28 **** --- 25,31 ---- * * $Log$ + * Revision 1.95 2010/09/14 06:35:10 vfrolov + * Implemented dial string terminated by a semicolon ("ATD<dialstring>;[...]") + * * Revision 1.94 2010/09/10 18:08:07 vfrolov * Implemented +VTD command *************** *** 570,597 **** }; /////////////////////////////////////////////////////////////// ! enum CallState { // ---------+---------------------------+--------+-------------------------------------------+ ! // | on sending command | on | on received command | ! // +---------------------------+clearing+-------------------------------------------+ ! // |"dial"|"answer"|"clearcall"|off_hook|"call"|"alerting"|"established"|"clearcall"| ! // ---------+------+--------+-----+-----+--------+------+----------+-------------+-----+-----+ ! // off_hook | true | true |true |false| true |false | true | true |true |false| ! // ---------+------+--------+-----+-----+--------+------+----------+-------------+-----+-----+ ! cstCleared, // )--+ <--+ <--+ )--+ <--+ | ! // | | | | | | ! // | | | | | | ! cstDialing, // <--+ )--+ )--+ )--+ | )--+ )--+ )--+ )--+ | ! // | | | | | | | | | ! cstAlerted, // )--+ )--+ )--+ | <--+ )--+ )--+ )--+ | ! // | | | | | | | | ! // | | | | | | | | ! cstCalled, // )--+ )--+ )--+ | <--+ | | )--+ | ! // | | | | | | | | ! cstAnswering, // <--+ )--+ )--+ )--+ )--+ )--+ )--+ | ! // | | | | | | | ! // | | | | | | | ! cstEstablished, // )--+ )--+ )--+ <--+ )--+ )--+ | ! // | | | | | | ! cstReleasing, // <--+ )--+ )--+ <--+ )--+ | ! }; // ---------+------+--------+-----+-----+--------+------+----------+-------------+-----+-----+ #if PTRACING --- 573,600 ---- }; /////////////////////////////////////////////////////////////// ! enum CallState { // ---------+---------------------------+--------+------------------------------------------------+ ! // | on sending command | on | on received command | ! // +---------------------------+clearing+------------------------------------------------+ ! // |"dial"|"answer"|"clearcall"|off_hook|"call"|"alerting"|"established"| "clearcall" | ! // ---------+------+--------+-----+-----+--------+------+----------+-------------+----------+-----+ ! // off_hook | true | true |true |false| true |false | true | true | true |false| ! // ---------+------+--------+-----+-----+--------+------+----------+-------------+----------+-----+ ! cstCleared, // )--+ <--+ <--+ )--+ <--+ <--+ | ! // | | | | | | | ! // | | | | | | | ! cstDialing, // <--+ )--+ )--+ )--+ | )--+ )--+ )--+ )--+ )--+ | ! // | | | | | | | | | ! cstAlerted, // )--+ )--+ )--+ | <--+ )--+ )--+ )--+ | ! // | | | | | | | | ! // | | | | | | | | ! cstCalled, // )--+ )--+ )--+ | <--+ | | )--+ | ! // | | | | | | | | ! cstAnswering, // <--+ )--+ )--+ )--+ )--+ )--+ )--+ | ! // | | | | | | | ! // | | | | | | | ! cstEstablished, // )--+ )--+ )--+ <--+ )--+ )--+ | ! // | | | | | | ! cstReleasing, // <--+ )--+ )--+ <--+ )--+ | ! }; // ---------+------+--------+-----+-----+--------+------+----------+-------------+----------+-----+ #if PTRACING *************** *** 757,761 **** PBoolean HandleClass8Cmd(const char **ppCmd, PString &resp, PBoolean &ok, PBoolean &crlf); PBoolean Answer(); ! void HandleCmd(const PString &cmd, PString &resp); unsigned EstablishmentTimeout() const { --- 760,765 ---- PBoolean HandleClass8Cmd(const char **ppCmd, PString &resp, PBoolean &ok, PBoolean &crlf); PBoolean Answer(); ! void HandleCmd(PString &resp); ! void HandleCmdRest(PString &resp); unsigned EstablishmentTimeout() const { *************** *** 998,1001 **** --- 1002,1006 ---- PStringToString params; PString cmd; + PString cmdRest; EngineBase::DataType dataType; EngineBase::DataType sendOnIdle; *************** *** 1311,1315 **** SetCallState(cstAlerted); ! if (state == stConnectWait && callDirection == cdOutgoing && !pPlayTone && P.ModemClassId() == EngineBase::mcAudio) { SetState(stConnectHandle, chConnected); timerRing.Start(5000); --- 1316,1320 ---- SetCallState(cstAlerted); ! if (state == stConnectWait && !pPlayTone && P.ModemClassId() == EngineBase::mcAudio) { SetState(stConnectHandle, chConnected); timerRing.Start(5000); *************** *** 1361,1364 **** --- 1366,1370 ---- if (callState == cstDialing && state == stConnectWait && request("trynextcommand") == "dial") { timerRing.Stop(); + SetCallState(cstCleared); SetState(stDial); params = request; *************** *** 2067,2071 **** OffHook(); timerRing.Stop(); - callDirection = cdIncoming; forceFaxMode = TRUE; --- 2073,2076 ---- *************** *** 2107,2126 **** } ! ! #define ToSBit(funk) \ ! switch( ParseNum(&pCmd, 0, 1, 1) ) { \ ! case 0: \ ! P.funk(FALSE); \ ! break; \ ! case 1: \ ! P.funk(TRUE); \ ! break; \ ! default: \ ! err = TRUE; \ ! } ! ! void ModemEngineBody::HandleCmd(const PString & cmd, PString & resp) { - PINDEX i; --- 2112,2117 ---- } ! void ModemEngineBody::HandleCmd(PString &resp) { PINDEX i; *************** *** 2130,2133 **** --- 2121,2125 ---- if (i == P_MAX_INDEX) { myPTRACE(1, "--> " << cmd.GetLength() << " bytes of binary"); + cmd.MakeEmpty(); return; } *************** *** 2155,2161 **** pCmd += 2; // skip AT ! PString ucmd = PString(pCmd).ToUpper(); ! pCmd = ucmd; PBoolean err = FALSE; PBoolean ok = TRUE; --- 2147,2174 ---- pCmd += 2; // skip AT ! cmdRest = PString(pCmd).ToUpper(); ! cmd.MakeEmpty(); + HandleCmdRest(resp); + } + + #define ToSBit(funk) \ + switch (ParseNum(&pCmd, 0, 1, 1)) { \ + case 0: \ + P.funk(FALSE); \ + break; \ + case 1: \ + P.funk(TRUE); \ + break; \ + default: \ + err = TRUE; \ + } + + void ModemEngineBody::HandleCmdRest(PString &resp) + { + PString tmp = cmdRest; + cmdRest.MakeEmpty(); + + const char *pCmd = tmp; PBoolean err = FALSE; PBoolean ok = TRUE; *************** *** 2173,2176 **** --- 2186,2190 ---- PWaitAndSignal mutexWait(Mutex); + callDirection = cdIncoming; if (!Answer()) err = TRUE; *************** *** 2221,2241 **** if (ch == ';') { ! for (;;) { ! switch (*pCmd++) { ! case 0: ! pCmd--; ! break; ! case ' ': ! case ';': ! continue; ! case 'A': ! setCallDirection = cdIncoming; ! setForceFaxMode = TRUE; ! break; ! default: ! err = TRUE; ! } ! break; ! } break; } --- 2235,2240 ---- if (ch == ';') { ! setCallDirection = cdUndefined; ! cmdRest = PString(pCmd); break; } *************** *** 2270,2273 **** --- 2269,2274 ---- if (addNumTone) continue; + if (!num.IsEmpty()) + continue; break; case 'A': *************** *** 2354,2360 **** parent.SignalDataReady(); - if (callDirection == cdOutgoing && P.ModemClassId() == EngineBase::mcFax) - SendOnIdle(EngineBase::dtCng); - if (numTone.GetLength()) { if (!pPlayTone) --- 2355,2358 ---- *************** *** 2380,2430 **** } - SetCallState(cstDialing); - callDirection = setCallDirection; forceFaxMode = setForceFaxMode; - if (callDirection == cdOutgoing && P.ModemClassId() == EngineBase::mcFax) - SendOnIdle(EngineBase::dtCng); - timerRing.Stop(); ! SetState(stConnectWait); ! ! PStringToString request; ! ! if (!timerBusy.IsRunning()) { // we can't dial after releasing w/o on-hook ! if (numTone.GetLength()) { ! if (!pPlayTone) ! pPlayTone = new PDTMFEncoder(); ! ! pPlayTone->Concatenate(playTone); ! } ! ! timeout.Start(EstablishmentTimeout()); ! request.SetAt("modemtoken", parent.modemToken()); ! request.SetAt("command", "dial"); ! request.SetAt("number", num); ! request.SetAt("localpartyname", LocalPartyName); ! Mutex.Signal(); ! callbackEndPoint(request, 3); ! Mutex.Wait(); } ! if (request("response") == "confirm") { ! CallToken(request("calltoken")); ! } else { ! OnHook(); ! if (crlf) { ! resp += "\r\n"; ! crlf = FALSE; ! } else { ! resp += RC_PREF(); ! } ! resp += RC_BUSY(); ! } } else { if (wasOnHook) --- 2378,2401 ---- } callDirection = setCallDirection; forceFaxMode = setForceFaxMode; timerRing.Stop(); ! SetState(stDial); ! if (numTone.GetLength()) { ! if (!pPlayTone) ! pPlayTone = new PDTMFEncoder(); ! pPlayTone->Concatenate(playTone); } ! timeout.Start(EstablishmentTimeout()); ! params.RemoveAll(); ! params.SetAt("number", num); ! params.SetAt("localpartyname", LocalPartyName); ! parent.SignalDataReady(); // try to Dial w/o delay } else { if (wasOnHook) *************** *** 3116,3119 **** --- 3087,3091 ---- PWaitAndSignal mutexWait(Mutex); + callDirection = cdUndefined; if (!Answer()) err = TRUE; *************** *** 3626,3630 **** PString resp; ! HandleCmd(cmd, resp); if (resp.GetLength()) { --- 3598,3602 ---- PString resp; ! HandleCmd(resp); if (resp.GetLength()) { *************** *** 3634,3639 **** bresp.Concatenate(_bresp); } - - cmd = PString(); } } --- 3606,3609 ---- *************** *** 3795,3799 **** if (timerRing.Get()) { ! if (callDirection == cdOutgoing && !pPlayTone && P.ModemClassId() == EngineBase::mcAudio) { BYTE b[2] = {'\x10', 'r'}; PBYTEArray _bresp(b, sizeof(b)); --- 3765,3769 ---- if (timerRing.Get()) { ! if (off_hook && !pPlayTone && P.ModemClassId() == EngineBase::mcAudio) { BYTE b[2] = {'\x10', 'r'}; PBYTEArray _bresp(b, sizeof(b)); *************** *** 3815,3820 **** P.RingCount(++ringCount); ! if (P.AutoAnswer() > 0 && (ringCount >= P.AutoAnswer())) Answer(); } } --- 3785,3792 ---- P.RingCount(++ringCount); ! if (P.AutoAnswer() > 0 && (ringCount >= P.AutoAnswer())) { ! callDirection = cdIncoming; Answer(); + } } } *************** *** 3951,3955 **** switch (state) { case stDial: ! { SetState(stConnectWait); timeout.Start(EstablishmentTimeout()); --- 3923,3928 ---- switch (state) { case stDial: ! if (callState == cstCleared) { // we can't dial after releasing w/o on-hook ! SetCallState(cstDialing); SetState(stConnectWait); timeout.Start(EstablishmentTimeout()); *************** *** 3965,3974 **** if (request("response") == "confirm") { CallToken(request("calltoken")); } else { timeout.Stop(); - OnHook(); - resp = RC_BUSY(); } } break; case stSendBufEmptyHandle: --- 3938,3948 ---- if (request("response") == "confirm") { CallToken(request("calltoken")); + break; } else { timeout.Stop(); } } + OnHook(); + resp = RC_BUSY(); break; case stSendBufEmptyHandle: *************** *** 4044,4053 **** SetSubState(chConnectionEstablished); case chConnectionEstablished: connectionEstablished = TRUE; ! if (P.ModemClassId() == EngineBase::mcAudio) { SetState(stCommand); timeout.Stop(); ! resp = RC_OK(); } else --- 4018,4037 ---- SetSubState(chConnectionEstablished); case chConnectionEstablished: + if (callDirection == cdOutgoing && P.ModemClassId() == EngineBase::mcFax) + SendOnIdle(EngineBase::dtCng); + connectionEstablished = TRUE; ! if (P.ModemClassId() == EngineBase::mcAudio || callDirection == cdUndefined) { SetState(stCommand); timeout.Stop(); ! ! PString _resp; ! HandleCmdRest(_resp); ! ! PBYTEArray _bresp((const BYTE *)(const char *)_resp, _resp.GetLength()); ! ! myPTRACE(1, "<-- " << PRTHEX(_bresp)); ! bresp.Concatenate(_bresp); } else |
|
From: Vyacheslav F. <vf...@us...> - 2010-09-13 12:15:00
|
Update of /cvsroot/t38modem/t38modem/h323lib In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv18518 Modified Files: t38modem_2005.sln Log Message: Removed UTF-8 stump Index: t38modem_2005.sln =================================================================== RCS file: /cvsroot/t38modem/t38modem/h323lib/t38modem_2005.sln,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** t38modem_2005.sln 13 Sep 2010 10:17:01 -0000 1.1 --- t38modem_2005.sln 13 Sep 2010 12:14:53 -0000 1.2 *************** *** 1,3 **** - Microsoft Visual Studio Solution File, Format Version 9.00 # Visual C++ Express 2005 --- 1,2 ---- |
|
From: Vyacheslav F. <vf...@us...> - 2010-09-13 12:10:34
|
Update of /cvsroot/t38modem/t38modem/opal In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv17867 Modified Files: t38modem_2005.sln Log Message: Removed UTF-8 stump Index: t38modem_2005.sln =================================================================== RCS file: /cvsroot/t38modem/t38modem/opal/t38modem_2005.sln,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** t38modem_2005.sln 13 Sep 2010 10:18:13 -0000 1.1 --- t38modem_2005.sln 13 Sep 2010 12:10:26 -0000 1.2 *************** *** 1,3 **** - Microsoft Visual Studio Solution File, Format Version 9.00 # Visual C++ Express 2005 --- 1,2 ---- |
|
From: Vyacheslav F. <vf...@us...> - 2010-09-13 10:18:27
|
Update of /cvsroot/t38modem/t38modem/opal In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv6434 Added Files: t38modem_2005.sln Log Message: Initial revision --- NEW FILE: t38modem_2005.sln --- Microsoft Visual Studio Solution File, Format Version 9.00 # Visual C++ Express 2005 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "t38modem", "t38modem_2005.vcproj", "{5684EA1E-9DEC-4701-A81E-FBF8133A77B5}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 No Trace|Win32 = No Trace|Win32 Release|Win32 = Release|Win32 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {5684EA1E-9DEC-4701-A81E-FBF8133A77B5}.Debug|Win32.ActiveCfg = Debug|Win32 {5684EA1E-9DEC-4701-A81E-FBF8133A77B5}.Debug|Win32.Build.0 = Debug|Win32 {5684EA1E-9DEC-4701-A81E-FBF8133A77B5}.No Trace|Win32.ActiveCfg = No Trace|Win32 {5684EA1E-9DEC-4701-A81E-FBF8133A77B5}.No Trace|Win32.Build.0 = No Trace|Win32 {5684EA1E-9DEC-4701-A81E-FBF8133A77B5}.Release|Win32.ActiveCfg = Release|Win32 {5684EA1E-9DEC-4701-A81E-FBF8133A77B5}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal |
|
From: Vyacheslav F. <vf...@us...> - 2010-09-13 10:17:12
|
Update of /cvsroot/t38modem/t38modem/h323lib In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv6168 Added Files: t38modem_2005.sln Log Message: Initial revision --- NEW FILE: t38modem_2005.sln --- Microsoft Visual Studio Solution File, Format Version 9.00 # Visual C++ Express 2005 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "t38modem", "t38modem_2005.vcproj", "{5684EA1E-9DEC-4701-A81E-FBF8133A77B5}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 No Trace|Win32 = No Trace|Win32 Release|Win32 = Release|Win32 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {5684EA1E-9DEC-4701-A81E-FBF8133A77B5}.Debug|Win32.ActiveCfg = Debug|Win32 {5684EA1E-9DEC-4701-A81E-FBF8133A77B5}.Debug|Win32.Build.0 = Debug|Win32 {5684EA1E-9DEC-4701-A81E-FBF8133A77B5}.No Trace|Win32.ActiveCfg = No Trace|Win32 {5684EA1E-9DEC-4701-A81E-FBF8133A77B5}.No Trace|Win32.Build.0 = No Trace|Win32 {5684EA1E-9DEC-4701-A81E-FBF8133A77B5}.Release|Win32.ActiveCfg = Release|Win32 {5684EA1E-9DEC-4701-A81E-FBF8133A77B5}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal |
|
From: Vyacheslav F. <vf...@us...> - 2010-09-10 18:08:15
|
Update of /cvsroot/t38modem/t38modem In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv25387 Modified Files: pmodeme.cxx Log Message: Implemented +VTD command Cleaned up code Index: pmodeme.cxx =================================================================== RCS file: /cvsroot/t38modem/t38modem/pmodeme.cxx,v retrieving revision 1.93 retrieving revision 1.94 diff -C2 -d -r1.93 -r1.94 *** pmodeme.cxx 10 Sep 2010 05:34:12 -0000 1.93 --- pmodeme.cxx 10 Sep 2010 18:08:07 -0000 1.94 *************** *** 25,28 **** --- 25,32 ---- * * $Log$ + * Revision 1.94 2010/09/10 18:08:07 vfrolov + * Implemented +VTD command + * Cleaned up code + * * Revision 1.93 2010/09/10 05:34:12 vfrolov * Allowed "+ A B C D" dialing digits *************** *** 396,403 **** --- 400,410 ---- BYTE name() const { BYTE val; GetReg(byte, val); return val; } + DeclareRegisterByte(AutoAnswer, 0); + DeclareRegisterByte(RingCount, 1); DeclareRegisterByte(S7, 7); DeclareRegisterByte(DialTimeComma, 8); DeclareRegisterByte(DialTimeDTMF, 11); + DeclareRegisterByte(Vtd, MaxRegVoice - 7); DeclareRegisterByte(Vcml, MaxRegVoice - 6); DeclareRegisterByte(Vsds, MaxRegVoice - 5); *************** *** 752,755 **** --- 759,766 ---- void HandleCmd(const PString &cmd, PString &resp); + unsigned EstablishmentTimeout() const { + return unsigned(P.S7() ? P.S7() : Profiles[0].S7()) * 1000; + } + void ResetDleData() { dleData.Clean(); *************** *** 1135,1138 **** --- 1146,1150 ---- Vsdi(50); Vcml(132); + Vtd(100); asciiResultCodes(TRUE); noResultCodes(FALSE); *************** *** 1280,1284 **** DstNum(request("dstnum")); timerRing.Start(5000); ! P.SetReg(1, 0); request.SetAt("response", "confirm"); } --- 1292,1296 ---- DstNum(request("dstnum")); timerRing.Start(5000); ! P.RingCount(0); request.SetAt("response", "confirm"); } *************** *** 1346,1350 **** if (CallToken() == request("calltoken")) { CallToken(""); ! if (callState == cstDialing && state == stConnectWait && request("trynextcommand") == "dial") { timerRing.Stop(); --- 1358,1362 ---- if (CallToken() == request("calltoken")) { CallToken(""); ! if (callState == cstDialing && state == stConnectWait && request("trynextcommand") == "dial") { timerRing.Stop(); *************** *** 1801,1805 **** } - #define TONE_DEFAULT_LEN PDTMFEncoder::DefaultToneLen #define TONE_FREQUENCY_MIN PDTMFEncoder::MinFrequency #define TONE_FREQUENCY_MAX (8000/4) --- 1813,1816 ---- *************** *** 1828,1832 **** for (;;) { ! int dms = TONE_DEFAULT_LEN/10; switch (**ppCmd) { --- 1839,1843 ---- for (;;) { ! int dms = P.Vtd(); switch (**ppCmd) { *************** *** 2066,2070 **** SetState(stConnectWait); ! timeout.Start(60000); PStringToString request; --- 2077,2081 ---- SetState(stConnectWait); ! timeout.Start(EstablishmentTimeout()); PStringToString request; *************** *** 2390,2394 **** } ! timeout.Start((unsigned(P.S7()) + 1) * 1000); request.SetAt("modemtoken", parent.modemToken()); --- 2401,2405 ---- } ! timeout.Start(EstablishmentTimeout()); request.SetAt("modemtoken", parent.modemToken()); *************** *** 3329,3336 **** break; case 'T': ! switch (*pCmd) { case 'X': // +VTX case 'S': // +VTS - pCmd++; if (!HandleClass8Cmd(&pCmd, resp, ok, crlf)) err = TRUE; --- 3340,3376 ---- break; case 'T': ! switch (*pCmd++) { ! case 'D': // +VTD ! switch (*pCmd++) { ! case '=': ! switch (*pCmd) { ! case '?': ! pCmd++; ! resp += "\r\n(0-255)"; ! crlf = TRUE; ! break; ! default: ! { ! int val = ParseNum(&pCmd); ! ! if (val >= 0) { ! PWaitAndSignal mutexWait(Mutex); ! P.Vtd((BYTE)val); ! } else { ! err = TRUE; ! } ! } ! } ! break; ! case '?': ! resp.sprintf("\r\n%u", (unsigned)P.Vtd()); ! crlf = TRUE; ! break; ! default: ! err = TRUE; ! } ! break; case 'X': // +VTX case 'S': // +VTS if (!HandleClass8Cmd(&pCmd, resp, ok, crlf)) err = TRUE; *************** *** 3764,3770 **** if (!off_hook && callState == cstCalled) { resp = RC_RING(); ! BYTE s0, ringCount; ! P.GetReg(0, s0); ! P.GetReg(1, ringCount); if (!ringCount) { if(P.CidMode()) --- 3804,3808 ---- if (!off_hook && callState == cstCalled) { resp = RC_RING(); ! BYTE ringCount = P.RingCount(); if (!ringCount) { if(P.CidMode()) *************** *** 3775,3781 **** resp += RC_RING(); } ! P.SetReg(1, ++ringCount); ! if (s0 > 0 && (ringCount >= s0)) Answer(); } --- 3813,3819 ---- resp += RC_RING(); } ! P.RingCount(++ringCount); ! if (P.AutoAnswer() > 0 && (ringCount >= P.AutoAnswer())) Answer(); } *************** *** 3915,3919 **** { SetState(stConnectWait); ! timeout.Start((unsigned(P.S7()) + 1) * 1000); PStringToString request = params; --- 3953,3957 ---- { SetState(stConnectWait); ! timeout.Start(EstablishmentTimeout()); PStringToString request = params; |
|
From: Vyacheslav F. <vf...@us...> - 2010-09-10 18:00:53
|
Update of /cvsroot/t38modem/t38modem In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv23918 Modified Files: audio.cxx t30tone.cxx t30tone.h Log Message: Cleaned up code Index: audio.cxx =================================================================== RCS file: /cvsroot/t38modem/t38modem/audio.cxx,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** audio.cxx 9 Jul 2010 04:44:27 -0000 1.13 --- audio.cxx 10 Sep 2010 18:00:44 -0000 1.14 *************** *** 25,28 **** --- 25,31 ---- * * $Log$ + * Revision 1.14 2010/09/10 18:00:44 vfrolov + * Cleaned up code + * * Revision 1.13 2010/07/09 04:44:27 vfrolov * Added tracing targetTimeFakeOut *************** *** 75,80 **** /////////////////////////////////////////////////////////////// ! typedef PInt16 SIMPLE_TYPE; ! #define BYTES_PER_SIMPLE sizeof(SIMPLE_TYPE) /////////////////////////////////////////////////////////////// AudioEngine::AudioEngine(const PString &_name) --- 78,85 ---- /////////////////////////////////////////////////////////////// ! typedef PInt16 SIMPLE_TYPE; ! #define BYTES_PER_SIMPLE sizeof(SIMPLE_TYPE) ! #define SIMPLES_PER_SEC 8000 ! #define BYTES_PER_MSEC ((SIMPLES_PER_SEC*BYTES_PER_SIMPLE)/1000) /////////////////////////////////////////////////////////////// AudioEngine::AudioEngine(const PString &_name) *************** *** 198,202 **** if (sendAudio) ! targetTimeFakeOut = PTime() + countTotal/16; } } --- 203,207 ---- if (sendAudio) ! targetTimeFakeOut = PTime() + countTotal/BYTES_PER_MSEC; } } *************** *** 234,238 **** lastReadCount = amount; ! readDelay.Delay(amount/16); return TRUE; --- 239,243 ---- lastReadCount = amount; ! readDelay.Delay(amount/BYTES_PER_MSEC); return TRUE; *************** *** 290,294 **** sendAudio->PutData(pBuf, count); else ! targetTimeFakeOut += count/16; } --- 295,299 ---- sendAudio->PutData(pBuf, count); else ! targetTimeFakeOut += count/BYTES_PER_MSEC; } *************** *** 387,391 **** lastWriteCount = len; ! writeDelay.Delay(len/16); return TRUE; --- 392,396 ---- lastWriteCount = len; ! writeDelay.Delay(len/BYTES_PER_MSEC); return TRUE; Index: t30tone.h =================================================================== RCS file: /cvsroot/t38modem/t38modem/t30tone.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** t30tone.h 10 Sep 2008 11:15:00 -0000 1.4 --- t30tone.h 10 Sep 2010 18:00:44 -0000 1.5 *************** *** 4,8 **** * T38FAX Pseudo Modem * ! * Copyright (c) 2002-2008 Vyacheslav Frolov * * Open H323 Project --- 4,8 ---- * T38FAX Pseudo Modem * ! * Copyright (c) 2002-2010 Vyacheslav Frolov * * Open H323 Project *************** *** 25,28 **** --- 25,31 ---- * * $Log$ + * Revision 1.5 2010/09/10 18:00:44 vfrolov + * Cleaned up code + * * Revision 1.4 2008/09/10 11:15:00 frolov * Ported to OPAL SVN trunk *************** *** 43,49 **** /////////////////////////////////////////////////////////////// - #define SIMPLES_PER_SEC 8000 - #define CNG_HZ 1100 - /////////////////////////////////////////////////////////////// class T30Tone : public PObject { --- 46,49 ---- *************** *** 73,83 **** T30ToneDetect(); PBoolean Write(const void * buffer, PINDEX len); protected: ! #define CNG_FILTER_BUF_LEN ((((SIMPLES_PER_SEC + CNG_HZ - 1)/CNG_HZ + 1)/2)*2) ! ! long cng_filter_buf[CNG_FILTER_BUF_LEN]; PINDEX index; long power; --- 73,83 ---- T30ToneDetect(); + ~T30ToneDetect(); + PBoolean Write(const void * buffer, PINDEX len); protected: ! long *cng_filter_buf; PINDEX index; long power; Index: t30tone.cxx =================================================================== RCS file: /cvsroot/t38modem/t38modem/t30tone.cxx,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** t30tone.cxx 10 Sep 2008 11:15:00 -0000 1.6 --- t30tone.cxx 10 Sep 2010 18:00:44 -0000 1.7 *************** *** 4,8 **** * T38FAX Pseudo Modem * ! * Copyright (c) 2002-2008 Vyacheslav Frolov * * Open H323 Project --- 4,8 ---- * T38FAX Pseudo Modem * ! * Copyright (c) 2002-2010 Vyacheslav Frolov * * Open H323 Project *************** *** 25,28 **** --- 25,31 ---- * * $Log$ + * Revision 1.7 2010/09/10 18:00:44 vfrolov + * Cleaned up code + * * Revision 1.6 2008/09/10 11:15:00 frolov * Ported to OPAL SVN trunk *************** *** 43,47 **** * Revision 1.1 2002/04/30 10:59:07 vfrolov * Initial revision ! * */ --- 46,50 ---- * Revision 1.1 2002/04/30 10:59:07 vfrolov * Initial revision ! * */ *************** *** 57,72 **** /////////////////////////////////////////////////////////////// ! typedef PInt16 SIMPLE_TYPE; ! ! #define TWO_PI (3.1415926535897932384626433832795029L*2) ! #define BYTES_PER_SIMPLE sizeof(SIMPLE_TYPE) /////////////////////////////////////////////////////////////// ! #define CNG_MAX_DIV 100 ! #define CNG_AMPLITUDE 5000 ! #define CNG_ON_MSEC 500 ! #define CNG_ON_BYTES (((SIMPLES_PER_SEC*CNG_ON_MSEC)/1000)*BYTES_PER_SIMPLE) ! #define CNG_OFF_MSEC 3000 ! #define CNG_OFF_BYTES (((SIMPLES_PER_SEC*CNG_OFF_MSEC)/1000)*BYTES_PER_SIMPLE) ! #define CNG_SIMPLES_PER_REPEATE (SIMPLES_PER_SEC/CNG_MAX_DIV) static BYTE CngTone[CNG_SIMPLES_PER_REPEATE*BYTES_PER_SIMPLE]; --- 60,76 ---- /////////////////////////////////////////////////////////////// ! typedef PInt16 SIMPLE_TYPE; ! #define TWO_PI (3.1415926535897932384626433832795029L*2) ! #define BYTES_PER_SIMPLE sizeof(SIMPLE_TYPE) ! #define SIMPLES_PER_SEC 8000 /////////////////////////////////////////////////////////////// ! #define CNG_HZ 1100 ! #define CNG_MAX_DIV 100 ! #define CNG_AMPLITUDE 5000 ! #define CNG_ON_MSEC 500 ! #define CNG_ON_BYTES (((SIMPLES_PER_SEC*CNG_ON_MSEC)/1000)*BYTES_PER_SIMPLE) ! #define CNG_OFF_MSEC 3000 ! #define CNG_OFF_BYTES (((SIMPLES_PER_SEC*CNG_OFF_MSEC)/1000)*BYTES_PER_SIMPLE) ! #define CNG_SIMPLES_PER_REPEATE (SIMPLES_PER_SEC/CNG_MAX_DIV) static BYTE CngTone[CNG_SIMPLES_PER_REPEATE*BYTES_PER_SIMPLE]; *************** *** 132,137 **** } /////////////////////////////////////////////////////////////// ! #define tone_trace(cng_filter_buf, power, cng_power, cng_power_norm) #ifndef tone_trace static void tone_trace(const long *cng_filter_buf, long power, long cng_power, long cng_power_norm) --- 136,142 ---- } /////////////////////////////////////////////////////////////// ! #define CNG_FILTER_BUF_LEN ((((SIMPLES_PER_SEC + CNG_HZ - 1)/CNG_HZ + 1)/2)*2) + #define tone_trace(cng_filter_buf, power, cng_power, cng_power_norm) #ifndef tone_trace static void tone_trace(const long *cng_filter_buf, long power, long cng_power, long cng_power_norm) *************** *** 156,160 **** T30ToneDetect::T30ToneDetect() { ! memset(cng_filter_buf, 0, sizeof(cng_filter_buf)); index = 0; power = 0; --- 161,167 ---- T30ToneDetect::T30ToneDetect() { ! cng_filter_buf = new long[CNG_FILTER_BUF_LEN]; ! memset(cng_filter_buf, 0, CNG_FILTER_BUF_LEN*sizeof(cng_filter_buf[0])); ! index = 0; power = 0; *************** *** 165,168 **** --- 172,180 ---- } + T30ToneDetect::~T30ToneDetect() + { + delete [] cng_filter_buf; + } + #define CNG_FILTER_CHUNK_LEN 20 #define CNG_ON_CHUNKS_MIN (((CNG_HZ*CNG_ON_MSEC)*60)/((CNG_FILTER_CHUNK_LEN*1000)*100)) *************** *** 307,311 **** // reatart filter ! memset(cng_filter_buf, 0, sizeof(cng_filter_buf)); index = 0; power = 0; --- 319,323 ---- // reatart filter ! memset(cng_filter_buf, 0, CNG_FILTER_BUF_LEN*sizeof(cng_filter_buf[0])); index = 0; power = 0; |
|
From: Vyacheslav F. <vf...@us...> - 2010-09-10 05:36:31
|
Update of /cvsroot/t38modem/t38modem In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv30331 Modified Files: ReadMe.txt Log Message: Allowed "+ A B C D" dialing digits in called number Index: ReadMe.txt =================================================================== RCS file: /cvsroot/t38modem/t38modem/ReadMe.txt,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** ReadMe.txt 23 Mar 2010 07:52:31 -0000 1.26 --- ReadMe.txt 10 Sep 2010 05:36:23 -0000 1.27 *************** *** 281,299 **** ------------------------------------- ! L - reset and begin of calling number. ! T,P - continue of called number. ! D - continue of called number (if used before the call answer). If calling number is empty after processing ATD command then t38modem's local party number used. ! The calling or called number is a string of 0 or more of the characters: "0 1 2 3 4 5 6 7 8 9 * #" ! The called number part after the call answer is a string of 0 or more of the ! characters: ! "0 1 2 3 4 5 6 7 8 9 * # A B C D ," Examples: --- 281,301 ---- ------------------------------------- ! L - purge calling number and start dialing it. ! T,P,D - continue to dial of called number if dialing of calling number was started. If calling number is empty after processing ATD command then t38modem's local party number used. ! The calling number is a string of 0 or more of the characters: "0 1 2 3 4 5 6 7 8 9 * #" ! Note: dialing of calling number is not allowed in online command state. ! The called number is a string of 0 or more of the characters: ! ! "0 1 2 3 4 5 6 7 8 9 * # + A B C D" ! ! Note: '+' will be ignored in online command state or after '@' modifier. Examples: *************** *** 324,328 **** @ - dial the called number part collected before first @, wait till the call answered and play the called number part collected after last @. ! Implicitly '@' will continue of called number (see 4.3.2). Examples: --- 326,330 ---- @ - dial the called number part collected before first @, wait till the call answered and play the called number part collected after last @. ! Implicitly '@' will continue dialing of called number (see 4.3.2). Examples: |
|
From: Vyacheslav F. <vf...@us...> - 2010-09-10 05:34:21
|
Update of /cvsroot/t38modem/t38modem In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv30083 Modified Files: pmodeme.cxx Log Message: Allowed "+ A B C D" dialing digits Added ignoring unrecognized dialing digits (V.250) Added missing on-hook's Index: pmodeme.cxx =================================================================== RCS file: /cvsroot/t38modem/t38modem/pmodeme.cxx,v retrieving revision 1.92 retrieving revision 1.93 diff -C2 -d -r1.92 -r1.93 *** pmodeme.cxx 8 Sep 2010 17:22:23 -0000 1.92 --- pmodeme.cxx 10 Sep 2010 05:34:12 -0000 1.93 *************** *** 25,28 **** --- 25,33 ---- * * $Log$ + * Revision 1.93 2010/09/10 05:34:12 vfrolov + * Allowed "+ A B C D" dialing digits + * Added ignoring unrecognized dialing digits (V.250) + * Added missing on-hook's + * * Revision 1.92 2010/09/08 17:22:23 vfrolov * Redesigned modem engine (continue) *************** *** 906,910 **** --- 911,920 ---- if (off_hook) { timerBusy.Stop(); + timeout.Stop(); off_hook = FALSE; + callDirection = cdUndefined; + forceFaxMode = FALSE; + state = stCommand; + subState = 0; TRACE_STATE(4, "ModemEngineBody::OnHook:"); } *************** *** 1181,1185 **** PWaitAndSignal mutexWait(Mutex); ! _ClearCall(); timeout.Stop(); --- 1191,1195 ---- PWaitAndSignal mutexWait(Mutex); ! OnHook(); timeout.Stop(); *************** *** 1192,1196 **** PWaitAndSignal mutexWait(Mutex); ! _ClearCall(); } --- 1202,1206 ---- PWaitAndSignal mutexWait(Mutex); ! OnHook(); } *************** *** 1206,1211 **** timerRing.Stop(); - callDirection = cdUndefined; - forceFaxMode = FALSE; connectionEstablished = FALSE; --- 1216,1219 ---- *************** *** 1332,1337 **** PWaitAndSignal mutexWait(Mutex); ! if (callState == cstCleared) { ! myPTRACE(1, "ModemEngineBody::Request: call already in cstCleared state"); } else --- 1340,1345 ---- PWaitAndSignal mutexWait(Mutex); ! if (callState == cstCleared || callState == cstReleasing) { ! myPTRACE(1, "ModemEngineBody::Request: call already in " << callState << " state"); } else *************** *** 2046,2051 **** PBoolean ModemEngineBody::Answer() { ! PBoolean wasOnHook = OffHook(); ! timerRing.Stop(); callDirection = cdIncoming; --- 2054,2058 ---- PBoolean ModemEngineBody::Answer() { ! OffHook(); timerRing.Stop(); callDirection = cdIncoming; *************** *** 2076,2088 **** if (!ok) { ! callDirection = cdUndefined; ! forceFaxMode = FALSE; ! timeout.Stop(); ! SetState(stCommand); ! ! if (wasOnHook) ! OnHook(); ! else ! _ClearCall(); return FALSE; --- 2083,2087 ---- if (!ok) { ! OnHook(); return FALSE; *************** *** 2183,2186 **** --- 2182,2187 ---- PString num; + PString numTone; + PBoolean addNumTone; PString LocalPartyName; PBoolean local = FALSE; *************** *** 2189,2195 **** if (!CallToken().IsEmpty()) { ! if (!pPlayTone) ! pPlayTone = new PDTMFEncoder; } else { if (pPlayTone) { myPTRACE(1, "ModemEngineBody::HandleCmd pPlayTone is not NULL"); --- 2190,2197 ---- if (!CallToken().IsEmpty()) { ! addNumTone = TRUE; } else { + addNumTone = FALSE; + if (pPlayTone) { myPTRACE(1, "ModemEngineBody::HandleCmd pPlayTone is not NULL"); *************** *** 2242,2264 **** case '#': if (local) { LocalPartyName += ch; continue; } break; case 'A': case 'B': case 'C': ! case ',': if (local) { ! err = TRUE; continue; } break; ! case 'D': break; - case '.': - case ' ': - case '-': - continue; case 'F': setForceFaxMode = TRUE; --- 2244,2279 ---- case '#': if (local) { + if (!CallToken().IsEmpty()) { + // Dialing of calling number is not + // allowed in online command state + err = TRUE; + continue; + } LocalPartyName += ch; continue; } break; + case '+': + if (local) + continue; + if (addNumTone) + continue; + break; case 'A': case 'B': case 'C': ! if (local) ! continue; ! break; ! case 'D': if (local) { ! local = FALSE; continue; } break; ! case ',': ! if (!addNumTone) ! continue; break; case 'F': setForceFaxMode = TRUE; *************** *** 2277,2369 **** case '@': local = FALSE; ! if (pPlayTone) ! delete pPlayTone; ! ! pPlayTone = new PDTMFEncoder; continue; default: ! err = TRUE; continue; } ! if (!pPlayTone) { ! switch (ch) { ! case '0': ! case '1': ! case '2': ! case '3': ! case '4': ! case '5': ! case '6': ! case '7': ! case '8': ! case '9': ! case '*': ! case '#': ! num += ch; ! break; ! case 'D': ! local = FALSE; ! break; ! default: ! err = TRUE; ! } ! } else { switch (ch) { ! case '0': ! case '1': ! case '2': ! case '3': ! case '4': ! case '5': ! case '6': ! case '7': ! case '8': ! case '9': ! case 'A': ! case 'B': ! case 'C': ! case 'D': ! case '*': ! case '#': { ! unsigned ms = P.DialTimeDTMF(); ! pPlayTone->AddTone(ch, ms); ! myPTRACE(2, "Encoded DTMF tone \"" << ch << ":" << ms << "\", size=" << pPlayTone->GetSize()); ! pPlayTone->Generate(' ', 0, 0, ms); ! myPTRACE(2, "Encoded tone \"0 0:" << ms << "\", size=" << pPlayTone->GetSize()); break; } ! case ',': { ! unsigned ms = unsigned(P.DialTimeComma()) * 1000; ! pPlayTone->Generate(' ', 0, 0, ms); ! myPTRACE(2, "Encoded tone \"0 0:" << ms << "\", size=" << pPlayTone->GetSize()); break; } - default: - err = TRUE; } } - } - if (!err) { if (!CallToken().IsEmpty()) { if (connectionEstablished) { - if (!LocalPartyName.IsEmpty()) { - // Can't use local party name in extension number - - if (pPlayTone) { - delete pPlayTone; - pPlayTone = NULL; - } - - if (wasOnHook) - OnHook(); - - err = TRUE; - break; - } - callDirection = setCallDirection; forceFaxMode = (forceFaxMode || setForceFaxMode); --- 2292,2341 ---- case '@': local = FALSE; ! addNumTone = TRUE; ! numTone.MakeEmpty(); continue; default: ! // V.250 ! // Any characters appearing in the dial string that ! // the DCE does not recognize ... shall be ignored. continue; } ! if (!addNumTone) ! num += ch; ! else ! numTone += ch; ! } ! ! myPTRACE(2, "Dial string: " << num << "@" << numTone << "L" << LocalPartyName << (setForceFaxMode ? "F" : "V") << (err ? "" : " - OK")); ! ! if (!err) { ! PDTMFEncoder playTone; ! ! for (PINDEX i = 0 ; i < numTone.GetLength() ; i++) { ! char ch = numTone[i]; ! switch (ch) { ! case ',': { ! unsigned ms = unsigned(P.DialTimeComma()) * 1000; ! playTone.Generate(' ', 0, 0, ms); ! myPTRACE(2, "Encoded tone \"0 0:" << ms << "\", size=" << playTone.GetSize()); break; } ! default: { ! unsigned ms = P.DialTimeDTMF(); ! playTone.AddTone(ch, ms); ! myPTRACE(2, "Encoded DTMF tone \"" << ch << ":" << ms << "\", size=" << playTone.GetSize()); ! playTone.Generate(' ', 0, 0, ms); ! myPTRACE(2, "Encoded tone \"0 0:" << ms << "\", size=" << playTone.GetSize()); break; } } } if (!CallToken().IsEmpty()) { if (connectionEstablished) { callDirection = setCallDirection; forceFaxMode = (forceFaxMode || setForceFaxMode); *************** *** 2374,2377 **** --- 2346,2356 ---- SendOnIdle(EngineBase::dtCng); + if (numTone.GetLength()) { + if (!pPlayTone) + pPlayTone = new PDTMFEncoder(); + + pPlayTone->Concatenate(playTone); + } + break; } *************** *** 2386,2390 **** } ! resp += RC_NO_DIALTONE(); break; } --- 2365,2369 ---- } ! resp += RC_BUSY(); break; } *************** *** 2400,2412 **** timerRing.Stop(); SetState(stConnectWait); - timeout.Start((unsigned(P.S7()) + 1) * 1000); PStringToString request; - request.SetAt("modemtoken", parent.modemToken()); - request.SetAt("command", "dial"); - request.SetAt("number", num); - request.SetAt("localpartyname", LocalPartyName); if (!timerBusy.IsRunning()) { // we can't dial after releasing w/o on-hook Mutex.Signal(); callbackEndPoint(request, 3); --- 2379,2400 ---- timerRing.Stop(); SetState(stConnectWait); PStringToString request; if (!timerBusy.IsRunning()) { // we can't dial after releasing w/o on-hook + if (numTone.GetLength()) { + if (!pPlayTone) + pPlayTone = new PDTMFEncoder(); + + pPlayTone->Concatenate(playTone); + } + + timeout.Start((unsigned(P.S7()) + 1) * 1000); + + request.SetAt("modemtoken", parent.modemToken()); + request.SetAt("command", "dial"); + request.SetAt("number", num); + request.SetAt("localpartyname", LocalPartyName); + Mutex.Signal(); callbackEndPoint(request, 3); *************** *** 2414,2429 **** } ! PString response = request("response"); ! ! if (response == "confirm") { CallToken(request("calltoken")); } else { ! if (wasOnHook) ! OnHook(); ! else ! _ClearCall(); ! ! timeout.Stop(); ! SetState(stCommand); if (crlf) { --- 2402,2409 ---- } ! if (request("response") == "confirm") { CallToken(request("calltoken")); } else { ! OnHook(); if (crlf) { *************** *** 2434,2449 **** } ! PString diag = request("diag"); ! if( diag == "noroute" ) ! resp += RC_BUSY(); ! else ! resp += RC_NO_DIALTONE(); } } else { - if (pPlayTone) { - delete pPlayTone; - pPlayTone = NULL; - } - if (wasOnHook) OnHook(); --- 2414,2420 ---- } ! resp += RC_BUSY(); } } else { if (wasOnHook) OnHook(); *************** *** 3752,3756 **** resp += RC_OK(); } else { ! _ClearCall(); resp += RC_NO_CARRIER(); } --- 3723,3727 ---- resp += RC_OK(); } else { ! OnHook(); resp += RC_NO_CARRIER(); } *************** *** 3821,3825 **** t38engine->ResetModemState(); else ! _ClearCall(); break; case stConnectHandle: --- 3792,3796 ---- t38engine->ResetModemState(); else ! OnHook(); break; case stConnectHandle: *************** *** 3830,3835 **** case stConnectWait: resp = RC_NO_CARRIER(); ! SetState(stCommand); ! _ClearCall(); break; default: --- 3801,3805 ---- case stConnectWait: resp = RC_NO_CARRIER(); ! OnHook(); break; default: *************** *** 3907,3911 **** resp = RC_ERROR(); ! SetState(stCommand); break; case stSend: --- 3877,3882 ---- resp = RC_ERROR(); ! timeout.Stop(); ! OnHook(); break; case stSend: *************** *** 3954,3965 **** Mutex.Wait(); ! PString response = request("response"); ! ! if (response == "confirm") { CallToken(request("calltoken")); } else { - _ClearCall(); timeout.Stop(); ! parent.SignalDataReady(); // try to stConnectWait w/o delay } } --- 3925,3934 ---- Mutex.Wait(); ! if (request("response") == "confirm") { CallToken(request("calltoken")); } else { timeout.Stop(); ! OnHook(); ! resp = RC_BUSY(); } } *************** *** 4019,4023 **** resp = RC_ERROR(); SetState(stCommand); ! _ClearCall(); } --- 3988,3992 ---- resp = RC_ERROR(); SetState(stCommand); ! OnHook(); } |
|
From: Vyacheslav F. <vf...@us...> - 2010-09-08 17:22:33
|
Update of /cvsroot/t38modem/t38modem In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv24656 Modified Files: audio.h enginebase.cxx enginebase.h pmodeme.cxx t38engine.cxx t38engine.h Log Message: Redesigned modem engine (continue) Index: pmodeme.cxx =================================================================== RCS file: /cvsroot/t38modem/t38modem/pmodeme.cxx,v retrieving revision 1.91 retrieving revision 1.92 diff -C2 -d -r1.91 -r1.92 *** pmodeme.cxx 9 Jul 2010 04:46:55 -0000 1.91 --- pmodeme.cxx 8 Sep 2010 17:22:23 -0000 1.92 *************** *** 25,28 **** --- 25,31 ---- * * $Log$ + * Revision 1.92 2010/09/08 17:22:23 vfrolov + * Redesigned modem engine (continue) + * * Revision 1.91 2010/07/09 04:46:55 vfrolov * Implemented alternate route *************** *** 465,473 **** [...1423 lines suppressed...] ! if (P.AudioClass()) { resp = RC_OK(); } --- 4301,4305 ---- SetState(stCommand); ! if (P.ModemClassId() == EngineBase::mcAudio) { resp = RC_OK(); } *************** *** 4200,4203 **** --- 4352,4358 ---- bresp.Concatenate(_bresp); } + + if (state == stCommand) + SendOnIdle(EngineBase::dtNone); } /////////////////////////////////////////////////////////////// Index: t38engine.cxx =================================================================== RCS file: /cvsroot/t38modem/t38modem/t38engine.cxx,v retrieving revision 1.68 retrieving revision 1.69 diff -C2 -d -r1.68 -r1.69 *** t38engine.cxx 22 Apr 2010 15:41:30 -0000 1.68 --- t38engine.cxx 8 Sep 2010 17:22:23 -0000 1.69 *************** *** 25,28 **** --- 25,31 ---- * * $Log$ + * Revision 1.69 2010/09/08 17:22:23 vfrolov + * Redesigned modem engine (continue) + * * Revision 1.68 2010/04/22 15:41:30 vfrolov * Fixed +FRS delay if remote does not send no-signal indicator *************** *** 651,654 **** --- 654,659 ---- myPTRACE(1, name << " ResetModemState stateModem(" << stateModem << ") != stmIdle"); } + + callbackParamIn = cbpReset; callbackParamOut = cbpReset; *************** *** 932,936 **** } ! int T38Engine::RecvDiag() { PWaitAndSignal mutexWaitModem(MutexModem); --- 937,941 ---- } ! int T38Engine::RecvDiag() const { PWaitAndSignal mutexWaitModem(MutexModem); *************** *** 1331,1342 **** } } else { ! switch( onIdleOut ) { case dtCng: t38indicator(ifp, T38I(e_cng)); break; - case dtSilence: - t38indicator(ifp, T38I(e_no_signal)); - break; default: waitData = TRUE; } --- 1336,1346 ---- } } else { ! switch (onIdleOut) { case dtCng: t38indicator(ifp, T38I(e_cng)); break; default: + PTRACE(1, name << " SendOnIdle dataType(" << onIdleOut << ") is not supported"); + case dtNone: waitData = TRUE; } Index: enginebase.h =================================================================== RCS file: /cvsroot/t38modem/t38modem/enginebase.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** enginebase.h 7 Jul 2010 08:09:47 -0000 1.8 --- enginebase.h 8 Sep 2010 17:22:23 -0000 1.9 *************** *** 25,28 **** --- 25,31 ---- * * $Log$ + * Revision 1.9 2010/09/08 17:22:23 vfrolov + * Redesigned modem engine (continue) + * * Revision 1.8 2010/07/07 08:09:47 vfrolov * Added IsAttached() *************** *** 63,68 **** --- 66,74 ---- public: + /**@name Construction */ + //@{ EngineBase(const PString &_name = ""); virtual ~EngineBase(); + //@} enum { *************** *** 84,92 **** enum ModemCallbackParam { ! cbpUserDataMask = 0xFF, ! cbpOutBufNoFull = 256, ! cbpReset = -1, ! cbpOutBufEmpty = -2, ! cbpUserInput = -3, }; --- 90,99 ---- enum ModemCallbackParam { ! cbpUserDataMask = 0xFF, ! cbpOutBufNoFull = 256, ! cbpUpdateState = 257, ! cbpReset = -1, ! cbpOutBufEmpty = -2, ! cbpUserInput = -3, }; *************** *** 108,111 **** --- 115,121 ---- void CloseOut(); + PBoolean IsOpenIn() const { return isOpenIn && IsModemOpen(); } + PBoolean IsOpenOut() const { return isOpenOut && IsModemOpen(); } + PBoolean TryLockModemCallback(); void UnlockModemCallback(); *************** *** 115,124 **** void WriteUserInput(const PString & value); int RecvUserInput(void * pBuf, PINDEX count); //@} protected: PBoolean IsModemOpen() const { return !modemCallback.IsNULL(); } - PBoolean IsOpenIn() const { return isOpenIn && IsModemOpen(); } - PBoolean IsOpenOut() const { return isOpenOut && IsModemOpen(); } virtual void OnAttach(); --- 125,144 ---- void WriteUserInput(const PString & value); int RecvUserInput(void * pBuf, PINDEX count); + + virtual void SendOnIdle(DataType _dataType) = 0; + virtual PBoolean SendStart(DataType _dataType, int param) = 0; + virtual int Send(const void *pBuf, PINDEX count) = 0; + virtual PBoolean SendStop(PBoolean moreFrames, int _callbackParam) = 0; + virtual PBoolean isOutBufFull() const = 0; + + virtual PBoolean RecvWait(DataType _dataType, int param, int _callbackParam, PBoolean &done) = 0; + virtual PBoolean RecvStart(int _callbackParam) = 0; + virtual int Recv(void *pBuf, PINDEX count) = 0; + virtual void RecvStop() = 0; + virtual int RecvDiag() const { return 0; }; //@} protected: PBoolean IsModemOpen() const { return !modemCallback.IsNULL(); } virtual void OnAttach(); Index: t38engine.h =================================================================== RCS file: /cvsroot/t38modem/t38modem/t38engine.h,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** t38engine.h 18 Mar 2010 08:42:17 -0000 1.37 --- t38engine.h 8 Sep 2010 17:22:24 -0000 1.38 *************** *** 25,28 **** --- 25,31 ---- * * $Log$ + * Revision 1.38 2010/09/08 17:22:24 vfrolov + * Redesigned modem engine (continue) + * * Revision 1.37 2010/03/18 08:42:17 vfrolov * Added named tracing of data types *************** *** 204,222 **** //@{ void ResetModemState(); - PBoolean isOutBufFull() const; ! void SendOnIdle(DataType _dataType); ! PBoolean SendStart(DataType _dataType, int param); ! int Send(const void *pBuf, PINDEX count); ! PBoolean SendStop(PBoolean moreFrames, int _callbackParam); ! PBoolean RecvWait(DataType _dataType, int param, int _callbackParam, PBoolean &done); ! PBoolean RecvStart(int _callbackParam); ! int Recv(void *pBuf, PINDEX count); ! int RecvDiag(); ! void RecvStop(); PBoolean SendingNotCompleted() const; - //@} void Close() { CloseIn(); CloseOut(); } --- 207,224 ---- //@{ void ResetModemState(); ! virtual void SendOnIdle(DataType _dataType); ! virtual PBoolean SendStart(DataType _dataType, int param); ! virtual int Send(const void *pBuf, PINDEX count); ! virtual PBoolean SendStop(PBoolean moreFrames, int _callbackParam); ! virtual PBoolean isOutBufFull() const; ! virtual PBoolean RecvWait(DataType _dataType, int param, int _callbackParam, PBoolean &done); ! virtual PBoolean RecvStart(int _callbackParam); ! virtual int Recv(void *pBuf, PINDEX count); ! virtual void RecvStop(); ! virtual int RecvDiag() const; PBoolean SendingNotCompleted() const; void Close() { CloseIn(); CloseOut(); } *************** *** 256,259 **** --- 258,262 ---- unsigned nLost ); + //@} protected: Index: audio.h =================================================================== RCS file: /cvsroot/t38modem/t38modem/audio.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** audio.h 18 Mar 2010 08:42:17 -0000 1.5 --- audio.h 8 Sep 2010 17:22:23 -0000 1.6 *************** *** 25,28 **** --- 25,31 ---- * * $Log$ + * Revision 1.6 2010/09/08 17:22:23 vfrolov + * Redesigned modem engine (continue) + * * Revision 1.5 2010/03/18 08:42:17 vfrolov * Added named tracing of data types *************** *** 59,77 **** public: AudioEngine(const PString &_name = ""); ~AudioEngine(); PBoolean Read(void * buffer, PINDEX amount); ! void SendOnIdle(DataType _dataType); ! PBoolean SendStart(DataType _dataType, int param); ! int Send(const void *pBuf, PINDEX count); ! PBoolean SendStop(PBoolean moreFrames, int _callbackParam); ! PBoolean isOutBufFull() const; PBoolean Write(const void * buffer, PINDEX len); ! PBoolean RecvWait(DataType _dataType, int param, int _callbackParam, PBoolean &done); ! PBoolean RecvStart(int _callbackParam); ! int Recv(void *pBuf, PINDEX count); ! void RecvStop(); protected: --- 62,87 ---- public: + /**@name Construction */ + //@{ AudioEngine(const PString &_name = ""); ~AudioEngine(); + //@} + /**@name Modem API */ + //@{ PBoolean Read(void * buffer, PINDEX amount); ! virtual void SendOnIdle(DataType _dataType); ! virtual PBoolean SendStart(DataType _dataType, int param); ! virtual int Send(const void *pBuf, PINDEX count); ! virtual PBoolean SendStop(PBoolean moreFrames, int _callbackParam); ! virtual PBoolean isOutBufFull() const; PBoolean Write(const void * buffer, PINDEX len); ! virtual PBoolean RecvWait(DataType _dataType, int param, int _callbackParam, PBoolean &done); ! virtual PBoolean RecvStart(int _callbackParam); ! virtual int Recv(void *pBuf, PINDEX count); ! virtual void RecvStop(); ! ! //@} protected: Index: enginebase.cxx =================================================================== RCS file: /cvsroot/t38modem/t38modem/enginebase.cxx,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** enginebase.cxx 7 Jul 2010 08:09:47 -0000 1.8 --- enginebase.cxx 8 Sep 2010 17:22:23 -0000 1.9 *************** *** 25,28 **** --- 25,31 ---- * * $Log$ + * Revision 1.9 2010/09/08 17:22:23 vfrolov + * Redesigned modem engine (continue) + * * Revision 1.8 2010/07/07 08:09:47 vfrolov * Added IsAttached() *************** *** 70,74 **** } ! return out << INT(dataType); } --- 73,77 ---- } ! return out << "dt" << INT(dataType); } *************** *** 76,87 **** { switch (param) { ! case EngineBase::cbpUserDataMask: break; ! case EngineBase::cbpOutBufNoFull: return out << "cbpOutBufNoFull"; ! case EngineBase::cbpReset: return out << "cbpReset"; ! case EngineBase::cbpOutBufEmpty: return out << "cbpOutBufEmpty"; ! case EngineBase::cbpUserInput: return out << "cbpUserInput"; } ! return out << INT(param); } --- 79,91 ---- { switch (param) { ! case EngineBase::cbpUserDataMask: break; ! case EngineBase::cbpOutBufNoFull: return out << "cbpOutBufNoFull"; ! case EngineBase::cbpUpdateState: return out << "cbpUpdateState"; ! case EngineBase::cbpReset: return out << "cbpReset"; ! case EngineBase::cbpOutBufEmpty: return out << "cbpOutBufEmpty"; ! case EngineBase::cbpUserInput: return out << "cbpUserInput"; } ! return out << "cbp" << INT(param); } *************** *** 94,98 **** } ! return out << INT(modemClass); } #endif --- 98,102 ---- } ! return out << "mc" << INT(modemClass); } #endif *************** *** 190,193 **** --- 194,199 ---- OnOpenIn(); + + ModemCallbackWithUnlock(cbpUpdateState); } *************** *** 204,207 **** --- 210,215 ---- OnOpenOut(); + + ModemCallbackWithUnlock(cbpUpdateState); } *************** *** 218,221 **** --- 226,231 ---- OnCloseIn(); + + ModemCallbackWithUnlock(cbpUpdateState); } *************** *** 232,235 **** --- 242,247 ---- OnCloseOut(); + + ModemCallbackWithUnlock(cbpUpdateState); } |
|
From: Vyacheslav F. <vf...@us...> - 2010-07-09 13:18:21
|
Update of /cvsroot/t38modem/t38modem/opal In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv30923 Modified Files: modemep.cxx manager.cxx Log Message: Fixed help message Index: modemep.cxx =================================================================== RCS file: /cvsroot/t38modem/t38modem/opal/modemep.cxx,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** modemep.cxx 9 Jul 2010 07:12:36 -0000 1.26 --- modemep.cxx 9 Jul 2010 13:18:13 -0000 1.27 *************** *** 25,28 **** --- 25,31 ---- * * $Log$ + * Revision 1.27 2010/07/09 13:18:13 vfrolov + * Fixed help message + * * Revision 1.26 2010/07/09 07:12:36 vfrolov * Added "Trying alternate route ..." message *************** *** 246,255 **** " Use none@tty to disable incoming calls.\n" " See Modem drivers section for tty format.\n" ! " --force-fax-mode : Force fax mode (T.38 or G.711 pass-trough).\n" ! " Can be overriden by route option\n" ! " OPAL-Force-Fax-Mode=false\n" ! " --no-force-t38-mode : No force T.38 mode.\n" ! " Can be overriden by route option\n" ! " OPAL-No-Force-T38-Mode=false\n" "Modem drivers:\n" ).Lines(); --- 249,266 ---- " Use none@tty to disable incoming calls.\n" " See Modem drivers section for tty format.\n" ! " --force-fax-mode : Use OPAL-Force-Fax-Mode=true route option by\n" ! " default.\n" ! " --no-force-t38-mode : Use OPAL-No-Force-T38-Mode=true route option by\n" ! " default.\n" ! "Modem route options:\n" ! " OPAL-Set-Up-Phase-Timeout=secs\n" ! " Set timeout for outgoing call Set-Up phase to secs seconds.\n" ! " OPAL-Try-Next=dst\n" ! " Set alternate incoming destination address for outgoing calls to dst. This\n" ! " address will be used to re-route if outgoing call Set-Up phase fails.\n" ! " OPAL-Force-Fax-Mode={true|false}\n" ! " Enable or disable forcing fax mode (T.38 or G.711 pass-trough).\n" ! " OPAL-No-Force-T38-Mode={true|false}\n" ! " Not enable or not disable forcing T.38 mode.\n" "Modem drivers:\n" ).Lines(); Index: manager.cxx =================================================================== RCS file: /cvsroot/t38modem/t38modem/opal/manager.cxx,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** manager.cxx 8 Jul 2010 11:40:18 -0000 1.14 --- manager.cxx 9 Jul 2010 13:18:13 -0000 1.15 *************** *** 25,28 **** --- 25,31 ---- * * $Log$ + * Revision 1.15 2010/07/09 13:18:13 vfrolov + * Fixed help message + * * Revision 1.14 2010/07/08 11:40:18 vfrolov * Fixed route message for sip *************** *** 123,132 **** " T is 'udp', 'rtp' or 'tcp'. B and M are numbers.\n" " --route pat=dst[;option[=value][;...]]\n" ! " : Route the incoming calls with destination address\n" " matching the regexp pat to the outgoing\n" " destination address dst.\n" ! " If dst contains '<dn>', it will be replaced by a\n" ! " destination number. To strip N first digits from\n" ! " number use '<dn!N>' form.\n" " If the specification is of the form @filename,\n" " then the file is read with each line consisting\n" --- 126,137 ---- " T is 'udp', 'rtp' or 'tcp'. B and M are numbers.\n" " --route pat=dst[;option[=value][;...]]\n" ! " : Route the calls with incoming destination address\n" " matching the regexp pat to the outgoing\n" " destination address dst.\n" ! " All '<dn>' meta-strings found in dst or in\n" ! " following route options will be replaced by all\n" ! " valid consecutive E.164 digits from the incoming\n" ! " destination address. To strip N first digits use\n" ! " '<dn!N>' meta-string.\n" " If the specification is of the form @filename,\n" " then the file is read with each line consisting\n" |
|
From: Vyacheslav F. <vf...@us...> - 2010-07-09 07:12:44
|
Update of /cvsroot/t38modem/t38modem/opal In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv24240 Modified Files: modemep.cxx Log Message: Added "Trying alternate route ..." message Index: modemep.cxx =================================================================== RCS file: /cvsroot/t38modem/t38modem/opal/modemep.cxx,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** modemep.cxx 9 Jul 2010 04:51:55 -0000 1.25 --- modemep.cxx 9 Jul 2010 07:12:36 -0000 1.26 *************** *** 25,28 **** --- 25,31 ---- * * $Log$ + * Revision 1.26 2010/07/09 07:12:36 vfrolov + * Added "Trying alternate route ..." message + * * Revision 1.25 2010/07/09 04:51:55 vfrolov * Implemented alternate route option (OPAL-Try-Next) *************** *** 330,333 **** --- 333,347 ---- PString partyB = request("number") + "@" + modem->ttyName(); + PString originalPartyB; + long tries = request("trynextcount").AsInteger(); + + if (tries++ > 0) { + originalPartyB = request("originalpartyb"); + cout << "Trying alternate route " << tries << " to " << partyB << " instead " << originalPartyB << endl; + PTRACE(1, "Trying alternate route " << tries << " to " << partyB << " instead " << originalPartyB); + } else { + originalPartyB = partyB; + } + myPTRACE(1, "MyManager::OnMyCallback SetUpCall(" << partyA << ", " << partyB << ")"); *************** *** 338,341 **** --- 352,360 ---- if (pConn != NULL) { + OpalConnection::StringOptions newOptions; + newOptions.SetAt("Try-Next-Count", tries); + newOptions.SetAt("Original-Party-B", originalPartyB); + pConn->SetStringOptions(newOptions, false); + request.SetAt("calltoken", pConn->GetToken()); response = "confirm"; *************** *** 552,555 **** --- 571,576 ---- request.SetAt("number", num); request.SetAt("localpartyname", remotePartyNumber); + request.SetAt("trynextcount", GetStringOptions().Contains("Try-Next-Count") ? GetStringOptions()("Try-Next-Count") : "1"); + request.SetAt("originalpartyb", GetStringOptions().Contains("Original-Party-B") ? GetStringOptions()("Original-Party-B") : "unknown"); } break; |
|
From: Vyacheslav F. <vf...@us...> - 2010-07-09 04:52:03
|
Update of /cvsroot/t38modem/t38modem/opal In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv2082 Modified Files: modemep.cxx Log Message: Implemented alternate route option (OPAL-Try-Next) Added timeout option for SetUpPhase (OPAL-Set-Up-Phase-Timeout) Index: modemep.cxx =================================================================== RCS file: /cvsroot/t38modem/t38modem/opal/modemep.cxx,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** modemep.cxx 7 Jul 2010 08:11:44 -0000 1.24 --- modemep.cxx 9 Jul 2010 04:51:55 -0000 1.25 *************** *** 25,28 **** --- 25,32 ---- * * $Log$ + * Revision 1.25 2010/07/09 04:51:55 vfrolov + * Implemented alternate route option (OPAL-Try-Next) + * Added timeout option for SetUpPhase (OPAL-Set-Up-Phase-Timeout) + * * Revision 1.24 2010/07/07 08:11:44 vfrolov * Fixed race condition with engine attaching *************** *** 185,188 **** --- 189,198 ---- T38Engine * t38engine; PseudoModemMode requestedMode; + bool isPartyA; + + PDECLARE_NOTIFIER(PTimer, ModemConnection, OnPhaseTimeout); + PTimer phaseTimer; + Phases phaseTimerPhase; + bool phaseWasTimeout; }; ///////////////////////////////////////////////////////////////////////////// *************** *** 486,494 **** , t38engine(NULL) , requestedMode(pmmAny) { remotePartyNumber = GetPartyName(remoteParty); remotePartyAddress = remoteParty; ! myPTRACE(1, "ModemConnection::ModemConnection " << *this); if (userData) --- 496,509 ---- , t38engine(NULL) , requestedMode(pmmAny) + , isPartyA(userData != NULL) + , phaseTimerPhase(NumPhases) + , phaseWasTimeout(false) { remotePartyNumber = GetPartyName(remoteParty); remotePartyAddress = remoteParty; ! myPTRACE(4, "ModemConnection::ModemConnection " << *this); ! ! phaseTimer.SetNotifier(PCREATE_NOTIFIER(OnPhaseTimeout)); if (userData) *************** *** 498,502 **** ModemConnection::~ModemConnection() { ! myPTRACE(1, "ModemConnection::~ModemConnection " << *this); if (pmodem != NULL) { --- 513,517 ---- ModemConnection::~ModemConnection() { ! myPTRACE(4, "ModemConnection::~ModemConnection " << *this << " " << GetCallEndReason()); if (pmodem != NULL) { *************** *** 507,521 **** pmodem->Detach(audioEngine); PStringToString request; request.SetAt("command", "clearcall"); request.SetAt("calltoken", GetToken()); - if( !pmodem->Request(request) ) { - myPTRACE(1, "ModemConnection::~ModemConnection error request={\n" << request << "}"); - } ! ModemEndPoint &ep = (ModemEndPoint &)GetEndPoint(); ! ep.PMFree(pmodem); ! pmodem = NULL; } --- 522,565 ---- pmodem->Detach(audioEngine); + PseudoModem *pmodemTmp = pmodem; + + ((ModemEndPoint &)GetEndPoint()).PMFree(pmodem); + pmodem = NULL; + PStringToString request; request.SetAt("command", "clearcall"); request.SetAt("calltoken", GetToken()); ! if (isPartyA) { ! switch (GetCallEndReason()) { ! case EndedByLocalUser: ! if (!phaseWasTimeout) ! break; ! case EndedByQ931Cause: ! case EndedByConnectFail: ! case EndedByGatekeeper: ! case EndedByNoBandwidth: ! case EndedByCapabilityExchange: ! case EndedByCallForwarded: ! case EndedByNoEndPoint: ! case EndedByHostOffline: ! case EndedByUnreachable: ! case EndedByTransportFail: ! if (GetStringOptions().Contains("Try-Next")) { ! PString num = GetStringOptions()("Try-Next"); ! myPTRACE(1, "ModemConnection::~ModemConnection: Try-Next=" << num); ! request.SetAt("trynextcommand", "dial"); ! request.SetAt("number", num); ! request.SetAt("localpartyname", remotePartyNumber); ! } ! break; ! default: ! break; ! } ! } ! if (!pmodemTmp->Request(request)) { ! myPTRACE(1, "ModemConnection::~ModemConnection error request={\n" << request << "}"); ! } } *************** *** 525,528 **** --- 569,585 ---- if (audioEngine != NULL) delete audioEngine; + + phaseTimer.Stop(); + } + + void ModemConnection::OnPhaseTimeout(PTimer &, INT) + { + PTRACE(4, "ModemConnection::OnPhaseTimeout: for " << phaseTimerPhase << " on " << GetPhase()); + + if (phaseTimerPhase == GetPhase()) { + PTRACE(4, "ModemConnection::OnPhaseTimeout: clearing call"); + phaseWasTimeout = true; + ClearCall(); + } } *************** *** 609,612 **** --- 666,680 ---- } + if (GetStringOptions().Contains("Set-Up-Phase-Timeout")) { + long secs = GetStringOptions()("Set-Up-Phase-Timeout").AsInteger(); + + PTRACE(4, "ModemConnection::SetUpConnection: Set-Up-Phase-Timeout=" << secs); + + if (secs > 0) { + phaseTimerPhase = SetUpPhase; + phaseTimer.SetInterval(0, secs); + } + } + return TRUE; } |
|
From: Vyacheslav F. <vf...@us...> - 2010-07-09 04:47:03
|
Update of /cvsroot/t38modem/t38modem In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv1292 Modified Files: pmodeme.cxx Log Message: Implemented alternate route Index: pmodeme.cxx =================================================================== RCS file: /cvsroot/t38modem/t38modem/pmodeme.cxx,v retrieving revision 1.90 retrieving revision 1.91 diff -C2 -d -r1.90 -r1.91 *** pmodeme.cxx 8 Jul 2010 05:11:34 -0000 1.90 --- pmodeme.cxx 9 Jul 2010 04:46:55 -0000 1.91 *************** *** 25,28 **** --- 25,31 ---- * * $Log$ + * Revision 1.91 2010/07/09 04:46:55 vfrolov + * Implemented alternate route + * * Revision 1.90 2010/07/08 05:11:34 vfrolov * Redesigned modem engine (continue) *************** *** 586,589 **** --- 589,593 ---- enum State { stCommand, + stDial, stConnectWait, stConnectHandle, *************** *** 604,607 **** --- 608,612 ---- switch (state) { case stCommand: return out << "stCommand"; + case stDial: return out << "stDial"; case stConnectWait: return out << "stConnectWait"; case stConnectHandle: return out << "stConnectHandle"; *************** *** 836,839 **** --- 841,845 ---- int param; + PStringToString params; PString cmd; EngineBase::DataType dataType; *************** *** 1192,1196 **** if (CallToken() == request("calltoken")) { CallToken(""); ! _ClearCall(); request.SetAt("response", "confirm"); } --- 1198,1213 ---- if (CallToken() == request("calltoken")) { CallToken(""); ! ! if (callState == cstDialing && state == stConnectWait && request("trynextcommand") == "dial") { ! SetState(stDial); ! params = request; ! params.RemoveAt("command"); ! params.RemoveAt("calltoken"); ! params.RemoveAt("trynextcommand"); ! parent.SignalDataReady(); ! } else { ! _ClearCall(); ! } ! request.SetAt("response", "confirm"); } *************** *** 2245,2256 **** CallToken(request("calltoken")); } else { - callDirection = cdUndefined; - forceFaxMode = FALSE; - - if (pPlayTone) { - delete pPlayTone; - pPlayTone = NULL; - } - if (wasOnHook) OnHook(); --- 2262,2265 ---- *************** *** 3745,3748 **** --- 3754,3758 ---- case stCommand: break; + case stDial: case stConnectWait: case stConnectHandle: *************** *** 3788,3791 **** --- 3798,3825 ---- switch (state) { + case stDial: + { + SetState(stConnectWait); + timeout.Start((unsigned(P.S7()) + 1) * 1000); + + PStringToString request = params; + request.SetAt("modemtoken", parent.modemToken()); + request.SetAt("command", "dial"); + + Mutex.Signal(); + callbackEndPoint(request, 5); + Mutex.Wait(); + + PString response = request("response"); + + if (response == "confirm") { + CallToken(request("calltoken")); + } else { + _ClearCall(); + timeout.Stop(); + parent.SignalDataReady(); // try to stConnectWait w/o delay + } + } + break; case stSendBufEmptyHandle: { |
|
From: Vyacheslav F. <vf...@us...> - 2010-07-09 04:44:36
|
Update of /cvsroot/t38modem/t38modem In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv986 Modified Files: audio.cxx Log Message: Added tracing targetTimeFakeOut Index: audio.cxx =================================================================== RCS file: /cvsroot/t38modem/t38modem/audio.cxx,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** audio.cxx 18 Mar 2010 08:42:17 -0000 1.12 --- audio.cxx 9 Jul 2010 04:44:27 -0000 1.13 *************** *** 25,28 **** --- 25,31 ---- * * $Log$ + * Revision 1.13 2010/07/09 04:44:27 vfrolov + * Added tracing targetTimeFakeOut + * * Revision 1.12 2010/03/18 08:42:17 vfrolov * Added named tracing of data types *************** *** 334,337 **** --- 337,342 ---- return FALSE; + PTRACE(5, "AudioEngine::isOutBufFull targetTimeFakeOut=" << targetTimeFakeOut.AsString("yyyy/MM/dd hh:mm:ss.uuu", PTime::Local)); + timerFakeOut = sleep_time; |