浏览代码

2021.11.02 VIP wallpadCall 통화 merge
add file

DESKTOP-UNEGUH3\MadeinLab_SW_02 3 年之前
父节点
当前提交
cc4f844db3

+ 153 - 0
WallPadCall/src/main/java/kr/co/icontrols/wallpadcall/imap/Request_call_history_delete.java

@@ -0,0 +1,153 @@
+package kr.co.icontrols.wallpadcall.imap;
+
+import android.content.Context;
+import android.util.Log;
+
+import com.artncore.WallPadDataMgr.WallpadStatusData;
+import com.artncore.WallPadDataMgr.wallpaddbmgr.AddressSet;
+import com.artncore.wallpadimap.RetProci;
+import com.artncore.wallpadimap.WallPadiMAPClient;
+import com.util.LogUtil;
+
+public class Request_call_history_delete extends WallPadiMAPClient {
+    String TAG = "Request_call_history_delete";
+    String DeviceIP = "NONE";
+    String DeviceDong = "NONE";
+    String DeviceHo = "NONE";
+
+    Context mContext;
+    RetProci Proc;
+    String XMLHeader;
+    WallpadStatusData DBMGR = null;
+
+    String svrIP = "10.0.1.1";
+    int svrPort = 10000;
+    int RequestWork = 0;
+
+    public Request_call_history_delete(Context context) {
+        super.setContext(context);
+        try {
+            mContext = context;
+            super.setContext(mContext);
+            DBMGR = new WallpadStatusData(mContext);
+            AddressSet Address = DBMGR.getAddressMGR(); //DB에서 동호 정보 받아옴
+            DBMGR.closeDB();
+            //동, 호, ip 정보 저장
+            DeviceIP = Address.IPAddress;
+            DeviceDong = Address.Dong;
+            DeviceHo = Address.Ho;
+
+            //타임아웃 설정
+            SetSocketWaitCount(2000);
+
+            //XML Header 생성
+            XMLHeader = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n" +
+                    "<imap ver = \"1.0\" address = \"" + DeviceIP + "\" sender = \"" + DeviceDong + "동 " + DeviceHo + "호" + "\">\r\n";
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        } catch (Exception e) {
+            Log.e(TAG, "[Exception] Request_call_history_delete(Context context)");
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
+        }
+    }
+
+    private String makeXMLMsg(String strMsg, String strCount) {
+        try {
+            //<homeaddr name = "homedev" id_high = "102" id_low = "301" />
+            //<call_type> "all" </call_type>
+            //<count> "30" </count >
+
+            String strResult = XMLHeader +
+                    "   <service type=\"request\" name=\"call_history_delete\">\r\n" +
+                    //"      <visitor_info dong=\"" + strDong + "\" ho=\"" + strHo + "\" distinct=\"" + strType + "\" time=\"" + strTime + "\" filename=\"" + strFileName + "\" message=\"" + strMessage + "\"/>\r\n" +
+                    "       <homeaddr name = \"homedev\" id_high = \"" + DeviceDong + "\" id_low = \"" + DeviceHo + "\" />\r\n" +
+                    "       <count> \"" + strCount + "\" </count>\r\n" +
+                    strMsg +
+                    "   </service>\r\n" +
+                    "</imap>";
+            return strResult;
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+            return null;
+        } catch (Exception e) {
+            Log.e(TAG, "[Exception] makeXMLMsg(String strDong, String strHo, String strType, String strTime, String strFileName, String strMessage)");
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
+            return null;
+        }
+    }
+
+    public void setServerInfo(String strIPAddress, int nPort) {
+        try {
+            svrIP = strIPAddress;
+            svrPort = nPort;
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        } catch (Exception e) {
+            Log.e(TAG, "[Exception] setServerInfo(String strIPAddress, int nPort)");
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
+        }
+    }
+
+    public void setResultCtrl(RetProci retProci) {
+        try {
+            Proc = retProci;
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        } catch (Exception e) {
+            Log.e(TAG, "[Exception] setResultCtrl(RetProci retProci)");
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
+        }
+    }
+
+    protected void ProcComplite() {
+        try {
+            if (Proc != null) {
+                SetItem("service");
+                String result = GetAttributeVal(0, "result");
+                if (result != null) {
+                    if (result.equalsIgnoreCase("ok")) {
+                        String name= GetAttributeVal(0, "name");
+                        String type = GetAttributeVal(0, "type");
+                        if ((name!=null && name.equalsIgnoreCase("call_history_delete")) && (type!=null && type.equalsIgnoreCase("reply"))) {
+                            Proc.ProcSuccess();
+                            return;
+                        }
+                    }
+                }
+                Proc.ProcError();
+            } else {
+                if(Proc!=null) Proc.ProcError();
+            }
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        } catch (Exception e) {
+            Log.e(TAG, "[Exception] ProcComplite()");
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
+        }
+    }
+
+    protected void ProcError() {
+        Proc.ProcError();
+    }
+
+    public boolean send_call_history_delete(String strMsg, String strCount) {
+        try {
+            SetServerIPConfig(svrIP, svrPort);
+            SendXMLDoc(makeXMLMsg(strMsg, strCount), true);
+            return true;
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+            return false;
+        } catch (Exception e) {
+            Log.e(TAG, "[Exception] Request_call_history_delete(String strDong, String strHo, String strType, String strTime, String strFileName, String strMessage)");
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
+            return false;
+        }
+    }
+}

