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.
// 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);
task.SetWgId(CEikonEnv::Static()->RootWin().Identifier())
task.BringToForeground();
User::LeaveIfError(server.UnloadPhoneModule(KTsyName));
}
else
ret = ETrue; //not finish, do come back
Maybe you should the call handling into its own class. And make it as an active object. Then you could get the changes is call status by using the NotifyStatusChange()-function of the RCall class.
this error message usually means that you have either static or global data (except for _LIT()s ) in your app. This however is only allowed on the WINS platform.
If you need to have static or global data you should have a look at http://www.peroon.co.il/epocstat.html
Hope this helps.
Cheers,
Pawel
Thanks, it compiles, but another problem
2004-03-15, 17:51#4
But, now I have a problem of a more serious nature..
In my app, I want to dial and then once the call is established, I want to bring my app in the foreground and perform some functions like sending DTMF tones over the established connection. However, the code that I referred to earlier doesn't seem to be doing that. I modified the function DoCallNumber to look like this -
if (iCallStatus == RCall::EStatusConnected)
{
ret = EFalse;
//bring app to foreground
TApaTask task(CCoeEnv::Static()->WsSession());
task.SetWgId(CEikonEnv::Static()->RootWin().Identifier())
task.BringToForeground();
User::LeaveIfError(server.UnloadPhoneModule(KTsyName));
}
else
ret = ETrue; //not finish, do come back
return ret;
}
But once the call is established, my app simply closes.
Is there any other way I can achieve my goal?
as i don't have experience with user interface programming i cannot tell for sure you why your app closes. However there is something in your code which i find quite striking: User::LeaveIfError(server.UnloadPhoneModule(KTsyName));
Why are you trying to unload a TSY during an active call ? This call is doomed to fail IMHO. This in turn would lead to a leave from the method you pasted.
And perhaps this is also the reason for your app's exit.
Cheers,
Pawel
Problem in compiling telephony application on ARMIB platform
2004-03-16, 08:48#6
This is the same problem I seem to be having. Once you get a call you application stays in the background and I have not found a way to bring it back to foreground yet. Although I can do that for voice calls (by calling NotifyIncomgCall() method of my RLine object inside an Active object, when you manually accept the call my application shows up again....) I cannot seem to do that for data calls. If you find anything out please let me know.