Hi,
I am using CPhCltCommandHandler::Vts() to send DTMF tone.
But from our actual test result on device (N95 in our case). Vts() will complete (calling RunL()) very soon. If we send 10 DTMF tones, it will complete very fast (like 1 sec) but the phone device will only finish sending out DTMF tone in like 6~10 sec.
Because we aim to make conference call right after sending DTMF tone. So how can we detect exactly or rather accurately when will DTMF tone finish sending?
We have even tried to kill the app. after Vts() completes. And still the phone will keep sending out DTMF tones. So seems Vts() only pass the request to the phone and then let the phone handle slowly.
We tried to set a timeout (like 10 sec for 10 DTMF tones). But the problem is different phones send DTMF tone in different speed.... So making it very hard to make estimation.
I am using Phone Client Extension API. And basically modified the example inside as follows.
In this particular code, PhCltCallBack(2) is called after all Vts() completes. But the phone is actually still sending DTMF tone slowly.
Any solutions how to detect end of DTMF sending?
Thanks,
Picco
#include "PhCltCommandHandler_DTMF.h"
#include <EIKENV.H>
CExtensionDTMF::CExtensionDTMF(MPhCltCallBack* parent)
: CActive(EPriorityStandard),
#ifndef _S60_FP2_
iFactory(NULL),
#endif
parent(parent),iHandler(NULL)
{
isHoldingCall = false;
}
CExtensionDTMF::~CExtensionDTMF()
{
Cancel();
if(iHandler)
{
#ifndef _S60_FP2_
iHandler->Close();
#endif
}
delete iHandler;
iHandler = NULL;
#ifndef _S60_FP2_
iLibrary.Close();
#endif
}
void CExtensionDTMF::ConstructL(void)
{
CActiveScheduler::Add(this);
holdcase = 0;
#ifndef _S60_FP2_
_LIT( KPhCltExtLib, "PhoneClientExt.dll" );
// Factory class for creating command handler
User::LeaveIfError( iLibrary.Load( KPhCltExtLib ) ); // Load PhoneClientExt dll
#ifndef __WINS__
TInt res = 0; TInt err=0;
TRAP(err,res = iLibrary.Lookup( 1 )());
if (err == KErrNone)
{
iFactory = reinterpret_cast< CPhCltExtFactory * >( res );
if ( iFactory )
{
iHandler = iFactory->CPhCltCommandHandlerLD();
User::LeaveIfError(iServer.Connect());
iHandler->Open(iServer);
}
}
#endif
#endif
#ifdef _S60_FP2_
iHandler = CPhCltCommandHandler::NewL();
#endif
}
void CExtensionDTMF::HoldCall()
{
#ifndef __WINS__
isHoldingCall = true;
iHandler->Chld(iStatus,EPhCltChldTwo,0);
//User::WaitForRequest(iStatus);
SetActive();
#endif
}
void CExtensionDTMF::SendDTMF(const TDesC8& aTones)
{
#ifndef __WINS__
iCurrentTone = 0;
iDTMFTones.Copy(aTones);
SendOneTone();
#endif
}
void CExtensionDTMF::SendOneTone(void)
{
#ifndef __WINS__
if(iCurrentTone < iDTMFTones.Length())
{
iSendingTone = iDTMFTones[iCurrentTone];
iCurrentTone++;
iSending = ETrue;
iHandler->Vts(iStatus,iSendingTone,EPhCltDtmfStart);
SetActive();
}
else
{
parent->PhCltCallBack(2);
//done..
}
#endif
}
void CExtensionDTMF::RunL()
{
if (isHoldingCall) {
isHoldingCall = false;
parent->PhCltCallBack(holdcase);
return;
}
#ifndef __WINS__
if(iSending)
{
iSending = EFalse;
iHandler->Vts(iStatus,iSendingTone,EPhCltDtmfStop);
SetActive();
}
else
{
SendOneTone();// send next tone
}
#endif
}
void CExtensionDTMF:oCancel()
{
}
// End of File

oCancel()


