- Timestamp:
- Aug 21, 2018 7:23:25 AM (6 years ago)
- Location:
- pjproject/trunk/pjsip-apps/src/swig/java/android/app/src/main/java/org/pjsip/pjsua2/app
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/swig/java/android/app/src/main/java/org/pjsip/pjsua2/app/CallActivity.java
r5502 r5863 329 329 String call_state = ""; 330 330 331 if (ci == null) { 332 buttonAccept.setVisibility(View.GONE); 333 buttonHangup.setText("OK"); 334 tvState.setText("Call disconnected"); 335 return; 336 } 337 331 338 if (ci.getRole() == pjsip_role_e.PJSIP_ROLE_UAC) { 332 339 buttonAccept.setVisibility(View.GONE); -
pjproject/trunk/pjsip-apps/src/swig/java/android/app/src/main/java/org/pjsip/pjsua2/app/MainActivity.java
r5738 r5863 233 233 } else if (m.what == MSG_TYPE.CALL_STATE) { 234 234 235 MyCall call = (MyCall) m.obj; 236 CallInfo ci; 237 try { 238 ci = call.getInfo(); 239 } catch (Exception e) { 240 ci = null; 235 CallInfo ci = (CallInfo) m.obj; 236 237 if (currentCall == null || ci == null || ci.getId() != currentCall.getId()) { 238 System.out.println("Call state event received, but call info is invalid"); 239 return true; 241 240 } 242 241 243 242 /* Forward the call info to CallActivity */ 244 if (ci != null && CallActivity.handler_ != null) { 245 Message m2 = Message.obtain(CallActivity.handler_, 246 MSG_TYPE.CALL_STATE, ci); 243 if (CallActivity.handler_ != null) { 244 Message m2 = Message.obtain(CallActivity.handler_, MSG_TYPE.CALL_STATE, ci); 247 245 m2.sendToTarget(); 248 246 } 249 247 250 if (ci != null &&251 ci.getState() == pjsip_inv_state.PJSIP_INV_STATE_DISCONNECTED)252 {253 c all.delete();248 if (ci.getState() == pjsip_inv_state.PJSIP_INV_STATE_DISCONNECTED) 249 { 250 currentCall.delete(); 251 currentCall = null; 254 252 } 255 253 … … 608 606 return; 609 607 610 CallInfo ci ;608 CallInfo ci = null; 611 609 try { 612 610 ci = call.getInfo(); 613 } catch (Exception e) { 614 ci = null; 615 } 616 Message m = Message.obtain(handler, MSG_TYPE.CALL_STATE, call); 611 } catch (Exception e) {} 612 613 if (ci != null) 614 return; 615 616 Message m = Message.obtain(handler, MSG_TYPE.CALL_STATE, ci); 617 617 m.sendToTarget(); 618 619 if (ci != null &&620 ci.getState() == pjsip_inv_state.PJSIP_INV_STATE_DISCONNECTED)621 {622 currentCall = null;623 }624 618 } 625 619
Note: See TracChangeset
for help on using the changeset viewer.