Changeset 5899 for pjproject/trunk/pjsip-apps/src/samples/pjsua2_demo.cpp
- Timestamp:
- Oct 17, 2018 4:38:39 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/samples/pjsua2_demo.cpp
r5717 r5899 40 40 41 41 virtual void onCallState(OnCallStateParam &prm); 42 virtual void onCallTransferRequest(OnCallTransferRequestParam &prm); 43 virtual void onCallReplaced(OnCallReplacedParam &prm); 42 44 }; 43 45 … … 55 57 std::cout << "*** Account is being deleted: No of calls=" 56 58 << calls.size() << std::endl; 59 60 for (std::vector<Call *>::iterator it = calls.begin(); 61 it != calls.end(); ) 62 { 63 delete (*it); 64 it = calls.erase(it); 65 } 57 66 } 58 67 … … 100 109 101 110 if (ci.state == PJSIP_INV_STATE_DISCONNECTED) { 102 myAcc->removeCall(this);111 //myAcc->removeCall(this); 103 112 /* Delete the call */ 104 delete this; 105 } 106 } 113 //delete this; 114 } 115 } 116 117 void MyCall::onCallTransferRequest(OnCallTransferRequestParam &prm) 118 { 119 /* Create new Call for call transfer */ 120 prm.newCall = new MyCall(*myAcc); 121 } 122 123 void MyCall::onCallReplaced(OnCallReplacedParam &prm) 124 { 125 /* Create new Call for call replace */ 126 prm.newCall = new MyCall(*myAcc, prm.newCallId); 127 } 128 107 129 108 130 static void mainProg1(Endpoint &ep) throw(Error) … … 148 170 // Destroy library 149 171 std::cout << "*** PJSUA2 SHUTTING DOWN ***" << std::endl; 150 delete call; 151 delete acc; 172 delete acc; /* Will delete all calls too */ 152 173 } 153 174 … … 347 368 ep.libCreate(); 348 369 349 mainProg 3(ep);370 mainProg1(ep); 350 371 ret = PJ_SUCCESS; 351 372 } catch (Error & err) {
Note: See TracChangeset
for help on using the changeset viewer.