Changeset 5738 for pjproject/trunk/pjsip-apps/src/swig/java/sample2.java
- Timestamp:
- Feb 16, 2018 9:37:00 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/swig/java/sample2.java
r5402 r5738 34 34 class MyObserver implements MyAppObserver { 35 35 private static MyCall currentCall = null; 36 private static boolean del_call_scheduled = false; 37 38 public void check_call_deletion() 39 { 40 if (del_call_scheduled && currentCall != null) { 41 currentCall.delete(); 42 currentCall = null; 43 del_call_scheduled = false; 44 } 45 } 36 46 37 47 @Override … … 67 77 } 68 78 if (ci.getState() == pjsip_inv_state.PJSIP_INV_STATE_DISCONNECTED) { 69 currentCall = null; 79 // Should not delete call instance here, so let's schedule it. 80 // The call will be deleted by our main worker thread. 81 del_call_scheduled = true; 70 82 } else if (ci.getState() == pjsip_inv_state.PJSIP_INV_STATE_CONFIRMED) { 71 83 if (ci.getSetting().getVideoCount() != 0) { … … 89 101 class MyThread extends Thread { 90 102 private static MyApp app = new MyApp(); 91 private static My AppObserver observer = new MyObserver();103 private static MyObserver observer = new MyObserver(); 92 104 private static MyAccount account = null; 93 105 private static AccountConfig accCfg = null; … … 118 130 119 131 while (!Thread.currentThread().isInterrupted()) { 132 // Handle events 120 133 MyApp.ep.libHandleEvents(10); 134 135 // Check if any call instance need to be deleted 136 observer.check_call_deletion(); 121 137 try { 122 138 Thread.currentThread().sleep(50);
Note: See TracChangeset
for help on using the changeset viewer.