summaryrefslogtreecommitdiff
path: root/orkbasecxx/messages/TapeMsg.cpp
blob: 142e67bf8beedff064ef3b63a8b791ce2e7255bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
/*
 * Oreka -- A media capture and retrieval platform
 * 
 * Copyright (C) 2005, orecx LLC
 *
 * http://www.orecx.com
 *
 * This program is free software, distributed under the terms of
 * the GNU General Public License.
 * Please refer to http://www.gnu.org/copyleft/gpl.html
 *
 */
#pragma warning( disable: 4786 ) // disables truncated symbols in browse-info warning

#define _WINSOCKAPI_		// prevents the inclusion of winsock.h

#include "Utils.h"
#include "TapeMsg.h"
#include "ConfigManager.h"

TapeMsg::TapeMsg()
{
	// Here is where default values are set
	m_timestamp = 0;
	m_direction = CaptureEvent::DirectionToString(CaptureEvent::DirUnkn);
	m_duration = 0;
	m_serviceName = CONFIG.m_serviceName;
}

void TapeMsg::Define(Serializer* s)
{
	CStdString tapeMessageName(TAPE_MESSAGE_NAME);
	s->StringValue(OBJECT_TYPE_TAG, tapeMessageName, true);
	s->StringValue(REC_ID_PARAM, m_recId, true);
	s->StringValue(STAGE_PARAM, m_stage, true);
	s->StringValue(CAPTURE_PORT_PARAM, m_capturePort, true);
	s->IntValue(TIMESTAMP_PARAM, (int&)m_timestamp, true);
	s->StringValue(FILENAME_PARAM, m_fileName, true);
	s->StringValue(LOCALPARTY_PARAM, m_localParty);
	s->StringValue(LOCALENTRYPOINT_PARAM, m_localEntryPoint);
	s->StringValue(REMOTEPARTY_PARAM, m_remoteParty);
	s->StringValue(DIRECTION_PARAM, m_direction);
	s->IntValue(DURATION_PARAM, m_duration);
	s->StringValue(SERVICE_PARAM, m_serviceName);

	s->StringValue(LOCAL_IP_PARAM, m_localIp);
	s->StringValue(REMOTE_IP_PARAM, m_remoteIp);
	//s->StringValue(LOCAL_MAC_PARAM, m_localMac);
	//s->StringValue(REMOTE_MAC_PARAM, m_remoteMac);
	s->StringValue(NATIVE_CALLID_PARAM, m_nativeCallId);

	s->CsvMapValue(TAGS_PARAM, m_tags);
	s->BoolValue(ON_DEMAND_PARAM, m_onDemand);

	DefineMessage(s);
}

void TapeMsg::Validate()
{
}

CStdString TapeMsg::GetClassName()
{
	return CStdString(TAPE_MESSAGE_NAME);
}

ObjectRef TapeMsg::NewInstance()
{
	return ObjectRef(new TapeMsg);
}

ObjectRef TapeMsg::Process()
{
	return ObjectRef();
}

//==========================================================
TapeResponse::TapeResponse()
{
	m_deleteTape = false;
}


void TapeResponse::Define(Serializer* s)
{
	SimpleResponseMsg::Define(s);
	s->BoolValue("deletetape", m_deleteTape);
}

CStdString TapeResponse::GetClassName()
{
	return CStdString("taperesponse");
}

ObjectRef TapeResponse::NewInstance()
{
	return ObjectRef(new TapeResponse);
}

//====================================================================
//TapeResponseFwd::TapeResponseFwd()
//{
//	m_boolean2 = false;
//}
//
//
//void TapeResponseFwd::Define(Serializer* s)
//{	
//	TapeResponse::Define(s);
//	s->BoolValue("boolean2", m_boolean2);
//}
//
//ObjectRef TapeResponseFwd::NewInstance()
//{
//	return ObjectRef(new TapeResponseFwd);
//}

//====================================================================
TapeTagMsg::TapeTagMsg()
{
	// Here is where default values are set
}

void TapeTagMsg::Define(Serializer* s)
{
	CStdString tapeMessageName("tapetagmsg");
	s->StringValue(OBJECT_TYPE_TAG, tapeMessageName, true);
	DefineMessage(s);
}

void TapeTagMsg::Validate()
{
}

CStdString TapeTagMsg::GetClassName()
{
	return CStdString("tapetagmsg");
}

ObjectRef TapeTagMsg::NewInstance()
{
	return ObjectRef(new TapeTagMsg);
}