示例#1
0
TInt CPhoneCall::Dial(const TDesC& aNumber)
{
	TInt result = EFalse;
#if (__S60_VERSION__ >= __S60_V2_FP3_VERSION_NUMBER__) || (__UIQ_VERSION_NUMBER__ >= __UIQ_V3_FP0_VERSION_NUMBER__)
	CTelephony::TTelNumber telNumber(aNumber);
 
	CTelephony::TCallParamsV1 callParams;
	callParams.iIdRestrict = CTelephony::ESendMyId;
	CTelephony::TCallParamsV1Pckg callParamsPckg(callParams);
 
	if (iTelephony)
	{
		iTelephony->DialNewCall(iStatus, callParamsPckg, telNumber, iCallId);
		SetActive();
		result = ETrue;
	}
#else
	if (iCall.OpenNewCall(iLine) == KErrNone)
	{
		if (iCall.Dial(aNumber) == KErrNone)
		{
			result = ETrue;
		}
	}
#endif
	return result;
}
/*
 * 拨打电话
 * */
void CMyTelephony::DialNewCall(const TDesC& aTelNumber)
	{
	CTelephony::TTelNumber telNumber(aTelNumber);
	CTelephony::TCallParamsV1 callParams;
	callParams.iIdRestrict = CTelephony::ESendMyId;
	CTelephony::TCallParamsV1Pckg callParamsPckg(callParams);
	iTelephony->DialNewCall(iStatus, callParamsPckg, telNumber, iCallId);
	SetActive();
	}
enum TVerdict CTestDialCallControlCorrectSIDCorrectCap::doTestStepL()
/**
@SYMTestCaseID TEL-ETEL-NA-2038
@SYMComponent  telephony_etel
@SYMTestCaseDesc To check client has the required SID and Capability to successfully call the RMobileCall::DialCallControl API.
@SYMTestPriority High
@SYMTestActions  Call the RMobileCall::DialCallControl API with required SID and required Capability and check the return value of the API
@SYMTestExpectedResults KErrNone when SID and capabilities are both correct.
@SYMTestType CT
*/
{
    TInt iTestCount = 1;

    RMobilePhone mmPhone;
    TInt ret=mmPhone.Open(iTelServer,DMMTSY_PHONE_NAME);
    TEST(ret==KErrNone);

    RMobileLine mmLine;
    ret=mmLine.Open(mmPhone,DMMTSY_LINE_VOICE_NAME);
    TEST(ret==KErrNone);

    RMobileCall mmCall;
    TName callName;
    ret=mmCall.OpenNewCall(mmLine,callName);
    TEST(ret==KErrNone);

    RMobileCall::TMobileCallParamsV7 mmCallParamsV7;
    TEST(mmCallParamsV7.ExtensionId() == RMobileCall::KETelMobileCallParamsV7);

    mmCallParamsV7.iInterval = DMMTSY_CALL_INTERVAL;
    mmCallParamsV7.iIdRestrict = DMMTSY_CALL_CLI_RESTRICT_SETTING1;
    mmCallParamsV7.iCug.iExplicitInvoke = DMMTSY_CALL_CUG_INVOKE;
    mmCallParamsV7.iCug.iCugIndex = DMMTSY_CALL_CUG_INDEX;
    mmCallParamsV7.iCug.iSuppressOA = DMMTSY_CALL_CUG_OA;
    mmCallParamsV7.iCug.iSuppressPrefCug = DMMTSY_CALL_CUG_PREF;
    mmCallParamsV7.iAutoRedial = DMMTSY_CALL_AUTO_REDIAL_FLAG;
    mmCallParamsV7.iBearerMode = DMMTSY_CALL_NEW_BEARER;
    mmCallParamsV7.iCallParamOrigin = DMMTSY_CALL_PARAM_ORIGIN;
    mmCallParamsV7.iSubAddress = DMMTSY_CALL_SUBADDRESS;
    mmCallParamsV7.iBearerCap1 = DMMTSY_CALL_BEARER_CAP1;
    mmCallParamsV7.iBearerCap2 = DMMTSY_CALL_BEARER_CAP2;
    mmCallParamsV7.iBCRepeatIndicator = DMMTSY_CALL_BC_REPEAT_INDICATOR;
    mmCallParamsV7.iIconId.iQualifier = DMMTSY_CALL_ICON_ID_QUALIFIER;
    mmCallParamsV7.iIconId.iIdentifier = DMMTSY_CALL_ICON_ID_IDENTIFIER;
    mmCallParamsV7.iAlphaId = DMMTSY_CALL_ALPHA_ID;

    RMobileCall::TMobileCallParamsV7Pckg mmCallParamsV7Pckg(mmCallParamsV7);

    TBuf<RMobilePhone::KMaxMobileTelNumberSize> telNumber(DMMTSY_PHONE_TEL_NUMBER);

    TRequestStatus reqStatus;
    mmCall.DialCallControl(reqStatus, mmCallParamsV7Pckg, telNumber);
    User::WaitForRequest(reqStatus);

    TEST(reqStatus.Int()==KErrNone);
    INFO_PRINTF2(_L("Test %d - RMobileCall::DialCallControl correct SID correct caps passed"), iTestCount++);

    mmCall.Close();
    mmLine.Close();
    mmPhone.Close();

    return TestStepResult();
}