www.pudn.com > dialogic_IVR.rar > CallQueue.h


// CallQueue.h: interface for the CCallQueue class. 
// 
////////////////////////////////////////////////////////////////////// 
 
#if !defined(AFX_CALLQUEUE_H__AA971F99_AABF_4EBD_8C1D_6CC262DE6110__INCLUDED_) 
#define AFX_CALLQUEUE_H__AA971F99_AABF_4EBD_8C1D_6CC262DE6110__INCLUDED_ 
 
#if _MSC_VER > 1000 
#pragma once 
#endif // _MSC_VER > 1000 
#include "apiuse.h" 
#include "criticalresource.h" 
 
 
//呼叫控制块 
typedef struct tag_CallQueue { 
	  
	 
	 UCHAR sender_node; //发送方节点号 
	 UCHAR sender_port; //发送方端口号 
     UCHAR receiver_node; //接收方节点号 
	 UCHAR receiver_port; //接收方端口号如IVR的PORT号为4等 
	//以下四个为呼叫控制块,唯一标识一个呼叫 
	 UCHAR sender_handle;// 发送方句柄 
     USHORT sender_dsn;// 发送方Dsn 
     UCHAR receiver_handle; // 接收方方句柄 
     USHORT receiver_dsn; // 接收方Dsn 
	 USHORT trunk_dsn;//中继通道号 
     CALLID callID;                 //呼叫标识 
	 UCHAR  CLI[13];             //主叫 
	 UCHAR  CLD[13];             //被叫 
}CallQueue,*LPCallQueue; 
 
//对外消息体 
enum CallType { 
	CALLIN = 0,       //呼入  
	CALLOUT,          //呼出 
    TRANSFER,         //呼叫转移  
	DISCONNECT,       //挂机 
	UNKNOWMSG,          //其他消息 
}; 
 
typedef struct tag_OutMsg { 
	int nTrunk;        //中继号 
	char Caller[20];   //主叫 
	char Called[20];    //被叫 
	CallType calltype;  //消息类型  
	BOOL bSuccess;       //消息调用成功标识 
 
}OutMsg, *LPOutMsg; 
class CCallQueue   
{ 
 
public: 
	LPCallQueue FindByTrunk(int nTrunk); 
	LPOutMsg getMsg(); 
	int AddMsg(LPOutMsg pMsg); 
	LPCallQueue FindByMsgHead(LPCMessageHead pHead); 
	int  Create(char *szQueueName); 
	int ClearAll(); 
	int AddCallQueue(LPCallQueue pCallQueue); 
	int RemoveCallQueue(LPCallQueue pCallQueue); 
	CPtrList m_ptrCallList; 
	CPtrList m_MsgList;       //存放呼叫信息 
	CCriticalResource m_Lock; 
	CCallQueue(); 
	virtual ~CCallQueue(); 
 
}; 
 
#endif // !defined(AFX_CALLQUEUE_H__AA971F99_AABF_4EBD_8C1D_6CC262DE6110__INCLUDED_)