コード例 #1
0
ファイル: CSocketServer.cs プロジェクト: anhphamkstn/DVMC3.0
        public static void open_form_sinh_vien_call(CallInfor ip_call_info)
        {
            try
            {
                SinhVien v_obj_sinhvien = new SinhVien();
                SyncData v_ws_scm       = new SyncData();
                string   v_str_search   = HelpUtils.gen_string_call_scm_get_sinh_vien_ws(ip_call_info.mobile_phone, "", "", "", "10", "TOPICA");
                DataSet  v_ds           = v_ws_scm.TOS_search_info_hoc_vien(v_str_search);
                v_obj_sinhvien.get_sinh_vien_by_ds(v_ds);
                //
                // Nếu ko tìm được học viên thì Số điện thoại sẽ được bảo toàn, tránh bị Null
                //
                if (v_obj_sinhvien.Dien_thoai == null)
                {
                    v_obj_sinhvien.Dien_thoai = ip_call_info.mobile_phone;
                }

                //f200_sinh_vien_goi_den v_f200 = new f200_sinh_vien_goi_den();
                // v_f200.display(v_obj_sinhvien, ip_call_info.call_id);
                string v_str_thong_tin_goi_vao = "";
                if (v_obj_sinhvien.Ho_ten != "")
                {
                    v_str_thong_tin_goi_vao += "Họ tên: " + v_obj_sinhvien.Ho_ten + "; ";
                }
                if (v_obj_sinhvien.Dien_thoai != "")
                {
                    v_str_thong_tin_goi_vao += "ĐT: " + v_obj_sinhvien.Dien_thoai;
                }
                //  HelpUtils.ghi_log_he_thong(LOG_TRUY_CAP.HOC_VIEN_GOI_DEN, v_str_thong_tin_goi_vao, "Gọi vào", f002_main_form.m_str_stationId);
            }
            catch (Exception v_e)
            {
                CSystemLog_100.ExceptionHandle(v_e);
            }
        }
コード例 #2
0
        /// <summary>
        /// Hàm này thực hiện việc get incoming call
        /// </summary>
        /// <param name="ip_extension">Mã máy điện thoại</param>
        /// <returns></returns>
        public static CGetIncomingCallData get_incoming_call(string ip_extension)
        {
            string v_str_result        = "";
            string v_str_link_services = "";

            v_str_link_services = f002_main_form.m_str_web_service_url + WEB_URL_CALL_CENTER.GET_INCOMING_CALL(ip_extension);

            v_str_result = HelpUtils.get_content_from_weburl(v_str_link_services);

            CGetIncomingCall v_obj_infor = JsonConvert.DeserializeObject <CGetIncomingCall>(v_str_result);

            return(v_obj_infor.Action);
        }
コード例 #3
0
        /// <summary>
        /// Hàm này thực hiện việc add or remove 1 SĐT vào / ra khỏi blacklist
        /// </summary>
        /// <param name="ip_dien_thoai">SĐT cần add / remove</param>
        /// <param name="ip_code">10: add; 20: remove</param>
        /// <returns></returns>
        public static CAddRemoveBlackListData add_remove_blacklist(string ip_dien_thoai, int ip_code)
        {
            string v_str_result        = "";
            string v_str_link_services = "";

            v_str_link_services = f002_main_form.m_str_web_service_url + WEB_URL_CALL_CENTER.ADD_REMOVE_BLACKLIST(ip_dien_thoai, ip_code);

            v_str_result = HelpUtils.get_content_from_weburl(v_str_link_services);

            CAddRemoveBlackList v_obj_infor = JsonConvert.DeserializeObject <CAddRemoveBlackList>(v_str_result);

            return(v_obj_infor.Action);
        }
コード例 #4
0
        /// <summary>
        /// Hàm này thực hiện unregister ipphone khỏi queue
        /// </summary>
        /// <param name="ip_extension">Mã ipphone</param>
        /// <returns></returns>
        public static CUnRegisterQueueData register_ipaddress_ipphone_2_queue(string ip_extension)
        {
            string v_str_result        = "";
            string v_str_link_services = "";

            v_str_link_services = f002_main_form.m_str_web_service_url + WEB_URL_CALL_CENTER.UNREGISTER_IP(ip_extension);

            v_str_result = HelpUtils.get_content_from_weburl(v_str_link_services);

            CUnRegisterQueue v_obj_infor = JsonConvert.DeserializeObject <CUnRegisterQueue>(v_str_result);

            return(v_obj_infor.Action);
        }
コード例 #5
0
        /// <summary>
        /// Hàm này thực hiện việc get incoming call
        /// </summary>
        /// <param name="ip_extension">Mã máy điện thoại</param>
        /// <returns></returns>
        public static CGetIncomingCallData get_incoming_call(string ip_str_link_services)
        {
            string v_str_result = "";

            //string v_str_link_services = "";
            // v_str_link_services = "http://203.162.121.70:8080/TPCServer/tpc/DoAction.jsp?event=" + WEB_URL_CALL_CENTER.GET_INCOMING_CALL(ip_extension);

            v_str_result = HelpUtils.get_content_from_weburl(ip_str_link_services);

            CGetIncomingCall v_obj_infor = JsonConvert.DeserializeObject <CGetIncomingCall>(v_str_result);

            return(v_obj_infor.Action);
        }