+ 153 - 0
WallPadCall/src/main/java/kr/co/icontrols/wallpadcall/imap/Request_call_history_inquiry.java

@@ -0,0 +1,153 @@
+package kr.co.icontrols.wallpadcall.imap;
+
+import android.content.Context;
+import android.util.Log;
+
+import com.artncore.WallPadDataMgr.WallpadStatusData;
+import com.artncore.WallPadDataMgr.wallpaddbmgr.AddressSet;
+import com.artncore.wallpadimap.RetProci;
+import com.artncore.wallpadimap.WallPadiMAPClient;
+import com.util.LogUtil;
+
+public class Request_call_history_inquiry extends WallPadiMAPClient {
+    String TAG = "Request_call_history_inquiry";
+    String DeviceIP = "NONE";
+    String DeviceDong = "NONE";
+    String DeviceHo = "NONE";
+
+    Context mContext;
+    RetProci Proc;
+    String XMLHeader;
+    WallpadStatusData DBMGR = null;
+
+    String svrIP = "10.0.1.1";
+    int svrPort = 10000;
+    int RequestWork = 0;
+
+    public Request_call_history_inquiry(Context context) {
+        super.setContext(context);
+        try {
+            mContext = context;
+            super.setContext(mContext);
+            DBMGR = new WallpadStatusData(mContext);
+            AddressSet Address = DBMGR.getAddressMGR(); //DB에서 동호 정보 받아옴
+            DBMGR.closeDB();
+            //동, 호, ip 정보 저장
+            DeviceIP = Address.IPAddress;
+            DeviceDong = Address.Dong;
+            DeviceHo = Address.Ho;
+
+            //타임아웃 설정
+            SetSocketWaitCount(2000);
+
+            //XML Header 생성
+            XMLHeader = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n" +
+                    "<imap ver = \"1.0\" address = \"" + DeviceIP + "\" sender = \"" + DeviceDong + "동 " + DeviceHo + "호" + "\">\r\n";
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        } catch (Exception e) {
+            Log.e(TAG, "[Exception] Request_call_history_inquiry(Context context)");
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
+        }
+    }
+
+    private String makeXMLMsg(String strDong, String strHo, String strType, String strCount) {
+        try {
+            //<homeaddr name = "homedev" id_high = "102" id_low = "301" />
+            //<call_type> "all" </call_type>
+            //<count> "30" </count >
+
+            String strResult = XMLHeader +
+                    "   <service type=\"request\" name=\"call_history_inquiry\">\r\n" +
+                    //"      <visitor_info dong=\"" + strDong + "\" ho=\"" + strHo + "\" distinct=\"" + strType + "\" time=\"" + strTime + "\" filename=\"" + strFileName + "\" message=\"" + strMessage + "\"/>\r\n" +
+                    "       <homeaddr name = \"homedev\" id_high = \"" + strDong + "\" id_low = \"" + strHo + "\" />\r\n" +
+                    "       <call_type> \"" + strType + "\" </call_type>\r\n" +
+                    "       <count> \"" + strCount + "\" </count>\r\n" +
+                    "   </service>\r\n" +
+                    "</imap>";
+            return strResult;
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+            return null;
+        } catch (Exception e) {
+            Log.e(TAG, "[Exception] makeXMLMsg(String strDong, String strHo, String strType, String strTime, String strFileName, String strMessage)");
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
+            return null;
+        }
+    }
+
+    public void setServerInfo(String strIPAddress, int nPort) {
+        try {
+            svrIP = strIPAddress;
+            svrPort = nPort;
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        } catch (Exception e) {
+            Log.e(TAG, "[Exception] setServerInfo(String strIPAddress, int nPort)");
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
+        }
+    }
+
+    public void setResultCtrl(RetProci retProci) {
+        try {
+            Proc = retProci;
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        } catch (Exception e) {
+            Log.e(TAG, "[Exception] setResultCtrl(RetProci retProci)");
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
+        }
+    }
+
+    protected void ProcComplite() {
+        try {
+            if (Proc != null) {
+                SetItem("service");
+                String result = GetAttributeVal(0, "result");
+                if (result != null) {
+                    if (result.equalsIgnoreCase("ok")) {
+                        String name= GetAttributeVal(0, "name");
+                        String type = GetAttributeVal(0, "type");
+                        if ((name!=null && name.equalsIgnoreCase("call_history_inquiry")) && (type!=null && type.equalsIgnoreCase("reply"))) {
+                            Proc.ProcSuccess();
+                            return;
+                        }
+                    }
+                }
+                Proc.ProcError();
+            } else {
+                if(Proc!=null) Proc.ProcError();
+            }
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        } catch (Exception e) {
+            Log.e(TAG, "[Exception] ProcComplite()");
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
+        }
+    }
+
+    protected void ProcError() {
+        Proc.ProcError();
+    }
+
+    public boolean send_call_history_inquiry(String strDong, String strHo, String strPage, String strCount) {
+        try {
+            SetServerIPConfig(svrIP, svrPort);
+            SendXMLDoc(makeXMLMsg(strDong, strHo, strPage, strCount), true);
+            return true;
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+            return false;
+        } catch (Exception e) {
+            Log.e(TAG, "[Exception] Request_call_history_inquiry(String strDong, String strHo, String strType, String strTime, String strFileName, String strMessage)");
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
+            return false;
+        }
+    }
+}

