Following code will loop through all SIP profiles and check if profile is registered. If not registered, it will print last error code:
Code:
RPointerArray< CSIPProfile > aProfiles;
TUid uid = TUid::Uid(1010101);
CSIP *iSIP = CSIP::NewLC( uid, *this );
CSIPProfileRegistry* iProfileRegistry = CSIPProfileRegistry::NewLC( *iSIP, *this );
iProfileRegistry->ProfilesL(aProfiles);
for(TInt i = 0 ; i < aProfiles.Count(); i++)
{
CSIPProfile *prof = (CSIPProfile *)aProfiles[i];
TBool registered( EFalse );
prof->GetParameter(KSIPProfileRegistered, registered);
if(registered)
{
CEikonEnv::InfoWinL(_L("REGISTERED"),_L(" "));
}
else
{
TInt err = iProfileRegistry->LastRegistrationError(*prof);
//Last registration error
TBuf<10> errr;
errr.AppendNum(err);
CEikonEnv::InfoWinL(errr,_L("Err"));
}
}
CleanupStack::PopAndDestroy(2); //iSIP,iProfileRegistry