コード例 #6
0
        /// <summary>
        /// Hàm này thực hiện việc UnPause agent, ipphone; tiếp tục nhận cuộc gọi
        /// </summary>
        /// <param name="ip_extension">ipphone</param>
        /// <param name="ip_agent">Agentcode =username</param>
        /// <returns></returns>
        public static CUnPauseQueueData unpause_agent_ipphone_2_queue(string ip_extension
                                                                      , string ip_agent)
        {
            string v_str_result        = "";
            string v_str_link_services = "";

            v_str_link_services = f002_main_form.m_str_web_service_url + WEB_URL_CALL_CENTER.UNPAUSE_AGENT(ip_extension, ip_agent);

            v_str_result = HelpUtils.get_content_from_weburl(v_str_link_services);

            CUnPauseQueue v_obj_infor = JsonConvert.DeserializeObject <CUnPauseQueue>(v_str_result);

            return(v_obj_infor.Action);
        }
コード例 #7
0
ファイル: CSocketServer.cs プロジェクト: anhphamkstn/DVMC3.0
        public static void StartListening()
        {
            IPAddress  ipAddress     = HelpUtils.get_current_ipaddress();
            IPEndPoint localEndPoint = new IPEndPoint(ipAddress, 11000);

            // Bind the socket to the local endpoint and listen for incoming connections.
            try
            {
                tcpListener  = new TcpListener(localEndPoint);
                listenThread = new Thread(new ThreadStart(ListenForClients));
                listenThread.Start();
            }
            catch (Exception v_e)
            {
                CSystemLog_301.ExceptionHandle(v_e);
            }
        }
コード例 #8
0
ファイル: CSocketServer.cs プロジェクト: anhphamkstn/DVMC3.0
        private static void HandleClientComm(object client)
        {
            TcpClient     tcpClient    = (TcpClient)client;
            NetworkStream clientStream = tcpClient.GetStream();

            byte[] message = new byte[4096];
            int    bytesRead;

            while (true)
            {
                bytesRead = 0;

                try
                {
                    //blocks until a client sends a message
                    bytesRead = clientStream.Read(message, 0, 4096);
                }
                catch
                {
                    //a socket error has occured
                    break;
                }

                if (bytesRead == 0)
                {
                    //the client has disconnected from the server
                    break;
                }

                //message has successfully been received
                ASCIIEncoding encoder        = new ASCIIEncoding();
                string        v_str_output   = encoder.GetString(message, 0, bytesRead);
                CallInfor     v_obj_callinfo = HelpUtils.get_start_callinfo_from_client_string_call(v_str_output);
                if (v_obj_callinfo.mobile_phone == "Anonymous")
                {
                    return;
                }
                open_form_sinh_vien_call(v_obj_callinfo);
                tcpClient.Close();
            }
        }
コード例 #9
0
        /// <summary>
        /// Hàm này thực hiện việc add or remove agent, ipphone khỏi queue
        /// </summary>
        /// <param name="ip_extension">Mã của IPPhone</param>
        /// <param name="ip_agent">Agencode; thường để là username</param>
        /// <param name="ip_kho_queue">Tên của Kho queue (tos_mb, tos_mn)</param>
        /// <param name="ip_code_add_or_remove">10: add; 20: remove</param>
        /// <returns></returns>
        public static CJoinRemoveQueueData add_or_remove_agent_ipphone_2_queue(string ip_extension
                                                                               , string ip_agent
                                                                               , string ip_kho_queue
                                                                               , int ip_code_add_or_remove)
        {
            string v_str_result        = "";
            string v_str_link_services = "";

            if (ip_code_add_or_remove == 10)
            {
                v_str_link_services = f002_main_form.m_str_web_service_url + WEB_URL_CALL_CENTER.ADD_VAO_QUEUE_GOI(ip_extension, ip_agent, ip_kho_queue);
            }
            else if (ip_code_add_or_remove == 20)
            {
                v_str_link_services = f002_main_form.m_str_web_service_url + WEB_URL_CALL_CENTER.REMOVE_KHOI_QUEUE_GOI(ip_extension, ip_agent, ip_kho_queue);
            }

            v_str_result = HelpUtils.get_content_from_weburl(v_str_link_services);

            CJoinRemoveQueue v_obj_infor = JsonConvert.DeserializeObject <CJoinRemoveQueue>(v_str_result);

            return(v_obj_infor.Action);
        }
コード例 #10
0
        /// <summary>
        /// Hàm này thực hiện việc add or remove agent, ipphone khỏi queue
        /// </summary>
        /// <param name="ip_extension">Mã của IPPhone</param>
        /// <param name="ip_agent">Agencode; thường để là username</param>
        /// <param name="ip_kho_queue">Tên của Kho queue (tos_mb, tos_mn)</param>
        /// <param name="ip_code_add_or_remove">10: add; 20: remove</param>
        /// <returns></returns>
        public static CJoinRemoveQueueData add_or_remove_agent_ipphone_2_queue(string ip_extension
                                                                               , string ip_agent
                                                                               , string ip_kho_queue
                                                                               , int ip_code_add_or_remove)
        {
            string v_str_result        = "";
            string v_str_link_services = "";

            if (ip_code_add_or_remove == 10)
            {
                v_str_link_services = "http://203.162.121.70:8080/TPCServer/tpc/DoAction.jsp?event=" + WEB_URL_CALL_CENTER.ADD_VAO_QUEUE_GOI(ip_extension, ip_agent, ip_kho_queue);
            }
            else if (ip_code_add_or_remove == 20)
            {
                v_str_link_services = "http://203.162.121.70:8080/TPCServer/tpc/DoAction.jsp?event=" + WEB_URL_CALL_CENTER.REMOVE_KHOI_QUEUE_GOI(ip_extension, ip_agent, ip_kho_queue);
            }

            v_str_result = HelpUtils.get_content_from_weburl(v_str_link_services);

            CJoinRemoveQueue v_obj_infor = JsonConvert.DeserializeObject <CJoinRemoveQueue>(v_str_result);

            return(v_obj_infor.Action);
        }