Ignore:
Timestamp:
Oct 25, 2013 10:34:38 AM (10 years ago)
Author:
bennylp
Message:

Re #1519: Implementation of Account API, with inheritance approach:

  • With small demo app (samples/pjsua2_demo.cpp)
  • Endpoint changed to use inheritance approach too
  • Simple account registration demo and callback works
  • Further tests will be done in high level app (Python GUI?)
  • Temporary build setting fixes (Makefile) to allow linking with pjsua2 and libstdc++
  • Temporary hacks in Makefile to ignore other build targets to speed up build. This should be fixed during integration.

Issues:

  • incomplete Endpoint::on_incoming_subscribe() implementation. There is no Account::presNotify() yet.
  • incomplete Endpoint::on_pager2(), on_pager_status2(), to handle call's pager rather than account's pager
  • some SWIGTYPE (unknown type by Swig) still unresolved
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/projects/pjsua2/pjsip-apps/src/samples/pjsua2_demo.cpp

    r4631 r4638  
    2323using namespace pj; 
    2424 
    25 class MyAccountCallback : public AccountCallback 
     25class MyAccount : public Account 
    2626{ 
    2727public: 
    28     MyAccountCallback() 
    29     : AccountCallback() 
     28    MyAccount() 
    3029    {} 
    3130 
    3231    virtual void onRegState(OnRegStateParam &prm) 
    3332    { 
    34         AccountInfo ai = account()->getInfo(); 
     33        AccountInfo ai = getInfo(); 
    3534        std::cout << (ai.regIsActive? "*** Register: code=" : "*** Unregister: code=") 
    3635                  << prm.code << std::endl; 
     
    4039static void mainProg() throw(Error) 
    4140{ 
    42     Endpoint & ep = Endpoint::instance(); 
     41    Endpoint ep; 
    4342 
    4443    // Create library 
     
    4645 
    4746    // Init library 
    48     ep.libInit( EpConfig() ); 
     47    EpConfig ep_cfg; 
     48    ep_cfg.logConfig.level = 4; 
     49    ep.libInit( ep_cfg ); 
    4950 
    5051    // Transport 
     
    6364    acc_cfg.sipConfig.authCreds.push_back( AuthCredInfo("digest", "*", 
    6465                                                        "test1", 0, "test1") ); 
    65     std::auto_ptr<Account> acc(new Account(new MyAccountCallback, NULL)); 
     66    std::auto_ptr<Account> acc(new MyAccount); 
    6667    acc->create(acc_cfg); 
    6768 
     
    7071    // Destroy library 
    7172    std::cout << "*** PJSUA2 SHUTTING DOWN ***" << std::endl; 
    72     ep.libDestroy(); 
    7373} 
    7474 
     
    8484    } 
    8585 
    86     Endpoint::instance().libDestroy(); 
    87  
    8886    return ret; 
    8987} 
Note: See TracChangeset for help on using the changeset viewer.