private void btnOK_Click(object sender, EventArgs e)
        {
            if (!CheckExtNo())
            {
                return;
            }
            string transfer_num  = rbExt.Checked ? txtTransferExtNo.Text.Trim() : e0571.web.core.Utils.TypeConverter.ChangeString((cbTransferQueues.SelectedItem as ListItem).Value);
            string urlToTransfer = TheMotherWin.getIPCCInterface4EComm("transfer", new Dictionary <string, string> {
                { "ext_no", EnvironmentVar.ExtCode }, { "transfer_num", transfer_num }
            });

            HttpAdapter.getAsyncTo(urlToTransfer, (result0, response0) =>
            {
                Console.WriteLine(string.Format("################### transfer {0}:{1}", transfer_num, result0));
                if (result0 == "+OK")
                {
                    BeginInvoke(new Action(() =>
                    {
                        this.Close();
                    }));
                }
                else
                {
                    MessageBoxAdapter.ShowDebug(result0);
                }
            });
        }
        private void btnManager_Connect_Click(object sender, EventArgs e)
        {
            string    ip       = "192.168.1.18";
            string    login    = "******";
            string    pwd      = "";
            string    ext      = "714001";
            string    queueStr = "71410,71411,71412,71413";
            MgrResult ret      = MgrAPIWrapper.Manager_Connect(ip, login, pwd, ext, queueStr);

            if (ret == MgrResult.ok)
            {
                MessageBoxAdapter.ShowDebug("connect ok");
            }
            else
            {
                MessageBoxAdapter.ShowDebug("connect " + ret.ToString());
            }

            string[] queues = queueStr.Split(",".ToCharArray());
            foreach (var queue in queues)
            {
                MgrResult ret00 = MgrAPIWrapper.Manager_QueueAdd(ext, queue, "1003", "1003", 0);
                if (ret00 == MgrResult.ok)
                {
                    MgrResult ret01 = MgrAPIWrapper.Manager_QueuePause(ext, queue, "1003", "1003", 0);

                    if (ret01 == MgrResult.ok)
                    {
                    }
                }
            }
        }
        private void frmTestTC_IPCC_Load(object sender, EventArgs e)
        {
            #region  制厂商SDK
            bool   isSDKOK     = false;
            string msg         = "";
            string path        = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
            string sourceOfSDK = Path.Combine(path, @"TC-IPCC");;
            try
            {
                isSDKOK = FileAdapter.CopyDir(sourceOfSDK, path, true);
                if (!isSDKOK)
                {
                    msg = "无法加载厂商SDK";
                }
            }
            catch (Exception ex)
            {
                isSDKOK = false;
                msg     = ex.Message;
            }
            finally
            {
                if (!isSDKOK)
                {
                    gbInit.Enabled = gbMonitor.Enabled = gbCore.Enabled = gbConf.Enabled = gbSMS.Enabled = isSDKOK;
                    MessageBoxAdapter.ShowDebug(msg);
                }
            }

            #endregion
        }
        private void btnSetEventCallback_Click(object sender, EventArgs e)
        {
            //MgrAPIWrapper.SetEventCallback(Callback);//自动释放

            myCallBack = new EventCallbackDelegate(Callback); //修改后
            EnumWindows(myCallBack, 0);
            MgrAPIWrapper.SetEventCallback(myCallBack);

            MessageBoxAdapter.ShowDebug("SetEventCallback ok");
        }
示例#5
0
        private void cmenuitemUnDeaf_Click(object sender, EventArgs e)
        {
            ListBoxItem item = lbConferenceMember.SelectedItem as ListBoxItem;

            if (item == null)
            {
                MessageBoxAdapter.ShowDebug("请确保选中要取消静音的号码!");
                return;
            }
            TheMotherWin._ControlConferenceMember("undeaf", item.Value);
        }
        private void btnManager_Disconnect_Click(object sender, EventArgs e)
        {
            bool ret = MgrAPIWrapper.Manager_Disconnect();

            if (ret)
            {
                MessageBoxAdapter.ShowDebug("disconnect ok");
            }
            else
            {
                MessageBoxAdapter.ShowDebug("disconnect error");
            }
        }
        private void btnManager_CloseMonitor_Click(object sender, EventArgs e)
        {
            bool ret = MgrAPIWrapper.Manager_CloseMonitor(MonitorId);

            if (ret)
            {
                MessageBoxAdapter.ShowDebug("CloseMonitor ok");
            }
            else
            {
                MessageBoxAdapter.ShowDebug("CloseMonitor error");
            }
        }
        private void btnManager_OpenMonitor_Click(object sender, EventArgs e)
        {
            string dn  = "DAHDI/1";
            string ext = "714001";
            int    ret = MgrAPIWrapper.Manager_OpenMonitor(dn, ext);

            if (ret == 1)
            {
                MessageBoxAdapter.ShowDebug("OpenMonitor ok");
            }
            else
            {
                MessageBoxAdapter.ShowDebug("OpenMonitor " + ret.ToString());
            }
        }
        private void btnManager_MakeCall_Click(object sender, EventArgs e)
        {
            string    from         = "5501";
            string    to           = "18668001381";
            string    context      = "DAHDI/1";
            string    calledIdName = "18668001381";
            MgrResult ret          = MgrAPIWrapper.Manager_MakeCall(from, to, context, calledIdName);

            if (ret == MgrResult.ok)
            {
                MessageBoxAdapter.ShowDebug("MakeCall ok");
            }
            else
            {
                MessageBoxAdapter.ShowDebug("MakeCall " + ret.ToString());
            }
        }
        private void btnManager_CreatConf_Click(object sender, EventArgs e)
        {
            //创建会议
            int    callId       = 0;
            string inviter      = "";         //邀请亲人的号码
            string caller       = "28937860"; //老人号码
            string callee       = "714001";   //坐席号码
            string confnum      = "8714001";  //坐席号码前面+8
            string dial_inviter = "";
            //string dial_inviter = "DAHDI/1";//内线
            MgrResult ret = MgrAPIWrapper.Manager_CreatConf(callId, inviter, caller, callee, confnum, dial_inviter);

            if (ret == MgrResult.ok)
            {
                MessageBoxAdapter.ShowDebug("connect ok");
            }
            else
            {
                MessageBoxAdapter.ShowDebug("connect " + ret.ToString());
            }
        }