Changeset 5313


Ignore:
Timestamp:
May 24, 2016 7:13:44 AM (8 years ago)
Author:
nanang
Message:

Misc (re #1917): Added capability of receiving incoming call in pjsua2_demo.cpp.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip-apps/src/samples/pjsua2_demo.cpp

    r4790 r5313  
    292292} 
    293293 
     294 
     295static void mainProg4(Endpoint &ep) throw(Error) 
     296{ 
     297    // Init library 
     298    EpConfig ep_cfg; 
     299    ep.libInit( ep_cfg ); 
     300 
     301    // Create transport 
     302    TransportConfig tcfg; 
     303    tcfg.port = 5060; 
     304    ep.transportCreate(PJSIP_TRANSPORT_UDP, tcfg); 
     305    ep.transportCreate(PJSIP_TRANSPORT_TCP, tcfg); 
     306 
     307    // Add account 
     308    AccountConfig acc_cfg; 
     309    acc_cfg.idUri = "sip:localhost"; 
     310    std::auto_ptr<MyAccount> acc(new MyAccount); 
     311    acc->create(acc_cfg); 
     312 
     313    // Start library 
     314    ep.libStart(); 
     315    std::cout << "*** PJSUA2 STARTED ***" << std::endl; 
     316 
     317    // Just wait for ENTER key 
     318    std::cout << "Press ENTER to quit..." << std::endl; 
     319    std::cin.get(); 
     320} 
     321 
     322 
    294323int main() 
    295324{ 
     
    300329        ep.libCreate(); 
    301330 
    302         mainProg3(ep); 
     331        mainProg4(ep); 
    303332        ret = PJ_SUCCESS; 
    304333    } catch (Error & err) { 
Note: See TracChangeset for help on using the changeset viewer.