Well, according to the system logs, in my project, RequestInitiateTransfer and RequestCompleteTransfer has been sent twice. I solve the problem about RequestInitiateTransfer, but i still don't know why RequestCompleteTransfer has been sent twice.
When i debug my project, attacheddatachanged happened four times, the first time the calltype is CallTypeInBound, the second time is CallTypeConsult and meanwhile RequestCompleteTransfer has been sent the first time, the third time is as the first time, the four time is as the second time. So RequestCompleteTransfer do have been sent twice.
Who can tell me why attacheddatachanged happened four time and the last two times are as the previous two times?
The attacheddatachanged event is as follow
private void axTConnection1_TEventAttachedDataChanged(object sender, AxDesktopToolkitX._DConnectionEvents_TEventAttachedDataChangedEvent e)
{
String tempdata, tempflag;
if (e.eventInfo.ThisDN == "6900")
{
if (e.eventInfo.CallType == DesktopToolkitX.TCallType.CallTypeConsult)
{
tempdata = this.getAttachedData("tran", e);
if (tempdata == "agree")
{
this.insertAttachedData("trancallid", this.tempcallid);
this.doTrans("transComplete", "");
}
else if (tempdata == "disagree")
{
this.doReconnect();
MessageBox.Show("AttachedDataChanged tran disagree");
}
this.tSBinittrans.ToolTipText = "申请转接";
}
else if (e.eventInfo.CallType == DesktopToolkitX.TCallType.CallTypeInbound)
{
tempdata = this.getAttachedData("tran", e);
if (tempdata == "leavemeet")
{
this.doHangup();
this.tSBinittrans.ToolTipText = "申请转接";
}
}
}
//组长
else
{
if (e.eventInfo.CallType == DesktopToolkitX.TCallType.CallTypeConsult)
{
///转接
tempdata = this.getAttachedData("trancallid", e);
if (tempdata == "")
{
}
else if (tempdata == "userleave")
{
MessageBox.Show("用户挂机!");
}
else
{
}
}
}
}