DialNewCall CTelephony example?
Does anyone have a good resource for an example of dialing a call on an S60. I am hoping for an example that I can import, compile, and run in Carbide.c++ 1.3.
I have found several DialNewCall examples, and I can get most of them to compile, but when the dial code runs the app just crashes on my N95. I'm new to the entire Symbian development, so I'm for sure just doing things wrong.
Importing a working example to examine seems to be the easiest way of learning!
Thanks.
Re: DialNewCall CTelephony example?
I am not sure if complete examples exist for that (S60 2nd edition SDK-s contain S[eries]60Ex\dialer as I remember, but it is not present in 3rd edition SDK-s). The example in the SDK Help seems to be almost OK, if you complete the active object implementation (for example CActiveScheduler::Add seems to be missing), it should be fine.
And if you experience crashes, you can reveal the panic code following this link: [url]http://wiki.forum.nokia.com/index.php/Extended_panic_code[/url]
Re: DialNewCall CTelephony example?
Thanks for the tip on the CActiveScheduler. I added some lines for that and now my app doesn't crash. The phone does dial either, but it's a start. I'll paste my mostly stolen and pieced together calling class and maybe you can see what I am doing wrong.
If it's not my calling code, then it is probably how I am using the ActiveScheduler.
Here is my calling code:
[code]
CClientApp* c = new CClientApp(CTelephony::NewL());
c->Dial();
[/code]
CClientApp.h:
[code]
#ifndef CCLIENTAPP_H_
#define CCLIENTAPP_H_
#include <e32base.h>
#include <Etel3rdParty.h>
class CClientApp : public CActive
{
private:
CTelephony* iTelephony;
CTelephony::TCallId iCallId;
public:
CClientApp(CTelephony* aTelephony);
void Dial();
private:
void RunL();
void DoCancel();
};
#endif /*CCLIENTAPP_H_*/
[/code]
And finally CClientApp.cpp:
[code]
#include <e32base.h>
#include <Etel3rdParty.h>
#include <CClientApp.h>
_LIT(KTheNumber, "6157209901"); /AT&T voicemail
CClientApp::CClientApp(CTelephony* aTelephony)
: CActive(EPriorityStandard),
iTelephony(aTelephony)
{
//default constructor
}
void CClientApp::Dial()
{
CTelephony::TTelNumber telNumber(KTheNumber);
CTelephony::TCallParamsV1 callParams;
callParams.iIdRestrict = CTelephony::ESendMyId;
CTelephony::TCallParamsV1Pckg callParamsPckg(callParams);
CActiveScheduler::Start();
CActiveScheduler::Add(this);
iTelephony->DialNewCall(iStatus, callParamsPckg, telNumber, iCallId);
SetActive();
}
void CClientApp::RunL()
{
if(iStatus==KErrNone)
{}
}
void CClientApp::DoCancel()
{
iTelephony->CancelAsync(CTelephony::EDialNewCallCancel);
}
[/code]
Re: DialNewCall CTelephony example?
CActiveScheduler::Start is a tricky metod: it starts the active scheduler's dispatcher loop, which is an endless one by default (it will return if someone invokes CActiveScheduler::Stop).
So if your code is a GUI-less one, you should move this line after the SetActive. If your code is inside a GUI application, you should simply forget this line (the scheduler loop is already running in case of GUI apps, in fact everything in a GUI app happens inside that loop).
And in general, variables participating in asynchronous service invocations (like DialNewCall in this case) should be member variables of the given class.
Re: DialNewCall CTelephony example?
I removed the Start like you sugguest since I didn't think it was needed either (GUI), but I was able to figure out what was missing.
I had to add NetworkServices to the .mmp and it works perfectly.
Re: DialNewCall CTelephony example?
I cant find the CActiveScheduler::Start in the HelloWorld example included in the S60 SDK 3er ed.
It is a GUI app
I have the same problem, I would like to make a call
Thanks!
Re: DialNewCall CTelephony example?
Hi,
In case you are having a GUI app you dont need to start Active scheduler.You can also check this example on making call
[url]http://wiki.forum.nokia.com/index.php/Make_call_with_CTelephony[/url]