struct mcsEvent4Device_t{
char device[64];
int type;
int state;
int param;
};
struct mcsEvent4Agent_t{
int state;
char agent[64];
char device;//LoginDevice OR Queue
int param;//Reason
};
struct mcsEventServiceInitiated_t{
char station[64];
char callid[32];
};
struct mcsEventOrignated_t{
char alerting[64];
char caller[64];
char calling[64];
char calleed[64];
char callid[32];
};
struct mcsEventDelivered_t{
char alerting[64];
char caller[64];
char router[64];
char calling[64];
char calleed[64];
char callid[32];
};
struct mcsEventConnectionClear_t{
char dropDevice[64];
char callid[32];
int reason;
};
struct mcsEventCallClear_t{
char callid[32];
int reason;
};
struct mcsEventCallActive_t{
char callid[32];
char actionDevice[64];
char heldDevice[64];
char calling[64];
char calleed[64];
};
struct mcsEventCallHeld_t{
char callid[32];
char actionDevice[64];
char heldDevice[64];
char calling[64];
char calleed[64];
};
struct mcsEventCallTransfered_t{
char newcall[32];
char actionDevice[64];
char heldcall[32];
char heldDevice[64];
char activecall[32];
char activeDevice[64];
char calling[64];
char calleed[64];
};
struct mcsEventCallEstanblished_t{
char callid[32];
char firstDevice[64];
char secondDevice[64];
char calling[64];
char calleed[64];
};
struct mcsEvent4Call_t{
int code;
union{
mcsEventServiceInitiated_t serviceInitiated;
mcsEventOrignated_t orignated;
mcsEventDelivered_t delivered;
mcsEventConnectionClear_t connClear;
mcsEventCallClear_t callClear;
mcsEventCallActive_t callActive;
mcsEventCallTransfered_t callTransfered;
mcsEventCallHeld_t callHeld;
mcsEventCallEstanblished_t callEstanb;
}u;};
struct mcsEvent4Media_t{
};
struct mcsEvent_t{
int code;
char timestamp[64];
union{
mcsEvent4Device_t deviceEvt;
mcsEvent4Agent_t agentEvt;
mcsEvent4Call_t callEvt;
mcsEvent4Media_t mediaEvt;
}u;
};extern "C" __declspec(dllexport) int mcsGetEvent(mcsEvent_t &event);
请问在C#中如何调用mcsGetEvent这个函数
char device[64];
int type;
int state;
int param;
};
struct mcsEvent4Agent_t{
int state;
char agent[64];
char device;//LoginDevice OR Queue
int param;//Reason
};
struct mcsEventServiceInitiated_t{
char station[64];
char callid[32];
};
struct mcsEventOrignated_t{
char alerting[64];
char caller[64];
char calling[64];
char calleed[64];
char callid[32];
};
struct mcsEventDelivered_t{
char alerting[64];
char caller[64];
char router[64];
char calling[64];
char calleed[64];
char callid[32];
};
struct mcsEventConnectionClear_t{
char dropDevice[64];
char callid[32];
int reason;
};
struct mcsEventCallClear_t{
char callid[32];
int reason;
};
struct mcsEventCallActive_t{
char callid[32];
char actionDevice[64];
char heldDevice[64];
char calling[64];
char calleed[64];
};
struct mcsEventCallHeld_t{
char callid[32];
char actionDevice[64];
char heldDevice[64];
char calling[64];
char calleed[64];
};
struct mcsEventCallTransfered_t{
char newcall[32];
char actionDevice[64];
char heldcall[32];
char heldDevice[64];
char activecall[32];
char activeDevice[64];
char calling[64];
char calleed[64];
};
struct mcsEventCallEstanblished_t{
char callid[32];
char firstDevice[64];
char secondDevice[64];
char calling[64];
char calleed[64];
};
struct mcsEvent4Call_t{
int code;
union{
mcsEventServiceInitiated_t serviceInitiated;
mcsEventOrignated_t orignated;
mcsEventDelivered_t delivered;
mcsEventConnectionClear_t connClear;
mcsEventCallClear_t callClear;
mcsEventCallActive_t callActive;
mcsEventCallTransfered_t callTransfered;
mcsEventCallHeld_t callHeld;
mcsEventCallEstanblished_t callEstanb;
}u;};
struct mcsEvent4Media_t{
};
struct mcsEvent_t{
int code;
char timestamp[64];
union{
mcsEvent4Device_t deviceEvt;
mcsEvent4Agent_t agentEvt;
mcsEvent4Call_t callEvt;
mcsEvent4Media_t mediaEvt;
}u;
};extern "C" __declspec(dllexport) int mcsGetEvent(mcsEvent_t &event);
请问在C#中如何调用mcsGetEvent这个函数
private static extern int mcsGetEvent(mcsEvent_t &event);
用C++/CLI封装一下接口
DllImport导入DLL文件参考
参考
参考
该书的官方网站:
www.interop123.com 豆瓣网信息:
http://www.douban.com/subject/3671497/