Changeset 1248
- Timestamp:
- May 3, 2007 7:56:21 PM (18 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/build.symbian/pjmedia.mmp
r1242 r1248 47 47 SOURCE splitcomb.c 48 48 SOURCE stream.c 49 SOURCE tonegen.c 49 50 SOURCE transport_ice.c 50 51 SOURCE transport_udp.c -
pjproject/trunk/build.symbian/pjproject.cww
r1246 r1248 272 272 </FRAMELOC> 273 273 <FRAMESIZE> 274 <W>6 05</W>275 <H> 778</H>274 <W>629</W> 275 <H>859</H> 276 276 </FRAMESIZE> 277 277 <DOCKINFO> … … 297 297 </FRAMELOC> 298 298 <FRAMESIZE> 299 <W> 470</W>300 <H> 705</H>299 <W>534</W> 300 <H>921</H> 301 301 </FRAMESIZE> 302 302 <DOCKINFO> … … 322 322 </FRAMELOC> 323 323 <FRAMESIZE> 324 <W> 904</W>325 <H> 1791</H>324 <W>1008</W> 325 <H>2142</H> 326 326 </FRAMESIZE> 327 327 <DOCKINFO> … … 341 341 <SESSION>-2147483648</SESSION> 342 342 <EDOCTYPE>23</EDOCTYPE> 343 <MAXIMIZED>true</MAXIMIZED>344 343 <FRAMELOC> 345 344 <X>6</X> -
pjproject/trunk/pjlib/src/pj/ioqueue_symbian.cpp
r1246 r1248 649 649 pj_uint32_t flags ) 650 650 { 651 // If socket has reader, delete it. 652 if (key->cbObj->get_pj_socket()->Reader()) 653 key->cbObj->get_pj_socket()->DestroyReader(); 654 651 655 // Clear flag 652 656 flags &= ~PJ_IOQUEUE_ALWAYS_ASYNC; … … 668 672 int *addrlen) 669 673 { 674 // If socket has reader, delete it. 675 if (key->cbObj->get_pj_socket()->Reader()) 676 key->cbObj->get_pj_socket()->DestroyReader(); 677 670 678 if (key->cbObj->IsActive()) 671 679 return PJ_EBUSY; -
pjproject/trunk/pjlib/src/pj/os_core_symbian.cpp
r1246 r1248 422 422 { 423 423 User::After(msec*1000); 424 425 TInt aError; 426 while (CActiveScheduler::RunIfReady(aError, EPriorityMuchLess)) 427 ; 428 424 429 return PJ_SUCCESS; 425 430 } -
pjproject/trunk/pjlib/src/pj/os_symbian.h
r1246 r1248 87 87 CPjSocketReader *CreateReader(unsigned max_len=CPjSocket::MAX_LEN); 88 88 89 // Delete socket reader when it's not wanted. 90 void DestroyReader(); 91 89 92 private: 90 93 RSocket sock_; // Must not be reference, or otherwise … … 188 191 public: 189 192 // 190 // Construct PjSymbianOS instance.191 //192 static PjSymbianOS *NewL();193 194 //195 193 // Get the singleton instance of PjSymbianOS 196 194 // -
pjproject/trunk/pjlib/src/pj/sock_symbian.cpp
r1246 r1248 67 67 CPjSocket::~CPjSocket() 68 68 { 69 DestroyReader(); 70 sock_.Close(); 71 } 72 73 74 // Create socket reader. 75 CPjSocketReader *CPjSocket::CreateReader(unsigned max_len) 76 { 77 pj_assert(sockReader_ == NULL); 78 return sockReader_ = CPjSocketReader::NewL(*this, max_len); 79 } 80 81 // Delete socket reader when it's not wanted. 82 void CPjSocket::DestroyReader() 83 { 69 84 if (sockReader_) { 70 85 if (sockReader_->IsActive()) … … 73 88 sockReader_ = NULL; 74 89 } 75 sock_.Close();76 }77 78 79 // Create socket reader.80 CPjSocketReader *CPjSocket::CreateReader(unsigned max_len)81 {82 pj_assert(sockReader_ == NULL);83 return sockReader_ = CPjSocketReader::NewL(*this, max_len);84 90 } 85 91 … … 164 170 void (*old_cb)(void *key) = readCb_; 165 171 void *old_key = key_; 166 bool is_active = IsActive();167 172 168 173 readCb_ = NULL; -
pjproject/trunk/pjlib/src/pj/timer_symbian.cpp
r1246 r1248 89 89 CActiveScheduler::Add(this); 90 90 91 rtimer_.After(iStatus, PJ_TIME_VAL_MSEC(*delay) * 1000); 91 pj_int32_t interval = PJ_TIME_VAL_MSEC(*delay) * 1000; 92 if (interval < 0) { 93 interval = 0; 94 } 95 rtimer_.After(iStatus, interval); 92 96 SetActive(); 93 97 } -
pjproject/trunk/pjmedia/src/pjmedia/transport_udp.c
r1098 r1248 231 231 232 232 /* Create transport structure */ 233 pool = pjmedia_endpt_create_pool(endpt, name, 4000, 4000);233 pool = pjmedia_endpt_create_pool(endpt, name, 512, 512); 234 234 if (!pool) 235 235 return PJ_ENOMEM; -
pjproject/trunk/pjnath/src/pjnath/ice_strans.c
r1210 r1248 97 97 name = "icstr%p"; 98 98 99 pool = pj_pool_create(stun_cfg->pf, name, 4000, 4000, NULL);99 pool = pj_pool_create(stun_cfg->pf, name, 1000, 512, NULL); 100 100 ice_st = PJ_POOL_ZALLOC_T(pool, pj_ice_strans); 101 101 ice_st->pool = pool; -
pjproject/trunk/pjsip-apps/src/symbian_ua/main_symbian.cpp
r1244 r1248 25 25 // Global Variables 26 26 CConsoleBase* console; 27 static CActiveSchedulerWait *asw;28 27 29 28 30 // Local Functions 31 32 LOCAL_C void MainL() 33 { 34 // 35 // add your program code here, example code below 36 // 37 int rc = ua_main(); 38 39 asw->AsyncStop(); 40 } 41 42 class MyScheduler : public CActiveScheduler 43 { 44 public: 45 MyScheduler() 46 {} 47 48 void Error(TInt aError) const; 49 }; 50 51 void MyScheduler::Error(TInt aError) const 52 { 53 PJ_UNUSED_ARG(aError); 54 } 55 29 ///////////////////////////////////// 56 30 class MyTask : public CActive 57 31 { 58 32 public: 59 static MyTask *NewL(); 33 static MyTask *NewL(CActiveSchedulerWait *asw); 34 ~MyTask(); 60 35 void Start(); 61 36 62 37 protected: 63 MyTask( );38 MyTask(CActiveSchedulerWait *asw); 64 39 void ConstructL(); 65 40 virtual void RunL(); 66 41 virtual void DoCancel(); 67 TInt RunError(TInt aError);68 42 69 43 private: 70 44 RTimer timer_; 45 CActiveSchedulerWait *asw_; 71 46 }; 72 47 73 MyTask::MyTask( )74 : CActive(EPriorityNormal) 48 MyTask::MyTask(CActiveSchedulerWait *asw) 49 : CActive(EPriorityNormal), asw_(asw) 75 50 { 51 } 52 53 MyTask::~MyTask() 54 { 55 timer_.Close(); 76 56 } 77 57 … … 82 62 } 83 63 84 MyTask *MyTask::NewL( )64 MyTask *MyTask::NewL(CActiveSchedulerWait *asw) 85 65 { 86 MyTask *self = new (ELeave) MyTask ;66 MyTask *self = new (ELeave) MyTask(asw); 87 67 CleanupStack::PushL(self); 88 68 … … 101 81 void MyTask::RunL() 102 82 { 103 MainL(); 83 int rc = ua_main(); 84 asw_->AsyncStop(); 104 85 } 105 86 … … 108 89 } 109 90 110 TInt MyTask::RunError(TInt aError)111 {112 PJ_UNUSED_ARG(aError);113 return KErrNone;114 }115 116 117 91 LOCAL_C void DoStartL() 118 92 { 119 // Create active scheduler (to run active objects) 120 MyScheduler* scheduler = new (ELeave) MyScheduler; 93 CActiveScheduler *scheduler = new (ELeave) CActiveScheduler; 121 94 CleanupStack::PushL(scheduler); 122 95 CActiveScheduler::Install(scheduler); 123 96 124 MyTask *task = MyTask::NewL(); 97 CActiveSchedulerWait *asw = new CActiveSchedulerWait; 98 CleanupStack::PushL(asw); 99 100 MyTask *task = MyTask::NewL(asw); 125 101 task->Start(); 126 102 127 asw = new CActiveSchedulerWait;128 103 asw->Start(); 129 104 105 delete task; 106 107 CleanupStack::Pop(asw); 130 108 delete asw; 109 110 CActiveScheduler::Install(NULL); 131 111 CleanupStack::Pop(scheduler); 132 } 133 134 135 //////////////////////////////////////////////////////////////////////////// 136 137 class TMyTrapHandler : public TTrapHandler 138 { 139 public: 140 void Install(); 141 void Uninstall(); 142 virtual IMPORT_C void Trap(); 143 virtual IMPORT_C void UnTrap(); 144 virtual IMPORT_C void Leave(TInt aValue); 145 146 private: 147 TTrapHandler *prev_; 148 }; 149 150 void TMyTrapHandler::Install() { 151 prev_ = User::SetTrapHandler(this); 152 } 153 154 void TMyTrapHandler::Uninstall() { 155 User::SetTrapHandler(prev_); 156 } 157 158 IMPORT_C void TMyTrapHandler::Trap() 159 { 160 prev_->Trap(); 161 } 162 163 IMPORT_C void TMyTrapHandler::UnTrap() 164 { 165 prev_->UnTrap(); 166 } 167 168 IMPORT_C void TMyTrapHandler::Leave(TInt aValue) 169 { 170 prev_->Leave(aValue); 112 delete scheduler; 171 113 } 172 114 … … 177 119 GLDEF_C TInt E32Main() 178 120 { 179 TMyTrapHandler th;180 181 th.Install();182 183 121 // Create cleanup stack 184 //__UHEAP_MARK;122 __UHEAP_MARK; 185 123 CTrapCleanup* cleanup = CTrapCleanup::New(); 186 124 … … 193 131 194 132 console->Printf(_L("[press any key to close]\n")); 195 console->Getch();133 //console->Getch(); 196 134 197 135 delete console; 198 136 delete cleanup; 199 //__UHEAP_MARKEND; 200 201 th.Uninstall();137 138 CloseSTDLIB(); 139 __UHEAP_MARKEND; 202 140 return KErrNone; 203 141 } -
pjproject/trunk/pjsip-apps/src/symbian_ua/ua.cpp
r1246 r1248 47 47 // Destination URI (to make call, or to subscribe presence) 48 48 // 49 #define SIP_DST_URI "sip:192.168.0.7 0:5061"49 #define SIP_DST_URI "sip:192.168.0.7:5061" 50 50 51 51 // … … 53 53 // 54 54 #define HAS_SIP_ACCOUNT 0 // 0 to disable registration 55 #define SIP_DOMAIN " colinux"56 #define SIP_USER " bulukucing"57 #define SIP_PASSWD " netura"55 #define SIP_DOMAIN "server" 56 #define SIP_USER "user" 57 #define SIP_PASSWD "password" 58 58 59 59 // … … 61 61 // 62 62 #define SIP_PROXY NULL 63 //#define SIP_PROXY "sip:192.168.0.1" 63 //#define SIP_PROXY "sip:192.168.0.8" 64 65 66 // 67 // Configure nameserver if DNS SRV is to be used with both SIP 68 // or STUN (for STUN see other settings below) 69 // 70 #define NAMESERVER NULL 71 //#define NAMESERVER "62.241.163.201" 72 73 // 74 // STUN server 75 #if 0 76 // Use this to have the STUN server resolved normally 77 # define STUN_DOMAIN NULL 78 # define STUN_SERVER "stun.fwdnet.net" 79 #elif 0 80 // Use this to have the STUN server resolved with DNS SRV 81 # define STUN_DOMAIN "iptel.org" 82 # define STUN_SERVER NULL 83 #else 84 // Use this to disable STUN 85 # define STUN_DOMAIN NULL 86 # define STUN_SERVER NULL 87 #endif 88 89 // 90 // Use ICE? 91 // 92 #define USE_ICE 1 64 93 65 94 … … 94 123 g_call_id = call_id; 95 124 96 /* Automatically answer incoming calls with 200/OK*/97 pjsua_call_answer(call_id, 200, NULL, NULL);125 /* Automatically answer incoming calls with 180/Ringing */ 126 pjsua_call_answer(call_id, 180, NULL, NULL); 98 127 } 99 128 … … 110 139 if (call_id == g_call_id) 111 140 g_call_id = PJSUA_INVALID_ID; 112 } else {141 } else if (ci.state != PJSIP_INV_STATE_INCOMING) { 113 142 if (g_call_id == PJSUA_INVALID_ID) 114 143 g_call_id = call_id; … … 276 305 } 277 306 307 if (NAMESERVER) { 308 cfg.nameserver_count = 1; 309 cfg.nameserver[0] = pj_str(NAMESERVER); 310 } 311 312 if (NAMESERVER && STUN_DOMAIN) { 313 cfg.stun_domain = pj_str(STUN_DOMAIN); 314 } else if (STUN_SERVER) { 315 cfg.stun_host = pj_str(STUN_SERVER); 316 } 317 318 278 319 pjsua_logging_config_default(&log_cfg); 279 320 log_cfg.console_level = 4; … … 285 326 med_cfg.clock_rate = 8000; 286 327 med_cfg.ec_tail_len = 0; 328 med_cfg.enable_ice = USE_ICE; 287 329 288 330 status = pjsua_init(&cfg, &log_cfg, &med_cfg); … … 483 525 } 484 526 527 485 528 //////////////////////////////////////////////////////////////////////////// 486 529 int ua_main() … … 492 535 if (status != PJ_SUCCESS) 493 536 return status; 494 495 537 496 538 // Run the UI 497 539 CActiveSchedulerWait *asw = new CActiveSchedulerWait; -
pjproject/trunk/pjsip/include/pjsip/sip_transport.h
r974 r1248 933 933 int *port); 934 934 935 /** 936 * Return number of transports currently registered to the transport 937 * manager. 938 * 939 * @param mgr The transport manager. 940 * 941 * @return Number of transports. 942 */ 943 PJ_DECL(unsigned) pjsip_tpmgr_get_transport_count(pjsip_tpmgr *mgr); 944 935 945 936 946 /** -
pjproject/trunk/pjsip/src/pjsip/sip_transport.c
r1241 r1248 1012 1012 } 1013 1013 1014 /* 1015 * Return number of transports currently registered to the transport 1016 * manager. 1017 */ 1018 PJ_DEF(unsigned) pjsip_tpmgr_get_transport_count(pjsip_tpmgr *mgr) 1019 { 1020 pj_hash_iterator_t itr_val; 1021 pj_hash_iterator_t *itr; 1022 int nr_of_transports = 0; 1023 1024 pj_lock_acquire(mgr->lock); 1025 1026 itr = pj_hash_first(mgr->table, &itr_val); 1027 while (itr) { 1028 nr_of_transports++; 1029 itr = pj_hash_next(mgr->table, itr); 1030 } 1031 1032 pj_lock_release(mgr->lock); 1033 1034 return nr_of_transports; 1035 } 1014 1036 1015 1037 /* -
pjproject/trunk/pjsip/src/pjsip/sip_transport_udp.c
r1242 r1248 130 130 */ 131 131 for (i=0;; ++i) { 132 enum { MIN_SIZE = 32 }; 132 133 pj_uint32_t flags; 133 134 134 /* Report the packet to transport manager. */ 135 if (bytes_read > 0) { 135 /* Report the packet to transport manager. Only do so if packet size 136 * is relatively big enough for a SIP packet. 137 */ 138 if (bytes_read > MIN_SIZE) { 136 139 pj_size_t size_eaten; 137 140 const pj_sockaddr_in *src_addr = … … 158 161 rdata->pkt_info.len = 0; 159 162 160 } else if (bytes_read == 0) {163 } else if (bytes_read <= MIN_SIZE) { 161 164 162 165 /* TODO: */ -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c
r1246 r1248 647 647 { 648 648 #if defined(PJ_SYMBIAN) && PJ_SYMBIAN != 0 649 /* Ideally we shouldn't call pj_thread_sleep() and rather 650 * CActiveScheduler::WaitForAnyRequest() here, but that will 651 * drag in Symbian header and it doesn't look pretty. 652 */ 649 653 pj_thread_sleep(msec); 650 654 #else … … 976 980 PJ_DEF(int) pjsua_handle_events(unsigned msec_timeout) 977 981 { 982 #if defined(PJ_SYMBIAN) && PJ_SYMBIAN != 0 983 /* Ideally we shouldn't call pj_thread_sleep() and rather 984 * CActiveScheduler::WaitForAnyRequest() here, but that will 985 * drag in Symbian header and it doesn't look pretty. 986 */ 987 pj_thread_sleep(msec_timeout); 988 return msec_timeout; 989 #else 990 978 991 unsigned count = 0; 979 992 pj_time_val tv; … … 990 1003 991 1004 return count; 1005 #endif 992 1006 } 993 1007
Note: See TracChangeset
for help on using the changeset viewer.