#ifndef _SIP_STRUCT__H
#define _SIP_STRUCT__H

#include "sip_pub.h"
#include "sip.h"
#include "sip_const.h"

// Internal type for parser's config
typedef struct _SIP_HDR_CONFIG
{
 	char *hname;
 	int	 (*setheader)(SIP_API_STRUCT *, char *);
}SIP_HDR_CONFIG;

typedef struct _SIP_USER_STRUCT
{
	BYTE		flag;
	SIP_USER	sipUser;
}SIP_USER_STRUCT;

typedef struct _SIP_USERS_STRUCT
{
	BYTE			proxyIndex;
	SIP_USER_STRUCT	sipUsers[SIP_MAX_NUM_OF_USERS];
}SIP_USERS_STRUCT;

typedef struct _SIP_TRANS_SD_MSG
{
    SIP_TRANSPORT_ADDR	sipSdAddr;
    BYTE sdMsg[SIP_MAX_UDP_MSG_LEN];
}SIP_TRANS_SD_MSG;

typedef struct _SIP_TRANSACTION
{
	BYTE			flag;
	BYTE			userIndex;
	BYTE			tcpSockIndex;
	BYTE			client;
	BYTE			method;
	BYTE			mainState;
	BYTE			state;
	WORD			upPort;
	WORD			rvCmd;
	WORD			sdCmd;
	DWORD			timer;
	DWORD			timer2;
	BYTE			retransTimes;

	SIP_CR_MSG      crMsg;
//	SIP_API_STRUCT	sdMsg;
	
       SIP_TRANS_SD_MSG   transSdMsg;
}SIP_TRANSACTION;

typedef struct _SIP_TCP_SOCK
{
	BYTE			flag;
	int				sendRecvSock;
	struct sockaddr_in           remoteAddr;
}SIP_TCP_SOCK;

#endif
