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();
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_*/
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);
}