- Timestamp:
- Oct 25, 2013 10:34:38 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/projects/pjsua2/pjsip-apps/src/samples/pjsua2_demo.cpp
r4631 r4638 23 23 using namespace pj; 24 24 25 class MyAccount Callback : public AccountCallback25 class MyAccount : public Account 26 26 { 27 27 public: 28 MyAccountCallback() 29 : AccountCallback() 28 MyAccount() 30 29 {} 31 30 32 31 virtual void onRegState(OnRegStateParam &prm) 33 32 { 34 AccountInfo ai = account()->getInfo();33 AccountInfo ai = getInfo(); 35 34 std::cout << (ai.regIsActive? "*** Register: code=" : "*** Unregister: code=") 36 35 << prm.code << std::endl; … … 40 39 static void mainProg() throw(Error) 41 40 { 42 Endpoint & ep = Endpoint::instance();41 Endpoint ep; 43 42 44 43 // Create library … … 46 45 47 46 // Init library 48 ep.libInit( EpConfig() ); 47 EpConfig ep_cfg; 48 ep_cfg.logConfig.level = 4; 49 ep.libInit( ep_cfg ); 49 50 50 51 // Transport … … 63 64 acc_cfg.sipConfig.authCreds.push_back( AuthCredInfo("digest", "*", 64 65 "test1", 0, "test1") ); 65 std::auto_ptr<Account> acc(new Account(new MyAccountCallback, NULL));66 std::auto_ptr<Account> acc(new MyAccount); 66 67 acc->create(acc_cfg); 67 68 … … 70 71 // Destroy library 71 72 std::cout << "*** PJSUA2 SHUTTING DOWN ***" << std::endl; 72 ep.libDestroy();73 73 } 74 74 … … 84 84 } 85 85 86 Endpoint::instance().libDestroy();87 88 86 return ret; 89 87 }
Note: See TracChangeset
for help on using the changeset viewer.