Ignore:
Timestamp:
Dec 17, 2008 11:36:22 AM (15 years ago)
Author:
nanang
Message:

Ticket #675:

  • Fixed ICE+STUN panic E32User-CBASE 46, the problem seems to be inside the Symbian version of pjsua_handle_events().
  • Updated minor things, e.g: compile warnings
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip-apps/src/symbian_ua/ua.cpp

    r2174 r2379  
    3838// Account 
    3939// 
    40 #define HAS_SIP_ACCOUNT 1       // 0 to disable registration 
     40#define HAS_SIP_ACCOUNT 0       // 1 to enable registration 
    4141#define SIP_DOMAIN      "pjsip.lab" 
    4242#define SIP_USER        "400" 
     
    5454// or STUN (for STUN see other settings below) 
    5555// 
    56 //#define NAMESERVER    NULL 
    57 #define NAMESERVER      "192.168.0.2" 
     56#define NAMESERVER      NULL 
     57//#define NAMESERVER    "192.168.0.2" 
    5858 
    5959// 
     
    250250 
    251251 
     252//#include<e32debug.h> 
     253 
    252254/* Logging callback */ 
    253255static void log_writer(int level, const char *buf, int len) 
     
    260262 
    261263    TPtrC16 aBuf((const TUint16*)buf16, (TInt)len); 
     264    //RDebug::Print(aBuf); 
    262265    console->Write(aBuf); 
    263266     
     
    436439{ 
    437440public: 
    438     ConsoleUI(CActiveSchedulerWait *asw, CConsoleBase *con); 
     441    ConsoleUI(CConsoleBase *con); 
    439442 
    440443    // Run console UI 
     
    452455     
    453456private: 
    454     CActiveSchedulerWait *asw_; 
    455457    CConsoleBase *con_; 
    456458}; 
    457459 
    458460 
    459 ConsoleUI::ConsoleUI(CActiveSchedulerWait *asw, CConsoleBase *con)  
    460 : CActive(EPriorityStandard), asw_(asw), con_(con) 
     461ConsoleUI::ConsoleUI(CConsoleBase *con)  
     462: CActive(EPriorityStandard), con_(con) 
    461463{ 
    462464    CActiveScheduler::Add(this); 
     
    509511    switch (kc) { 
    510512    case 'w': 
    511             asw_->AsyncStop(); 
     513            CActiveScheduler::Stop(); 
    512514            reschedule = PJ_FALSE; 
    513515            break; 
     
    686688#include <es_sock.h> 
    687689 
     690#if 0 
     691// Force network connection to use the first IAP,  
     692// this is useful for debugging on emulator without GUI.  
     693// Include commdb.lib & apengine.lib in symbian_ua.mmp file 
     694// if this is enabled. 
     695 
     696#include <apdatahandler.h> 
     697 
     698inline void ForceUseFirstIAP()  
     699{ 
     700    TUint32 rank = 1; 
     701    TUint32 bearers; 
     702    TUint32 prompt; 
     703    TUint32 iap; 
     704 
     705    CCommsDatabase* commDb = CCommsDatabase::NewL(EDatabaseTypeIAP); 
     706    CleanupStack::PushL(commDb); 
     707 
     708    CApDataHandler* apDataHandler = CApDataHandler::NewLC(*commDb); 
     709     
     710    TCommDbConnectionDirection direction = ECommDbConnectionDirectionOutgoing; 
     711    apDataHandler->GetPreferredIfDbIapTypeL(rank, direction, bearers, prompt, iap); 
     712    prompt = ECommDbDialogPrefDoNotPrompt; 
     713    apDataHandler->SetPreferredIfDbIapTypeL(rank, direction, bearers, (TCommDbDialogPref)prompt, iap, ETrue); 
     714    CleanupStack::PopAndDestroy(2); // apDataHandler, commDb 
     715} 
     716 
     717static void SelectIAP()  
     718{ 
     719    ForceUseFirstIAP(); 
     720} 
     721 
     722#else 
     723 
     724static void SelectIAP()  
     725{ 
     726} 
     727 
     728#endif 
     729 
     730 
    688731//////////////////////////////////////////////////////////////////////////// 
    689732int ua_main()  
    690733{ 
    691         RSocketServ aSocketServer; 
    692         RConnection aConn; 
    693         TInt err; 
    694         pj_symbianos_params sym_params; 
     734    RSocketServ aSocketServer; 
     735    RConnection aConn; 
     736    TInt err; 
     737    pj_symbianos_params sym_params; 
    695738    pj_status_t status; 
     739 
     740    SelectIAP(); 
    696741     
    697742    // Initialize RSocketServ 
     
    701746    // Open up a connection 
    702747    if ((err=aConn.Open(aSocketServer)) != KErrNone) { 
    703             aSocketServer.Close(); 
    704                 return PJ_STATUS_FROM_OS(err); 
     748        aSocketServer.Close(); 
     749        return PJ_STATUS_FROM_OS(err); 
    705750    } 
    706751     
     
    723768        aConn.Close(); 
    724769        aSocketServer.Close(); 
    725             return status; 
     770        return status; 
    726771    } 
    727772 
    728773    // Run the UI 
    729     CActiveSchedulerWait *asw = new CActiveSchedulerWait; 
    730     ConsoleUI *con = new ConsoleUI(asw, console); 
     774    ConsoleUI *con = new ConsoleUI(console); 
    731775     
    732776    con->Run(); 
    733      
    734777    PrintMenu(); 
    735     asw->Start(); 
     778 
     779    CActiveScheduler::Start(); 
    736780     
    737781    delete con; 
    738     delete asw; 
    739782 
    740783    // Dump memory statistics 
    741784    PJ_LOG(3,(THIS_FILE, "Max heap usage: %u.%03uMB", 
    742                   pjsua_var.cp.peak_used_size / 1000000, 
    743                   (pjsua_var.cp.peak_used_size % 1000000)/1000)); 
     785              pjsua_var.cp.peak_used_size / 1000000, 
     786              (pjsua_var.cp.peak_used_size % 1000000)/1000)); 
    744787     
    745788    // check max stack usage 
     
    747790        pj_thread_t* this_thread = pj_thread_this(); 
    748791        if (!this_thread) 
    749                 return status; 
     792            return status; 
    750793         
    751794        const char* max_stack_file; 
     
    754797         
    755798        PJ_LOG(3,(THIS_FILE, "Max stack usage: %u at %s:%d",  
    756                         pj_thread_get_stack_max_usage(this_thread),  
    757                         max_stack_file, max_stack_line)); 
     799                  pj_thread_get_stack_max_usage(this_thread),  
     800                  max_stack_file, max_stack_line)); 
    758801#endif 
    759802         
     
    763806    // Close connection and socket server 
    764807    aConn.Close(); 
    765         aSocketServer.Close(); 
     808    aSocketServer.Close(); 
    766809         
    767810    return status; 
Note: See TracChangeset for help on using the changeset viewer.