~ubuntu-branches/debian/squeeze/openmcu/squeeze

« back to all changes in this revision

Viewing changes to mcu.cxx

  • Committer: Bazaar Package Importer
  • Author(s): Mark Purcell
  • Date: 2010-06-05 16:17:25 UTC
  • mto: This revision was merged to the branch mainline in revision 13.
  • Revision ID: james.westby@ubuntu.com-20100605161725-0ax79dwmz21wjpx6
Tags: upstream-2.2.5
ImportĀ upstreamĀ versionĀ 2.2.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
 *                 Craig Southeren (craig@postincrement.com)
31
31
 *
32
32
 * $Log: mcu.cxx,v $
 
33
 * Revision 1.5  2009/05/26 18:16:41  willamowius
 
34
 * updated for PTLib 3.6.x
 
35
 *
 
36
 * Revision 1.4  2008/05/23 11:18:17  willamowius
 
37
 * switch BOOL to PBoolean to be able to compile with Ptlib 2.2.x
 
38
 *
 
39
 * Revision 1.3  2008/02/19 06:36:11  shorne
 
40
 * Added ability to have 16CIF & 4CIF size video. Thx Marcos Jardini for the initial 4CIF patch
 
41
 *
 
42
 * Revision 1.2  2007/10/20 12:04:57  shorne
 
43
 * Fix small compile error with ptlib v1.12
 
44
 *
 
45
 * Revision 1.1  2007/10/17 19:44:31  shorne
 
46
 * Initial Commit
 
47
 *
 
48
 * Revision 2.2.2.1  2007/08/16 20:29:01  shorne
 
49
 * Better Gatekeeper anf Gateway prefix support
 
50
 *
 
51
 * Revision 2.3  2007/02/12 23:36:23  csoutheren
 
52
 * Applied 1636260 - OpenMCU patch to have return link in web UI
 
53
 * Thanks to RM Fleming
 
54
 *
33
55
 * Revision 2.2  2006/07/14 05:28:01  csoutheren
34
56
 * Removed old code
35
57
 *
88
110
 
89
111
#if OPENMCU_VIDEO
90
112
static const char ForceSplitVideoKey[]   = "Force split screen video";
 
113
static const char VideoSize[]                    = "Video Size";
91
114
#endif
92
115
 
93
116
#define new PNEW
97
120
 
