diff options
author | Nanang Izzuddin <nanang@teluu.com> | 2016-05-24 07:13:44 +0000 |
---|---|---|
committer | Nanang Izzuddin <nanang@teluu.com> | 2016-05-24 07:13:44 +0000 |
commit | 2c11f554d882b23a482cbc5c83eb1f61b1e1c114 (patch) | |
tree | bcc56fcaf9eb09426e1dad1f18860dd15042301c /pjsip-apps/src | |
parent | 74960a1414b064b75ed3c3a5eb283652e1b639a0 (diff) |
Misc (re #1917): Added capability of receiving incoming call in pjsua2_demo.cpp.
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@5313 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip-apps/src')
-rw-r--r-- | pjsip-apps/src/samples/pjsua2_demo.cpp | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/pjsip-apps/src/samples/pjsua2_demo.cpp b/pjsip-apps/src/samples/pjsua2_demo.cpp index a731bd5f..35a5eecf 100644 --- a/pjsip-apps/src/samples/pjsua2_demo.cpp +++ b/pjsip-apps/src/samples/pjsua2_demo.cpp @@ -291,6 +291,35 @@ static void mainProg() throw(Error) } } + +static void mainProg4(Endpoint &ep) throw(Error) +{ + // Init library + EpConfig ep_cfg; + ep.libInit( ep_cfg ); + + // Create transport + TransportConfig tcfg; + tcfg.port = 5060; + ep.transportCreate(PJSIP_TRANSPORT_UDP, tcfg); + ep.transportCreate(PJSIP_TRANSPORT_TCP, tcfg); + + // Add account + AccountConfig acc_cfg; + acc_cfg.idUri = "sip:localhost"; + std::auto_ptr<MyAccount> acc(new MyAccount); + acc->create(acc_cfg); + + // Start library + ep.libStart(); + std::cout << "*** PJSUA2 STARTED ***" << std::endl; + + // Just wait for ENTER key + std::cout << "Press ENTER to quit..." << std::endl; + std::cin.get(); +} + + int main() { int ret = 0; @@ -299,7 +328,7 @@ int main() try { ep.libCreate(); - mainProg3(ep); + mainProg4(ep); ret = PJ_SUCCESS; } catch (Error & err) { std::cout << "Exception: " << err.info() << std::endl; |