I am making an application that needs to dial a no. and once the phone call is established, the control must return to the application. Then the user accesses a menu in the application and selects options, each of which send DTMF tones over the established connection. My main problem is that once a connection is established, how does control return back to the application that initiated the call?

I have tried the following code (obtained fron the forum itself) and have a problem in compiling it. On the ARMIB platform, I get an error "Dialer[xxx].app contains uninitialized data" where Dialer is the app name and xxx are some digits. However, the same code, when I compiled on the WINSB platform gave no errors. Can you tell me a possile reason?
I am using the Borland C++ mobile edition.

class myAppUi
TInt CallNumber();
TInt DoCallNumber();
static TInt DoCall(TAny *aAppUi);
CIdle* iPhoneCall;
RCall call;
RTelServer server;

_LIT(KTsyName, "Phonetsy.tsy"); //phone constant

void myAppUi::CallNumber()

// The name of the TSY to use to make the call.

RTelServer::TPhoneInfo info;
RPhone::TLineInfo lineInfo;

// Connect to the telephony server and load the TSY.


// Get the details for the first (and only) phone.
User::LeaveIfError(server.GetPhoneInfo(0, info));

// Open the phone.
RPhone phone;
User::LeaveIfError(phone.Open(server, info.iName));

// Get the information for the voice line, line 0.
User::LeaveIfError(phone.GetLineInfo(0, lineInfo));

// Open the line. iName will now be "VoiceLine1".
RLine line;
User::LeaveIfError(line.Open(phone, lineInfo.iName));

// Open a new phone call.
_LIT(KPhoneNumber, "18888888888");

if (!(iPhoneCall))
iPhoneCall = CIdle::NewL(CActive::EPriorityIdle);


TInt CNokiaREAppView::DoCall(TAny *aAppUi)
return ((myAppUi*)aAppUi)->DoCallNumber();

TInt myAppUi::DoCallNumber()

TBool ret;
RCall::TStatus iCallStatus;

// check for status of the call set ret to ETrue when hannging up
// or idle. and bring app to front

if (iCallStatus == RCall::EStatusHangingUp || iCallStatus == RCall::EStatusIdle)
ret = EFalse; //finished do not come back
//bring app to foreground
TApaTask task(wsSession);
ret = ETrue; //not finish, do come back

return ret;

Please try and help me with this problem...

Thanks and regards,