98
121
class MainStatusPage : public PServiceHTTPString
99
122
{
100
 
  PCLASSINFO(MainStatusPage, PServiceHTTPString);
 
123
 // PCLASSINFO(MainStatusPage, PServiceHTTPString);
101
124
 
102
125
  public:
103
126
    MainStatusPage(OpenMCU & app, PHTTPAuthority & auth);
104
127
    
105
 
    virtual BOOL Post(
 
128
    virtual PBoolean Post(
106
129
      PHTTPRequest & request,
107
130
      const PStringToString &,
108
131
      PHTML & msg
114
137
 
115
138
class InvitePage : public PServiceHTTPString
116
139
{
117
 
  PCLASSINFO(InvitePage, PServiceHTTPString);
 
140
 // PCLASSINFO(InvitePage, PServiceHTTPString);
118
141
 
119
142
  public:
120
143
    InvitePage(OpenMCU & app, PHTTPAuthority & auth);
121
144
 
122
 
    virtual BOOL Post(
 
145
    virtual PBoolean Post(
123
146
      PHTTPRequest & request,       // Information on this request.
124
147
      const PStringToString & data, // Variables in the POST data.
125
148
      PHTML & replyMessage          // Reply message for post.
130
153
};
131
154
 
132
155
///////////////////////////////////////////////////////////////
 
156
// This really isn't the default count only a counter
 
157
// for sending aliases and prefixes to the gatekeeper
 
158
int OpenMCU::defaultRoomCount = 5;
133
159
 
134
160
OpenMCU::OpenMCU()
135
161
  : OpenMCUProcessAncestor(ProductInfo)
136
162
{
137
163
  endpoint = NULL;
 
164
 
 
165
#if OPENMCU_VIDEO
 
166
  frameSize = H323Capability::cifMPI;
 
167
#endif
138
168
}
139
169
 
140
170
void OpenMCU::Main()
142
172
  Suspend();
143
173
}
144
174
 
145
 
BOOL OpenMCU::OnStart()
 
175
PBoolean OpenMCU::OnStart()
146
176
{
147
177
  // change to the default directory to the one containing the executable
148
178
  PDirectory exeDir = GetFile().GetDirectory();
193
223
  PURL::OpenBrowser(url);
194
224
}
195
225
 
196
 
BOOL OpenMCU::Initialise(const char * initMsg)
 
226
PBoolean OpenMCU::Initialise(const char * initMsg)
197
227
{
198
228
  PConfig cfg("Parameters");
199
229
 
200
230
  // Set log level as early as possible
201
 
  SetLogLevel((PSystemLog::Level)cfg.GetInteger(LogLevelKey, GetLogLevel()));
 
231
//  SetLogLevel((PSystemLog::Level)cfg.GetInteger(LogLevelKey, GetLogLevel()));
202
232
#if PTRACING
203
 
  if (GetLogLevel() >= PSystemLog::Warning)
 
233
 
 
234
    SetLogLevel(PSystemLog::Debug6);
 
235
    PTrace::Initialise(6,"c:\\trace.txt");
 
236
 
 
237
/*  if (GetLogLevel() >= PSystemLog::Warning)
204
238
    PTrace::SetLevel(GetLogLevel()-PSystemLog::Warning);
205
239
  else
206
240
    PTrace::SetLevel(0);
207
241
  PTrace::ClearOptions(PTrace::Timestamp);
208
 
  PTrace::SetOptions(PTrace::DateAndTime);
 
242
  PTrace::SetOptions(PTrace::DateAndTime); */
209
243
#endif
210
244
 
211
245
  // Get the HTTP basic authentication info
258
292
  rsrc->Add(new PHTTPStringField(CallLogFilenameKey, 50, logFilename));
259
293
 
260
294
#if OPENMCU_VIDEO
 
295
//  frameSize = (H323Capability::CapabilityFrameSize)cfg.GetInteger(VideoSize,H323Capability::cifMPI);
 
296
//  rsrc->Add(new PHTTPStringField(VideoSize,frameSize));
261
297
  forceScreenSplit = cfg.GetBoolean(ForceSplitVideoKey, FALSE);
262
298
  rsrc->Add(new PHTTPBooleanField(ForceSplitVideoKey, forceScreenSplit));
263
299
#endif
338
374
 
339
375
PString OpenMCU::GetNewRoomNumber()
340
376
{
341
 
  static PAtomicInteger number = 100;
 
377
  static PAtomicInteger number(100);
342
378
  return PString(PString::Unsigned, ++number);
343
379
}
344
380
 
368
404
 
369
405
OpenMCUH323EndPoint * OpenMCU::CreateEndPoint(ConferenceManager & manager)
370
406
{
371
 
  return new OpenMCUH323EndPoint(manager);
 
407
  return new OpenMCUH323EndPoint(manager,frameSize);
372
408
}
373
409
 
374
410
//////////////////////////////////////////////////////////////////////////////////////////////
423
459
}
424
460
 
425
461
 
426
 
BOOL MainStatusPage::Post(PHTTPRequest & request,
 
462
PBoolean MainStatusPage::Post(PHTTPRequest & request,
427
463
                          const PStringToString & data,
428
464
                          PHTML & msg)
429
465
{
491
527
}
492
528
 
493
529
 
494
 
BOOL InvitePage::Post(PHTTPRequest & request,
 
530
PBoolean InvitePage::Post(PHTTPRequest & request,
495
531
                          const PStringToString & data,
496
532
                          PHTML & msg)
497
533
{
505
541
  }
506
542
 
507
543
  OpenMCUH323EndPoint & ep = app.GetEndpoint();
508
 
  BOOL created = ep.OutgoingConferenceRequest(room);
 
544
  PBoolean created = ep.OutgoingConferenceRequest(room);
509
545
 
510
546
  if (!created) {
511
547
    msg << PHTML::Title() << "Invite failed" << PHTML::Body()