Read-only archive of the All About Symbian forum (2001–2013) · About this archive

dial a number after hangup

2 replies · 4,888 views · Started 15 November 2007

Hi
on 3rd edition:
below is code I use in an active class to detect a dialing event,
hangup the call and call a different number instead.

I encounter 2 problems:
1) Some times the call I initiate using DialNewCall (after hanging up a call) doesnt actually make a real call - I can see the dialing notification but no dialing occures.

2) When DialNewCall succeeds ,if for some reason I get an Idle event (for e.g if dest is shut down),I use CancelAsync(),DialCancel() and than Close() the call,but many times the device gets stuck after doing that.

What would you suggest me to change in order to make this code more stable? (without the device getting stuck and calls that doesn't work)

Thank you


//Event😃ialing
RLine::TLineInfo lineInfo;
iLine.GetInfo(lineInfo);
TInt openExisting = User::LeaveIfError(iCall.OpenExistingCall(iLine,lineInfo.iNameOfLastCallAdded));
RMobileCall::TMobileCallInfoV1 iRemotePartyInfo;
RMobileCall::TMobileCallInfoV1Pckg des(iRemotePartyInfo);
iCall.GetMobileCallInfo(des);
iRemotePartyInfo = des();
TBuf<30> callerNumber;
callerNumber.Append(iRemotePartyInfo.iDialledParty.iTelNumber);
//Hangup the call (from AppUi class):
TKeyEvent key2;
TRawEvent ev1;
TRawEvent ev2;
RWsSession ws;
ws.Connect();
key2.iCode =EKeyNo;
key2.iModifiers = 0;
key2.iRepeats = 0;
key2.iScanCode =EStdKeyNo;
ws.SimulateKeyEvent(key2);
ws.Flush();
ev1.Set(TRawEvent::EKeyDown, EStdKeyNo);
UserSvr::AddEvent(ev1);
ev2.Set(TRawEvent::EKeyUp, EStdKeyNo);
UserSvr::AddEvent(ev2);
ws.Close();

//Event:Idle - make a new call
iCall.Close();
TBuf <100> newCallName;
User::LeaveIfError(iCall.OpenNewCall(iLine, newCallName)
CTelephony::TTelNumber telNumber(tsdNum->Des());
CTelephony::TCallParamsV1 callParams;
callParams.iIdRestrict = CTelephony::ESendMyId;
CTelephony::TCallParamsV1Pckg callParamsPckg(callParams);
iTelephony->DialNewCall(iStatus,callParamsPckg,telNumber,iCallId,CTelephony::EVoiceLine);

//if I dont get connecting event (number not available)
iCall.DialCancel();
iTelephony->CancelAsync(CTelephony::EDialNewCallCancel);
iCall.Close();
User::WaitForRequest(iStatus);
Cancel()

Hi
Update:
it seems that these problems occures on Dual mode.
switching to GSM is not a good solution cause I need this code to work also in Dual.

Have a great Week !

I think that maybe "restarting" the active object after the call hangs up would solve many problems.
Does it sound like a possible solution?
if it is a possible solution,the question is how do I restart the Active object from the active object itself?
Any tips would help