+ 153 - 0
WallPadCall/src/main/java/kr/co/icontrols/wallpadcall/imap/Request_call_history_save.java

@@ -0,0 +1,153 @@
+package kr.co.icontrols.wallpadcall.imap;
+
+import android.content.Context;
+import android.util.Log;
+
+import com.artncore.WallPadDataMgr.WallpadStatusData;
+import com.artncore.WallPadDataMgr.wallpaddbmgr.AddressSet;
+import com.artncore.wallpadimap.RetProci;
+import com.artncore.wallpadimap.WallPadiMAPClient;
+import com.util.LogUtil;
+
+public class Request_call_history_save extends WallPadiMAPClient {
+    String TAG = "Request_call_history_save";
+    String DeviceIP = "NONE";
+    String DeviceDong = "NONE";
+    String DeviceHo = "NONE";
+
+    Context mContext;
+    RetProci Proc;
+    String XMLHeader;
+    WallpadStatusData DBMGR = null;
+
+    String svrIP = "10.0.1.1";
+    int svrPort = 10000;
+    int RequestWork = 0;
+
+    public Request_call_history_save(Context context) {
+        super.setContext(context);
+        try {
+            mContext = context;
+            super.setContext(mContext);
+            DBMGR = new WallpadStatusData(mContext);
+            AddressSet Address = DBMGR.getAddressMGR(); //DB에서 동호 정보 받아옴
+            DBMGR.closeDB();
+            //동, 호, ip 정보 저장
+            DeviceIP = Address.IPAddress;
+            DeviceDong = Address.Dong;
+            DeviceHo = Address.Ho;
+
+            //타임아웃 설정
+            SetSocketWaitCount(2000);
+
+            //XML Header 생성
+            XMLHeader = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n" +
+                    "<imap ver = \"1.0\" address = \"" + DeviceIP + "\" sender = \"" + DeviceDong + "동 " + DeviceHo + "호" + "\">\r\n";
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        } catch (Exception e) {
+            Log.e(TAG, "[Exception] Request_call_history_save(Context context)");
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
+        }
+    }
+
+    private String makeXMLMsg(String strDong, String strHo, String strType, String time) {
+        try {
+            //<homeaddr name = "homedev" id_high = "102" id_low = "301" />
+            //<call_type> "all" </call_type>
+            //<count> "30" </count >
+
+            String strResult = XMLHeader +
+                    "   <service type=\"request\" name=\"call_history_save\">\r\n" +
+                    //"      <visitor_info dong=\"" + strDong + "\" ho=\"" + strHo + "\" distinct=\"" + strType + "\" time=\"" + strTime + "\" filename=\"" + strFileName + "\" message=\"" + strMessage + "\"/>\r\n" +
+                    "       <homeaddr name = \"homedev\" id_high = \"" + DeviceDong + "\" id_low = \"" + DeviceHo + "\" />\r\n" +
+                    "       <call_type> \"" + strType + "\" </call_type>\r\n" +
+                    "       <params event_time = \"" + time + "\" device=\"homedev\" id_high=\"" + strDong + "\" id_low=\"" + strHo + "\" />\r\n" +
+                    "   </service>\r\n" +
+                    "</imap>";
+            return strResult;
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+            return null;
+        } catch (Exception e) {
+            Log.e(TAG, "[Exception] makeXMLMsg(String strDong, String strHo, String strType, String strTime, String strFileName, String strMessage)");
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
+            return null;
+        }
+    }
+
+    public void setServerInfo(String strIPAddress, int nPort) {
+        try {
+            svrIP = strIPAddress;
+            svrPort = nPort;
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        } catch (Exception e) {
+            Log.e(TAG, "[Exception] setServerInfo(String strIPAddress, int nPort)");
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
+        }
+    }
+
+    public void setResultCtrl(RetProci retProci) {
+        try {
+            Proc = retProci;
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        } catch (Exception e) {
+            Log.e(TAG, "[Exception] setResultCtrl(RetProci retProci)");
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
+        }
+    }
+
+    protected void ProcComplite() {
+        try {
+            if (Proc != null) {
+                SetItem("service");
+                String result = GetAttributeVal(0, "result");
+                if (result != null) {
+                    if (result.equalsIgnoreCase("ok")) {
+                        String name= GetAttributeVal(0, "name");
+                        String type = GetAttributeVal(0, "type");
+                        if ((name!=null && name.equalsIgnoreCase("call_history_save")) && (type!=null && type.equalsIgnoreCase("reply"))) {
+                            Proc.ProcSuccess();
+                            return;
+                        }
+                    }
+                }
+                Proc.ProcError();
+            } else {
+                if(Proc!=null) Proc.ProcError();
+            }
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        } catch (Exception e) {
+            Log.e(TAG, "[Exception] ProcComplite()");
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
+        }
+    }
+
+    protected void ProcError() {
+        Proc.ProcError();
+    }
+
+    public boolean send_call_history_save(String strDong, String strHo, String strPage, String strTime) {
+        try {
+            SetServerIPConfig(svrIP, svrPort);
+            SendXMLDoc(makeXMLMsg(strDong, strHo, strPage, strTime), true);
+            return true;
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+            return false;
+        } catch (Exception e) {
+            Log.e(TAG, "[Exception] Request_call_history_save(String strDong, String strHo, String strType, String strTime, String strFileName, String strMessage)");
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
+            return false;
+        }
+    }
+}

