Changeset 2379 for pjproject/trunk/pjsip-apps/src/symbian_ua/ua.cpp
- Timestamp:
- Dec 17, 2008 11:36:22 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/symbian_ua/ua.cpp
r2174 r2379 38 38 // Account 39 39 // 40 #define HAS_SIP_ACCOUNT 1 // 0 to disable registration40 #define HAS_SIP_ACCOUNT 0 // 1 to enable registration 41 41 #define SIP_DOMAIN "pjsip.lab" 42 42 #define SIP_USER "400" … … 54 54 // or STUN (for STUN see other settings below) 55 55 // 56 //#define NAMESERVER NULL57 #define NAMESERVER "192.168.0.2"56 #define NAMESERVER NULL 57 //#define NAMESERVER "192.168.0.2" 58 58 59 59 // … … 250 250 251 251 252 //#include<e32debug.h> 253 252 254 /* Logging callback */ 253 255 static void log_writer(int level, const char *buf, int len) … … 260 262 261 263 TPtrC16 aBuf((const TUint16*)buf16, (TInt)len); 264 //RDebug::Print(aBuf); 262 265 console->Write(aBuf); 263 266 … … 436 439 { 437 440 public: 438 ConsoleUI(C ActiveSchedulerWait *asw, CConsoleBase *con);441 ConsoleUI(CConsoleBase *con); 439 442 440 443 // Run console UI … … 452 455 453 456 private: 454 CActiveSchedulerWait *asw_;455 457 CConsoleBase *con_; 456 458 }; 457 459 458 460 459 ConsoleUI::ConsoleUI(C ActiveSchedulerWait *asw, CConsoleBase *con)460 : CActive(EPriorityStandard), asw_(asw),con_(con)461 ConsoleUI::ConsoleUI(CConsoleBase *con) 462 : CActive(EPriorityStandard), con_(con) 461 463 { 462 464 CActiveScheduler::Add(this); … … 509 511 switch (kc) { 510 512 case 'w': 511 asw_->AsyncStop();513 CActiveScheduler::Stop(); 512 514 reschedule = PJ_FALSE; 513 515 break; … … 686 688 #include <es_sock.h> 687 689 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 698 inline 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 717 static void SelectIAP() 718 { 719 ForceUseFirstIAP(); 720 } 721 722 #else 723 724 static void SelectIAP() 725 { 726 } 727 728 #endif 729 730 688 731 //////////////////////////////////////////////////////////////////////////// 689 732 int ua_main() 690 733 { 691 692 693 694 734 RSocketServ aSocketServer; 735 RConnection aConn; 736 TInt err; 737 pj_symbianos_params sym_params; 695 738 pj_status_t status; 739 740 SelectIAP(); 696 741 697 742 // Initialize RSocketServ … … 701 746 // Open up a connection 702 747 if ((err=aConn.Open(aSocketServer)) != KErrNone) { 703 704 748 aSocketServer.Close(); 749 return PJ_STATUS_FROM_OS(err); 705 750 } 706 751 … … 723 768 aConn.Close(); 724 769 aSocketServer.Close(); 725 770 return status; 726 771 } 727 772 728 773 // Run the UI 729 CActiveSchedulerWait *asw = new CActiveSchedulerWait; 730 ConsoleUI *con = new ConsoleUI(asw, console); 774 ConsoleUI *con = new ConsoleUI(console); 731 775 732 776 con->Run(); 733 734 777 PrintMenu(); 735 asw->Start(); 778 779 CActiveScheduler::Start(); 736 780 737 781 delete con; 738 delete asw;739 782 740 783 // Dump memory statistics 741 784 PJ_LOG(3,(THIS_FILE, "Max heap usage: %u.%03uMB", 742 743 785 pjsua_var.cp.peak_used_size / 1000000, 786 (pjsua_var.cp.peak_used_size % 1000000)/1000)); 744 787 745 788 // check max stack usage … … 747 790 pj_thread_t* this_thread = pj_thread_this(); 748 791 if (!this_thread) 749 792 return status; 750 793 751 794 const char* max_stack_file; … … 754 797 755 798 PJ_LOG(3,(THIS_FILE, "Max stack usage: %u at %s:%d", 756 757 799 pj_thread_get_stack_max_usage(this_thread), 800 max_stack_file, max_stack_line)); 758 801 #endif 759 802 … … 763 806 // Close connection and socket server 764 807 aConn.Close(); 765 808 aSocketServer.Close(); 766 809 767 810 return status;
Note: See TracChangeset
for help on using the changeset viewer.