I use the RGenericAgent to do an internet dial in,
using an specific access point.
I don't want that the user gets a dialog box, where he must choose a connection.
Therefore I read some setting from the Comm DB, define some Overwrites and use
void StartOutgoing(CStoreableOverrideSettings& aOverrides, TRequestStatus& aStatus);
to dial my connection.
Here is some code i use:
// set the connection i want:
result = m_overrides->SetDesOverride ( TPtrC ( IAP ), TPtrC ( IAP_SERVICE_TYPE ), TPtrC ( OUTGOING_GPRS ) );
result = m_overrides->SetIntOverride ( TPtrC ( IAP ), TPtrC ( IAP_SERVICE ), isp );
result = m_overrides->SetIntOverride( TPtrC( IAP ), TPtrC ( COMMDB_ID ), isp );
result = m_overrides->SetIntOverride( TPtrC( OUTGOING_GPRS ), TPtrC ( COMMDB_ID ), isp );
// disable the dialog box in the preferences table:
CCommsDbConnectionPrefTableView* tv_prefs = m_cdb->OpenConnectionPrefTableLC(ECommDbConnectionDirectionOutgoing);
if ( tv_prefs != NULL )
TInt resolveResult = KErrNone;
resolveResult = tv_prefs->GotoFirstRecord();
while ( resolveResult == KErrNone )
aPref.iDirection = ECommDbConnectionDirectionOutgoing;
aPref.iDialogPref = ECommDbDialogPrefDoNotPrompt;
result = m_overrides->SetConnectionPreferenceOverride(aPref);
resolveResult = tv_prefs->GotoNextRecord();
// Open my RGenericAgent which is named m_iNetAgent:
TInt nifManResult = m_iNetAgent.Open();
// Dial the connection and wait until my ::RunL Method gets called:
m_iNetAgent.StartOutgoing(*m_overrides, this->iStatus );
Everything works fine with one exception:
On phones that never did an internet dial in using the connections box ( or if hard resetted by typing #*7370# )
my ::RunL Method never gets called and the phone does not dial in.
If i use
TInt StartOutgoing(CStoreableOverrideSettings& aOverrides);
the result is KErrNone, but nothing happens. The phone does not dial in.
If i once open a socket the connections box pops up and i can choose a connection.
If i choose one, the phone does an successful internet dial in using this connection.
From now on everything works fine. Every call to StartOutgoing() makes the phone dial the connection that i want.
My Question is: is there any initalization stuff that i must do to RGenericAgent before using it the first time?
Is There Something else i forgot to do?