+ 146 - 0
WallPadCall/src/main/java/kr/co/icontrols/wallpadcall/imap/Request_lobby_capture.java

@@ -0,0 +1,146 @@
+package kr.co.icontrols.wallpadcall.imap;
+
+import android.content.Context;
+import android.util.Log;
+
+import com.artncore.WallPadDataMgr.WallpadStatusData;
+import com.artncore.WallPadDataMgr.wallpaddbmgr.AddressSet;
+import com.artncore.wallpadimap.RetProci;
+import com.artncore.wallpadimap.WallPadiMAPClient;
+import com.util.LogUtil;
+
+public class Request_lobby_capture extends WallPadiMAPClient {
+    String TAG = "Request_lobby_open";
+    String DeviceIP = "NONE";
+    String DeviceDong = "NONE";
+    String DeviceHo = "NONE";
+
+    Context mContext;
+    RetProci Proc;
+    String XMLHeader;
+    WallpadStatusData DBMGR = null;
+
+    String svrIP = "10.0.1.10";
+    int svrPort = 10000;
+    int RequestWork = 0;
+
+    public Request_lobby_capture(Context context) {
+        super.setContext(context);
+        try {
+            mContext = context;
+            super.setContext(mContext);
+            DBMGR = new WallpadStatusData(mContext);
+            AddressSet Address = DBMGR.getAddressMGR(); //DB에서 동호 정보 받아옴
+            DBMGR.closeDB();
+            //동, 호, ip 정보 저장
+            DeviceIP = Address.IPAddress;
+            DeviceDong = Address.Dong;
+            DeviceHo = Address.Ho;
+
+            //타임아웃 설정
+            SetSocketWaitCount(2000);
+
+            //XML Header 생성
+            XMLHeader = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n" +
+                    "<imap ver = \"1.0\" address = \"" + DeviceIP + "\" sender = \"" + DeviceDong + "동 " + DeviceHo + "호" + "\">\r\n";
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        } catch (Exception e) {
+            Log.e(TAG, "[Exception] Request_lobby_capture(Context context)");
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
+        }
+    }
+
+    private String makeXMLMsg(String strMessage) {
+        try {
+            String strResult = XMLHeader +
+                    "   <service type=\"request\" name=\"lobby_capture\"/>\r\n" +
+                    "</imap>";
+            return strResult;
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+            return null;
+        } catch (Exception e) {
+            Log.e(TAG, "[Exception] makeXMLMsg(String strMessage)");
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
+            return null;
+        }
+    }
+
+    public void setServerInfo(String strIPAddress, int nPort) {
+        try {
+            svrIP = strIPAddress;
+            svrPort = nPort;
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        } catch (Exception e) {
+            Log.e(TAG, "[Exception] setServerInfo(String strIPAddress, int nPort)");
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
+        }
+    }
+
+    public void setResultCtrl(RetProci retProci) {
+        try {
+            Proc = retProci;
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        } catch (Exception e) {
+            Log.e(TAG, "[Exception] setResultCtrl(RetProci retProci)");
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
+        }
+    }
+
+    protected void ProcComplite() {
+        try {
+            if (Proc != null) {
+                SetItem("service");
+                String result = GetAttributeVal(0, "result");
+                if (result != null) {
+                    if (result.equalsIgnoreCase("ok")) {
+                        String name = GetAttributeVal(0, "name");
+                        String type = GetAttributeVal(0, "type");
+                        if ((name!=null && name.equalsIgnoreCase("lobby_open")) && (type!=null && type.equalsIgnoreCase("reply"))) {
+                            Proc.ProcSuccess();
+                            return;
+                        }
+                    }
+                }
+                Proc.ProcError();
+            } else {
+                if(Proc!=null) Proc.ProcError();
+            }
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        } catch (Exception e) {
+            Log.e(TAG, "[Exception] ProcComplite()");
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
+        }
+    }
+
+    protected void ProcError() {
+        Proc.ProcError();
+    }
+
+    public boolean send_lobby_capture(String strTargetIP, String strMessage) {
+        try {
+//            if(((MainActivity) mContext).mNewDanjiServer)
+//                svrPort = svrPort + 1000;
+            SetServerIPConfig(strTargetIP, svrPort);
+            SendXMLDoc(makeXMLMsg(strMessage), true);
+            return true;
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+            return false;
+        } catch (Exception e) {
+            Log.e(TAG, "[Exception] send_lobby_open(String strTargetIP, String strMessage)");
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
+            return false;
+        }
+    }
+}

