×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    May 2004
    Posts
    8

    IAP creation on N6630

    Hello,

    I'm trying to create an IAP by using the code below.
    But i don't succeed to set the proxy adress and its port.
    it always remains to "None" for proxy adress and 0 for the port even if i set this line :
    view6->WriteUintL(TPtrC(WAP_PROXY_PORT), 8080);
    in the code below.

    What is the solution ? Can you help me ?



    void myclass::CreateIAP(){

    CCommsDbTableView* view;

    TInt error;
    TUint32 gprsId;
    TInt nId=0;
    TCommDbOpeningMethod method;

    CCommsDatabase* cdb=CCommsDatabase::NewL(EDatabaseTypeIAP,method);
    CleanupStack::PushL(cdb);

    //1)Add record to OUTGOING_GPRS
    view = cdb->OpenTableLC(TPtrC(OUTGOING_GPRS));
    view->InsertRecord(gprsId);
    view->WriteTextL(TPtrC(COMMDB_NAME), _L("websfr"));
    view->WriteBoolL(TPtrC(GPRS_IF_PROMPT_FOR_AUTH), ETrue);
    view->WriteBoolL(TPtrC(GPRS_IP_ADDR_FROM_SERVER), ETrue);
    view->WriteBoolL(TPtrC(GPRS_IP_DNS_ADDR_FROM_SERVER), ETrue);
    view->WriteTextL(TPtrC(GPRS_IP_GATEWAY), _L("0.0.0.0"));
    view->WriteTextL(TPtrC(GPRS_IF_AUTH_NAME), _L(""));
    view->WriteTextL(TPtrC(GPRS_IF_AUTH_PASS),_L(""));
    view->WriteTextL(TPtrC(GPRS_APN), _L("websfr"));
    view->WriteUintL(TPtrC(GPRS_PDP_TYPE), 0);
    view->WriteBoolL(TPtrC(GPRS_IF_PROMPT_FOR_AUTH), EFalse);
    view->WriteTextL(TPtrC(GPRS_IF_NETWORKS), _L("ip"));
    view->WriteBoolL(TPtrC(GPRS_HEADER_COMPRESSION), EFalse);
    view->WriteBoolL(TPtrC(GPRS_DATA_COMPRESSION), EFalse);
    view->WriteUintL(TPtrC(GPRS_REQ_PRECEDENCE), 0);
    view->WriteUintL(TPtrC(GPRS_REQ_DELAY), 0);
    view->WriteUintL(TPtrC(GPRS_REQ_RELIABILITY), 0);
    view->WriteUintL(TPtrC(GPRS_REQ_PEAK_THROUGHPUT), 0);
    view->WriteUintL(TPtrC(GPRS_REQ_MEAN_THROUGHPUT), 0);
    view->WriteUintL(TPtrC(GPRS_MIN_PRECEDENCE), 0);
    view->WriteUintL(TPtrC(GPRS_MIN_DELAY), 0);
    view->WriteUintL(TPtrC(GPRS_MIN_RELIABILITY), 0);
    view->WriteUintL(TPtrC(GPRS_MIN_PEAK_THROUGHPUT), 0);
    view->WriteUintL(TPtrC(GPRS_MIN_MEAN_THROUGHPUT), 0);
    view->WriteBoolL(TPtrC(GPRS_ANONYMOUS_ACCESS), EFalse);
    view->WriteBoolL(TPtrC(GPRS_USE_EDGE), EFalse);
    view->WriteBoolL(TPtrC(GPRS_ENABLE_LCP_EXTENSIONS), EFalse);
    view->WriteBoolL(TPtrC(GPRS_DISABLE_PLAIN_TEXT_AUTH), EFalse);

    view->WriteUintL(TPtrC(GPRS_AP_TYPE), 0);
    view->WriteUintL(TPtrC(GPRS_QOS_WARNING_TIMEOUT), -1);
    view->WriteUintL(TPtrC(GPRS_PDP_TYPE), 0);
    view->WriteTextL(TPtrC(GPRS_PDP_ADDRESS), _L(""));
    //view1->WriteTextL(TPtrC(GPRS_IF_NAME),_L("")); GPRS_IF_NAME has been
    suppressed in cdbcol.h although it is still in the sdk doc!
    view->WriteTextL(TPtrC(GPRS_IF_PARAMS), _L(""));
    view->WriteUintL(TPtrC(GPRS_IF_AUTH_RETRIES), 0);
    view->WriteTextL(TPtrC(GPRS_IP_NETMASK), _L(""));
    view->WriteTextL(TPtrC(GPRS_IP_ADDR),_L("0.0.0.0"));
    view->WriteTextL(TPtrC(GPRS_IP_NAME_SERVER1),_L("0.0.0.0"));
    view->WriteTextL(TPtrC(GPRS_IP_NAME_SERVER2),_L("0.0.0.0"));
    error = view->PutRecordChanges();

    CleanupStack::PopAndDestroy(view);
    CleanupStack::PopAndDestroy(cdb);

    //2)Add record to NETWORK
    TUint32 networkId;
    CCommsDatabase* cdb2=CCommsDatabase::NewL(EDatabaseTypeIAP);
    CleanupStack::PushL(cdb2);
    CCommsDbTableView* view2 = cdb2->OpenTableLC(TPtrC(NETWORK));
    view2->InsertRecord(networkId);
    view2->WriteTextL(TPtrC(COMMDB_NAME), _L("websfr"));
    error = view2->PutRecordChanges(EFalse, EFalse);
    CleanupStack::PopAndDestroy(view2);
    CleanupStack::PopAndDestroy(cdb2);

    //3)SEARCH FOR Mobile LOCATION id
    TInt result;
    TUint32 locationId;
    TUint32 mobileLocationId;
    // Open Database
    CCommsDatabase* cdb3 = CCommsDatabase::NewL(EDatabaseTypeIAP);
    CleanupStack::PushL(cdb3);
    CCommsDbTableView* view3 = cdb3->OpenTableLC(TPtrC(LOCATION));
    // Walk through records
    result = view3->GotoFirstRecord();
    TBuf<128> locationName;
    while (result == KErrNone)
    {

    view3->ReadTextL(TPtrC(COMMDB_NAME), locationName);
    view3->ReadUintL(TPtrC(LOCATION_MOBILE), locationId);
    if (locationName.Match(_L("Mobile"))!= KErrNotFound)
    mobileLocationId = locationId;
    result = view3->GotoNextRecord();

    }
    CleanupStack::PopAndDestroy(view3);
    CleanupStack::PopAndDestroy(cdb3);

    //4)Create IAP
    TUint32 iapId;
    CCommsDatabase* cdb4=CCommsDatabase::NewL(EDatabaseTypeIAP);
    CleanupStack::PushL(cdb4);
    CCommsDbTableView* view4;
    view4 = cdb4->OpenTableLC(TPtrC(IAP));
    error = view4->InsertRecord(iapId);
    view4->WriteTextL(TPtrC(COMMDB_NAME), _L("websfr"));
    view4->WriteTextL(TPtrC(IAP_SERVICE_TYPE), TPtrC(OUTGOING_GPRS));
    view4->WriteUintL(TPtrC(IAP_SERVICE), gprsId);
    view4->WriteUintL(TPtrC(IAP_NETWORK_WEIGHTING), 0);
    view4->WriteUintL(TPtrC(IAP_NETWORK), networkId);
    view4->WriteUintL(TPtrC(IAP_BEARER), 2);
    view4->WriteTextL(TPtrC(IAP_BEARER_TYPE), TPtrC(MODEM_BEARER));
    view4->WriteUintL(TPtrC(IAP_LOCATION), mobileLocationId);
    //view4->WriteUintL(TPtrC(IAP_DIALOG_PREF), iapId); makes the app crash
    error = view4->PutRecordChanges(EFalse, EFalse);

    CleanupStack::PopAndDestroy(view4);
    CleanupStack::PopAndDestroy(cdb4);

    //5) CREATE WAP_ACCESS_POINT
    CCommsDatabase* cdb5=CCommsDatabase::NewL(EDatabaseTypeIAP);
    CleanupStack::PushL(cdb5);

    TUint32 wapId;
    CCommsDbTableView* view5 = cdb5->OpenTableLC(TPtrC(WAP_ACCESS_POINT));
    error = view5->InsertRecord(wapId);
    view5->WriteTextL(TPtrC(COMMDB_NAME), _L("websfr"));
    view5->WriteTextL(TPtrC(WAP_CURRENT_BEARER), TPtrC(WAP_IP_BEARER));
    view5->WriteTextL(TPtrC(WAP_START_PAGE), _L("http://wap.sfr.fr"));
    error = view5->PutRecordChanges(EFalse, EFalse);

    CleanupStack::PopAndDestroy(view5);
    CleanupStack::PopAndDestroy(cdb5);

    //6) Create WAP_IP_BEARER
    TUint32 wapIPId;
    CCommsDatabase* cdb6=CCommsDatabase::NewL(EDatabaseTypeIAP);
    CleanupStack::PushL(cdb6);
    CCommsDbTableView* view6 = cdb6->OpenTableLC(TPtrC(WAP_IP_BEARER));
    error = view6->InsertRecord(wapIPId);
    // Has no name view6->WriteTextL(TPtrC(COMMDB_NAME), _L("websfr"));
    view6->WriteUintL(TPtrC(WAP_ACCESS_POINT_ID), wapId);
    view6->WriteTextL(TPtrC(WAP_GATEWAY_ADDRESS), _L("0.0.0.0"));
    view6->WriteUintL(TPtrC(WAP_WSP_OPTION),EWapWspOptionConnectionOriented);
    view6->WriteBoolL(TPtrC(WAP_SECURITY), EFalse);
    view6->WriteUintL(TPtrC(WAP_IAP),iapId);
    view6->WriteUintL(TPtrC(WAP_PROXY_PORT), 8080);
    view6->WriteTextL(TPtrC(WAP_PROXY_LOGIN_NAME), _L(""));
    view6->WriteTextL(TPtrC(WAP_PROXY_LOGIN_PASS), _L(""));
    error = view6->PutRecordChanges(EFalse, EFalse);
    CleanupStack::PopAndDestroy(view6);
    CleanupStack::PopAndDestroy(cdb6);


    }

  2. #2
    Regular Contributor
    Join Date
    Jan 2004
    Posts
    128

    Re: IAP creation on N6630

    Hi,

    I am experimenting the same problem. Did you find out what was wrong in your code? Do I have to define an entry in the PROXIES table?

    Thanks,

    Fernando

  3. #3
    Registered User
    Join Date
    Dec 2004
    Posts
    21

    Re: IAP creation on N6630

    Hi,
    Try creating a record in the PROXIES table.

    // Initialise a PROXY Table View.
    CCommsDbTableView* proxyTable = iCommDb->OpenTableLC(TPtrC(PROXIES));
    User::LeaveIfError( proxyTable->InsertRecord(iProxyId) );

    // Id of record created in the GPRS table.
    proxyTable->WriteUintL(TPtrC(PROXY_ISP),iGprsId);
    proxyTable->WriteTextL(TPtrC(PROXY_SERVICE_TYPE), TPtrC(OUTGOING_GPRS));
    proxyTable->WriteBoolL(TPtrC(PROXY_USE_PROXY_SERVER), ETrue);

    // Ip address of the proxy server.
    proxyTable->WriteLongTextL(TPtrC(PROXY_SERVER_NAME), _L("10.10.1.100"));
    proxyTable->WriteTextL(TPtrC(PROXY_PROTOCOL_NAME), _L("http"));

    // proxy port number.
    proxyTable->WriteUintL(TPtrC(PROXY_PORT_NUMBER),9401);
    err = proxyTable->PutRecordChanges(ETrue,EFalse);

    // cleanup the allocated resources.
    CleanupStack::PopAndDestroy(proxyTable);

    This should create the required settings for the created Iap.

    Shashi.

  4. #4
    Registered User
    Join Date
    Jul 2003
    Location
    Australia
    Posts
    38

    Re: IAP creation on N6630

    I have similar code working on pre-Symbian 9 phones but on a (Symbian 9) N73 I can create a working access point but the proxy address/port is never set.

    Does anyone have any ideas? Or even the same problem?

  5. #5
    Regular Contributor
    Join Date
    May 2006
    Posts
    79

    Re: IAP creation on N6630

    Hi to all!

    I created the IAP successfully for N6600.I m accessing the remote server through WAP gateway. If i gave the request to my remote server, the request is reaced the server. Bt in that time, the client is getting the error like "Bad gateway or gateway timed out or internal server error.Maxium of time, i m getting "internal server error".

    I m facing this problem on N6600 only. I gave the request from the N6630, its working properly.No problem with that.

    I m creating the IAP like that.

    i)Creating OUTGOING_GPRS id,
    ii)Network Id,
    iii)Location Id,
    iv)IAP,
    v)WAP_ACCESS_POINT id,
    vi)WAP_IP_BEARER id,
    vii)PROXIES id.

    And one more thing, i m deleting the previous APNs(created by me) when my app is accessed first time.

    Is there any problem on deleting n creating the IAPs?
    Coz, i got the data from the server on 3-4 times of my internal testing tries.
    After that i did many internal testings.So, Every time my app is deleting the previous APN n create the new APN.

    Thanx in Advance........

    Do u want to see my code?

    by,
    Karthikeyan

  6. #6
    Registered User
    Join Date
    Sep 2006
    Posts
    37

    Re: IAP creation on N6630

    I want to look you code.
    I want to do a app to setting a access,then connect gprs.

    can you send me .
    my e-mail is pwq1996@163.com

  7. #7
    Registered User
    Join Date
    Jan 2008
    Posts
    17

    Re: IAP creation on N6630

    Hi,

    I am currenly creating a new internet access point. As you successfully created an IAP, can you post your code here? I would like to have a look on your code.

    Million thanks in advance.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×