|
@@ -133,6 +133,9 @@ public class TalkGuard extends WpadScreen implements CallEventListener, MainEven
|
|
|
mContext = context;
|
|
|
Initialize();
|
|
|
|
|
|
+ addBrActionFilter("REDIRECT_CALL");
|
|
|
+ m_rediectCAll_eCallOwner = null;
|
|
|
+
|
|
|
SCREEN_BG = new WpadImageView(context, TOUCH_KIND.NONE, 1280, 690, R.drawable.bg_body, R.drawable.bg_body, ID.SCREEN.TALKGUARD.ELEMENT.IMAGE.BG);
|
|
|
ViewRegistration(layout, SCREEN_BG, 0, 0);
|
|
|
|
|
@@ -284,6 +287,7 @@ public class TalkGuard extends WpadScreen implements CallEventListener, MainEven
|
|
|
super.onClose();
|
|
|
try {
|
|
|
LOG_INFO("[onClose]");
|
|
|
+ m_rediectCAll_eCallOwner = null;
|
|
|
if (MainActivity.mIOInterface != null) MainActivity.mIOInterface.ctrlWallPadLED_Call(false);
|
|
|
if (mPathCheckHandler != null) {
|
|
|
mPathCheckHandler.removeMessages(0);
|
|
@@ -329,6 +333,31 @@ public class TalkGuard extends WpadScreen implements CallEventListener, MainEven
|
|
|
protected void onBrReceive(Intent intent) {
|
|
|
super.onBrReceive(intent);
|
|
|
try {
|
|
|
+
|
|
|
+ if(intent.getAction().equals("REDIRECT_CALL"))
|
|
|
+ {
|
|
|
+ String strRedirectIP = intent.getStringExtra(Declare.CALLTRIGGER.REMOTEINFO);
|
|
|
+
|
|
|
+ String[] aDeviceName = Global.makeDeviceName(strRedirectIP);
|
|
|
+ LOG("[onKeyDown] strRedirectIP [" + strRedirectIP + "] strGuard_Dong [" + aDeviceName[1] + "], strGuard_ID [" + aDeviceName[2] + "]");
|
|
|
+ RemoteIDInfo.strDong = aDeviceName[1];
|
|
|
+ RemoteIDInfo.strHo = aDeviceName[2];
|
|
|
+ RemoteIDInfo.strIP = strRedirectIP;
|
|
|
+
|
|
|
+ if (!send_check_sip_activation_request(RemoteIDInfo.strIP)) {
|
|
|
+ initCallVariables();
|
|
|
+ MainActivity.mSound.PlayMent(SND.guard.TRYLATER);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(m_rediectCAll_eCallOwner != null )
|
|
|
+ MainActivity.mCallController.mCallInfo.setCallOwner(m_rediectCAll_eCallOwner);
|
|
|
+ else
|
|
|
+ MainActivity.mCallController.mCallInfo.setCallOwner(CALLOWNER.WALLPAD);
|
|
|
+
|
|
|
+ MainActivity.mCallController.mCallInfo.setCallStatus(CALLTYPE.GUARD, CALLSTATUS.TRYING_CALL);
|
|
|
+ }
|
|
|
+
|
|
|
// LOG_INFO("[onBrReceive] intent : " + intent);
|
|
|
} catch (RuntimeException re) {
|
|
|
LogUtil.errorLogInfo("", TAG, re);
|
|
@@ -931,12 +960,15 @@ public class TalkGuard extends WpadScreen implements CallEventListener, MainEven
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ CALLOWNER m_rediectCAll_eCallOwner;
|
|
|
@Override
|
|
|
public void onSubPhoneEvent(CALLOWNER eCallOwner, CALLSTATUS eCallStatus, CALLTYPE eCallType, String strTargetID, String strMessage) {
|
|
|
try {
|
|
|
LOG_INFO("[onSubPhoneEvent] eCallOwner [" + eCallOwner + "], eCallStatus [" + eCallStatus + "], eCallType [" + eCallType + "], strTargetID [" + strTargetID + "], strMessage [" + strMessage + "]");
|
|
|
if (eCallType == CALLTYPE.NONE) return;
|
|
|
|
|
|
+ m_rediectCAll_eCallOwner = eCallOwner;
|
|
|
+
|
|
|
if (eCallType == CALLTYPE.GUARD) {
|
|
|
if (eCallStatus == CALLSTATUS.TRYING_CALL) {
|
|
|
if (eCallOwner != CALLOWNER.WALLPAD) {
|
|
@@ -952,7 +984,7 @@ public class TalkGuard extends WpadScreen implements CallEventListener, MainEven
|
|
|
tryGuardCall(eCallOwner, nGuardID);
|
|
|
}
|
|
|
}
|
|
|
- if (eCallStatus == CALLSTATUS.TALKING) {
|
|
|
+ else if (eCallStatus == CALLSTATUS.TALKING) {
|
|
|
if (eCallOwner != CALLOWNER.WALLPAD) {
|
|
|
doTalk(eCallOwner);
|
|
|
}
|
|
@@ -1359,6 +1391,8 @@ public class TalkGuard extends WpadScreen implements CallEventListener, MainEven
|
|
|
else if (nGuardType == GUARDLIST.SUBGATE) strGuardIP = strSUBGATEGUARD_IP;
|
|
|
else if (nGuardType == GUARDLIST.OFFICE) strGuardIP = strOFFICEGUARD_IP;
|
|
|
|
|
|
+ //strGuardIP = "10.1.128.10";
|
|
|
+
|
|
|
String[] IP_Parse = strGuardIP.split("\\.");
|
|
|
int nDong = 101;
|
|
|
if (ConfigValues.bIPExpansion) {
|