+ 131 - 0
WallPadCall/src/main/java/kr/co/icontrols/wallpadcall/imap/Request_start_talking.java

@@ -0,0 +1,131 @@
+package kr.co.icontrols.wallpadcall.imap;
+
+import android.content.Context;
+import android.util.Log;
+
+import com.artncore.WallPadDataMgr.WallpadDeviceSet;
+import com.artncore.WallPadDataMgr.WallpadStatusData;
+import com.artncore.WallPadDataMgr.wallpaddbmgr.AddressSet;
+import com.artncore.wallpadimap.RetProci;
+import com.artncore.wallpadimap.WallPadiMAPClient;
+
+import kr.co.icontrols.wallpadcall.MainActivity;
+
+public class Request_start_talking extends WallPadiMAPClient {
+    String TAG = "Request_start_talking";
+    String DeviceIP = "NONE";
+    String DeviceDong = "NONE";
+    String DeviceHo = "NONE";
+
+    Context mContext;
+    RetProci Proc;
+    String XMLHeader;
+    WallpadStatusData DBMGR = null;
+
+    String svrIP = "10.0.1.10";
+    int svrPort = 10000;
+    int RequestWork = 0;
+
+    public Request_start_talking(Context context) {
+        super.setContext(context);
+        try {
+            mContext = context;
+            super.setContext(mContext);
+            DBMGR = new WallpadStatusData(mContext);
+            AddressSet Address = DBMGR.getAddressMGR(); //DB에서 동호 정보 받아옴
+            DBMGR.closeDB();
+            //동, 호, ip 정보 저장
+            DeviceIP = Address.IPAddress;
+            DeviceDong = Address.Dong;
+            DeviceHo = Address.Ho;
+
+            //타임아웃 설정
+            SetSocketWaitCount(2000);
+
+            //XML Header 생성
+            XMLHeader = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n" +
+                    "<imap ver = \"1.0\" address = \"" + DeviceIP + "\" sender = \"" + DeviceDong + "동 " + DeviceHo + "호" + "\">\r\n";
+        } catch (Exception e) {
+            Log.e(TAG, "[Exception] Request_start_talking(Context context)");
+            e.printStackTrace();
+        }
+    }
+
+    private String makeXMLMsg(String strMessage) {
+        try {
+            String strResult = XMLHeader +
+                    "   <service type=\"request\" name=\"start_talking\" >\r\n" +
+                    "   <calltype>\"lobby\"</calltype>\r\n" +
+                    "   </service>\r\n" +
+                    "</imap>";
+            return strResult;
+        } catch (Exception e) {
+            Log.e(TAG, "[Exception] makeXMLMsg(String strMessage)");
+            e.printStackTrace();
+            return null;
+        }
+    }
+
+    public void setServerInfo(String strIPAddress, int nPort) {
+        try {
+            svrIP = strIPAddress;
+            svrPort = nPort;
+        } catch (Exception e) {
+            Log.e(TAG, "[Exception] setServerInfo(String strIPAddress, int nPort)");
+            e.printStackTrace();
+        }
+    }
+
+    public void setResultCtrl(RetProci retProci) {
+        try {
+            Proc = retProci;
+        } catch (Exception e) {
+            Log.e(TAG, "[Exception] setResultCtrl(RetProci retProci)");
+            e.printStackTrace();
+        }
+    }
+
+    protected void ProcComplite() {
+        try {
+            if (Proc != null) {
+                SetItem("service");
+                String result = GetAttributeVal(0, "result");
+                if (result != null) {
+                    if (result.equalsIgnoreCase("ok")) {
+                        if ((GetAttributeVal(0, "name").equalsIgnoreCase("start_talking")) && (GetAttributeVal(0, "type").equalsIgnoreCase("reply"))) {
+                            Proc.ProcSuccess();
+                            return;
+                        }
+                    }
+                }
+                Proc.ProcError();
+            } else {
+                Proc.ProcError();
+            }
+        } catch (Exception e) {
+            Log.e(TAG, "[Exception] ProcComplite()");
+            e.printStackTrace();
+        }
+    }
+
+    protected void ProcError() {
+        Proc.ProcError();
+    }
+
+    public boolean send_start_talking(String strTargetIP, String strMessage) {
+        try {
+
+            int port = 10000;
+//            if(((MainActivity) mContext).mNewDanjiServer)
+//                port = svrPort + 1000;
+
+            SetServerIPConfig(strTargetIP, port);
+            SendXMLDoc(makeXMLMsg(strMessage), true);
+            return true;
+        } catch (Exception e) {
+            Log.e(TAG, "[Exception] Request_start_talking(String strTargetIP, String strMessage)");
+            e.printStackTrace();
+            return false;
+        }
+    }
+}

+ 129 - 0
WallPadCall/src/main/java/kr/co/icontrols/wallpadcall/imap/Request_stop_talking.java

@@ -0,0 +1,129 @@
+package kr.co.icontrols.wallpadcall.imap;
+
+import android.content.Context;
+import android.util.Log;
+
+import com.artncore.WallPadDataMgr.WallpadStatusData;
+import com.artncore.WallPadDataMgr.wallpaddbmgr.AddressSet;
+import com.artncore.wallpadimap.RetProci;
+import com.artncore.wallpadimap.WallPadiMAPClient;
+
+import kr.co.icontrols.wallpadcall.MainActivity;
+
+public class Request_stop_talking extends WallPadiMAPClient {
+    String TAG = "Request_stop_talking";
+    String DeviceIP = "NONE";
+    String DeviceDong = "NONE";
+    String DeviceHo = "NONE";
+
+    Context mContext;
+    RetProci Proc;
+    String XMLHeader;
+    WallpadStatusData DBMGR = null;
+
+    String svrIP = "10.0.1.10";
+    int svrPort = 10000;
+    int RequestWork = 0;
+
+    public Request_stop_talking(Context context) {
+        super.setContext(context);
+        try {
+            mContext = context;
+            super.setContext(mContext);
+            DBMGR = new WallpadStatusData(mContext);
+            AddressSet Address = DBMGR.getAddressMGR(); //DB에서 동호 정보 받아옴
+            DBMGR.closeDB();
+            //동, 호, ip 정보 저장
+            DeviceIP = Address.IPAddress;
+            DeviceDong = Address.Dong;
+            DeviceHo = Address.Ho;
+
+            //타임아웃 설정
+            SetSocketWaitCount(2000);
+
+            //XML Header 생성
+            XMLHeader = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n" +
+                    "<imap ver = \"1.0\" address = \"" + DeviceIP + "\" sender = \"" + DeviceDong + "동 " + DeviceHo + "호" + "\">\r\n";
+        } catch (Exception e) {
+            Log.e(TAG, "[Exception] Request_stop_talking(Context context)");
+            e.printStackTrace();
+        }
+    }
+
+    private String makeXMLMsg(String strMessage) {
+        try {
+            String strResult = XMLHeader +
+                    "   <service type=\"request\" name=\"stop_talking\" >\r\n" +
+                    "   <calltype>\"lobby\"</calltype>\r\n" +
+                    "   </service>\r\n" +
+                    "</imap>";
+            return strResult;
+        } catch (Exception e) {
+            Log.e(TAG, "[Exception] makeXMLMsg(String strMessage)");
+            e.printStackTrace();
+            return null;
+        }
+    }
+
+    public void setServerInfo(String strIPAddress, int nPort) {
+        try {
+            svrIP = strIPAddress;
+            svrPort = nPort;
+        } catch (Exception e) {
+            Log.e(TAG, "[Exception] setServerInfo(String strIPAddress, int nPort)");
+            e.printStackTrace();
+        }
+    }
+
+    public void setResultCtrl(RetProci retProci) {
+        try {
+            Proc = retProci;
+        } catch (Exception e) {
+            Log.e(TAG, "[Exception] setResultCtrl(RetProci retProci)");
+            e.printStackTrace();
+        }
+    }
+
+    protected void ProcComplite() {
+        try {
+            if (Proc != null) {
+                SetItem("service");
+                String result = GetAttributeVal(0, "result");
+                if (result != null) {
+                    if (result.equalsIgnoreCase("ok")) {
+                        if ((GetAttributeVal(0, "name").equalsIgnoreCase("stop_talking")) && (GetAttributeVal(0, "type").equalsIgnoreCase("reply"))) {
+                            Proc.ProcSuccess();
+                            return;
+                        } else{
+
+                        }
+                    }
+                }
+                Proc.ProcError();
+            } else {
+                Proc.ProcError();
+            }
+        } catch (Exception e) {
+            Log.e(TAG, "[Exception] ProcComplite()");
+            e.printStackTrace();
+        }
+    }
+
+    protected void ProcError() {
+        Proc.ProcError();
+    }
+
+    public boolean send_stop_talking(String strTargetIP, String strMessage) { //xml 보내는 부분
+        try {
+//            if(((MainActivity) mContext).mNewDanjiServer)
+//                svrPort = svrPort + 1000;
+            SetServerIPConfig(strTargetIP, svrPort);
+            SendXMLDoc(makeXMLMsg(strMessage),true);
+            return true;
+        } catch (Exception e) {
+            Log.e(TAG, "[Exception] Request_stop_talking(String strTargetIP, String strMessage)");
+            e.printStackTrace();
+            return false;
+        }
+    }
+}

+ 153 - 0
WallPadCall/src/main/java/kr/co/icontrols/wallpadcall/imap/Request_visitor_picture_delete.java

@@ -0,0 +1,153 @@
+package kr.co.icontrols.wallpadcall.imap;
+
+import android.content.Context;
+import android.util.Log;
+
+import com.artncore.WallPadDataMgr.WallpadStatusData;
+import com.artncore.WallPadDataMgr.wallpaddbmgr.AddressSet;
+import com.artncore.wallpadimap.RetProci;
+import com.artncore.wallpadimap.WallPadiMAPClient;
+import com.util.LogUtil;
+
+public class Request_visitor_picture_delete extends WallPadiMAPClient {
+    String TAG = "Request_visitor_picture_delete";
+    String DeviceIP = "NONE";
+    String DeviceDong = "NONE";
+    String DeviceHo = "NONE";
+
+    Context mContext;
+    RetProci Proc;
+    String XMLHeader;
+    WallpadStatusData DBMGR = null;
+
+    String svrIP = "10.0.1.1";
+    int svrPort = 10000;
+    int RequestWork = 0;
+
+    public Request_visitor_picture_delete(Context context) {
+        super.setContext(context);
+        try {
+            mContext = context;
+            super.setContext(mContext);
+            DBMGR = new WallpadStatusData(mContext);
+            AddressSet Address = DBMGR.getAddressMGR(); //DB에서 동호 정보 받아옴
+            DBMGR.closeDB();
+            //동, 호, ip 정보 저장
+            DeviceIP = Address.IPAddress;
+            DeviceDong = Address.Dong;
+            DeviceHo = Address.Ho;
+
+            //타임아웃 설정
+            SetSocketWaitCount(2000);
+
+            //XML Header 생성
+            XMLHeader = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n" +
+                    "<imap ver = \"1.0\" address = \"" + DeviceIP + "\" sender = \"" + DeviceDong + "동 " + DeviceHo + "호" + "\">\r\n";
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        } catch (Exception e) {
+            Log.e(TAG, "[Exception] Request_visitor_picture_delete(Context context)");
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
+        }
+    }
+
+    private String makeXMLMsg(String strMsg, String strCount) {
+        try {
+            //<homeaddr name = "homedev" id_high = "102" id_low = "301" />
+            //<call_type> "all" </call_type>
+            //<count> "30" </count >
+
+            String strResult = XMLHeader +
+                    "   <service type=\"request\" name=\"visitor_picture_delete\">\r\n" +
+                    //"      <visitor_info dong=\"" + strDong + "\" ho=\"" + strHo + "\" distinct=\"" + strType + "\" time=\"" + strTime + "\" filename=\"" + strFileName + "\" message=\"" + strMessage + "\"/>\r\n" +
+                    "       <homeaddr name = \"homedev\" id_high = \"" + DeviceDong + "\" id_low = \"" + DeviceHo + "\" />\r\n" +
+                    "       <count> \"" + strCount + "\" </count>\r\n" +
+                    strMsg +
+                    "   </service>\r\n" +
+                    "</imap>";
+            return strResult;
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+            return null;
+        } catch (Exception e) {
+            Log.e(TAG, "[Exception] makeXMLMsg(String strDong, String strHo, String strType, String strTime, String strFileName, String strMessage)");
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
+            return null;
+        }
+    }
+
+    public void setServerInfo(String strIPAddress, int nPort) {
+        try {
+            svrIP = strIPAddress;
+            svrPort = nPort;
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        } catch (Exception e) {
+            Log.e(TAG, "[Exception] setServerInfo(String strIPAddress, int nPort)");
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
+        }
+    }
+
+    public void setResultCtrl(RetProci retProci) {
+        try {
+            Proc = retProci;
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        } catch (Exception e) {
+            Log.e(TAG, "[Exception] setResultCtrl(RetProci retProci)");
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
+        }
+    }
+
+    protected void ProcComplite() {
+        try {
+            if (Proc != null) {
+                SetItem("service");
+                String result = GetAttributeVal(0, "result");
+                if (result != null) {
+                    if (result.equalsIgnoreCase("ok")) {
+                        String name= GetAttributeVal(0, "name");
+                        String type = GetAttributeVal(0, "type");
+                        if ((name!=null && name.equalsIgnoreCase("visitor_picture_delete")) && (type!=null && type.equalsIgnoreCase("reply"))) {
+                            Proc.ProcSuccess();
+                            return;
+                        }
+                    }
+                }
+                Proc.ProcError();
+            } else {
+                if(Proc!=null) Proc.ProcError();
+            }
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        } catch (Exception e) {
+            Log.e(TAG, "[Exception] ProcComplite()");
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
+        }
+    }
+
+    protected void ProcError() {
+        Proc.ProcError();
+    }
+
+    public boolean send_visitor_picture_delete(String strMsg, String strCount) {
+        try {
+            SetServerIPConfig(svrIP, svrPort);
+            SendXMLDoc(makeXMLMsg(strMsg, strCount), true);
+            return true;
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+            return false;
+        } catch (Exception e) {
+            Log.e(TAG, "[Exception] Request_visitor_picture_delete(String strDong, String strHo, String strType, String strTime, String strFileName, String strMessage)");
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
+            return false;
+        }
+    }
+}

+ 152 - 0
WallPadCall/src/main/java/kr/co/icontrols/wallpadcall/imap/Request_visitor_picture_inquiry.java

@@ -0,0 +1,152 @@
+package kr.co.icontrols.wallpadcall.imap;
+
+import android.content.Context;
+import android.util.Log;
+
+import com.artncore.WallPadDataMgr.WallpadStatusData;
+import com.artncore.WallPadDataMgr.wallpaddbmgr.AddressSet;
+import com.artncore.wallpadimap.RetProci;
+import com.artncore.wallpadimap.WallPadiMAPClient;
+import com.util.LogUtil;
+
+public class Request_visitor_picture_inquiry extends WallPadiMAPClient {
+    String TAG = "Request_visitor_picture_inquiry";
+    String DeviceIP = "NONE";
+    String DeviceDong = "NONE";
+    String DeviceHo = "NONE";
+
+    Context mContext;
+    RetProci Proc;
+    String XMLHeader;
+    WallpadStatusData DBMGR = null;
+
+    String svrIP = "10.0.1.1";
+    int svrPort = 10000;
+    int RequestWork = 0;
+
+    public Request_visitor_picture_inquiry(Context context) {
+        super.setContext(context);
+        try {
+            mContext = context;
+            super.setContext(mContext);
+            DBMGR = new WallpadStatusData(mContext);
+            AddressSet Address = DBMGR.getAddressMGR(); //DB에서 동호 정보 받아옴
+            DBMGR.closeDB();
+            //동, 호, ip 정보 저장
+            DeviceIP = Address.IPAddress;
+            DeviceDong = Address.Dong;
+            DeviceHo = Address.Ho;
+
+            //타임아웃 설정
+            SetSocketWaitCount(2000);
+
+            //XML Header 생성
+            XMLHeader = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n" +
+                    "<imap ver = \"1.0\" address = \"" + DeviceIP + "\" sender = \"" + DeviceDong + "동 " + DeviceHo + "호" + "\">\r\n";
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        } catch (Exception e) {
+            Log.e(TAG, "[Exception] Request_visitor_picture_inquiry(Context context)");
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
+        }
+    }
+
+    private String makeXMLMsg(String strDong, String strHo, String strPage, String strCount) {
+        try {
+            //<service type="request" name="visitor_picture_inquiry">
+            //<homeaddr name = "homedev" id_high = "102" id_low = "301" />
+            //<inquiry_info start_num="1" quantity="6" />
+
+            String strResult = XMLHeader +
+                    "   <service type=\"request\" name=\"visitor_picture_inquiry\">\r\n" +
+                    //"      <visitor_info dong=\"" + strDong + "\" ho=\"" + strHo + "\" distinct=\"" + strType + "\" time=\"" + strTime + "\" filename=\"" + strFileName + "\" message=\"" + strMessage + "\"/>\r\n" +
+                    "       <homeaddr name = \"homedev\" id_high = \"" + strDong + "\" id_low = \"" + strHo + "\" />\r\n" +
+                    "       <inquiry_info start_num=\"" + strPage + "\" quantity=\"" + strCount + "\" />\r\n" +
+                    "   </service>\r\n" +
+                    "</imap>";
+            return strResult;
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+            return null;
+        } catch (Exception e) {
+            Log.e(TAG, "[Exception] makeXMLMsg(String strDong, String strHo, String strType, String strTime, String strFileName, String strMessage)");
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
+            return null;
+        }
+    }
+
+    public void setServerInfo(String strIPAddress, int nPort) {
+        try {
+            svrIP = strIPAddress;
+            svrPort = nPort;
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        } catch (Exception e) {
+            Log.e(TAG, "[Exception] setServerInfo(String strIPAddress, int nPort)");
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
+        }
+    }
+
+    public void setResultCtrl(RetProci retProci) {
+        try {
+            Proc = retProci;
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        } catch (Exception e) {
+            Log.e(TAG, "[Exception] setResultCtrl(RetProci retProci)");
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
+        }
+    }
+
+    protected void ProcComplite() {
+        try {
+            if (Proc != null) {
+                SetItem("service");
+                String result = GetAttributeVal(0, "result");
+                if (result != null) {
+                    if (result.equalsIgnoreCase("ok")) {
+                        String name= GetAttributeVal(0, "name");
+                        String type = GetAttributeVal(0, "type");
+                        if ((name!=null && name.equalsIgnoreCase("visitor_picture_inquiry")) && (type!=null && type.equalsIgnoreCase("reply"))) {
+                            Proc.ProcSuccess();
+                            return;
+                        }
+                    }
+                }
+                Proc.ProcError();
+            } else {
+                if(Proc!=null) Proc.ProcError();
+            }
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+        } catch (Exception e) {
+            Log.e(TAG, "[Exception] ProcComplite()");
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
+        }
+    }
+
+    protected void ProcError() {
+        Proc.ProcError();
+    }
+
+    public boolean send_visitor_picture_inquiry(String strDong, String strHo, String strPage, String strCount) {
+        try {
+            SetServerIPConfig(svrIP, svrPort);
+            SendXMLDoc(makeXMLMsg(strDong, strHo, strPage, strCount), true);
+            return true;
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+            return false;
+        } catch (Exception e) {
+            Log.e(TAG, "[Exception] send_visitor_picture_inquiry(String strDong, String strHo, String strType, String strTime, String strFileName, String strMessage)");
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
+            return false;
+        }
+    }
+}