31 #ifndef OPAL_OPAL_CONSOLE_MGR_H
32 #define OPAL_OPAL_CONSOLE_MGR_H
49 #include <ptclib/cli.h>
56 #define OPAL_CONSOLE_PREFIXES OPAL_PREFIX_SIP " " \
57 OPAL_PREFIX_H323 " " \
58 OPAL_PREFIX_SKINNY" " \
59 OPAL_PREFIX_PSTN " " \
81 virtual bool Initialise(PArgList & args,
bool verbose,
const PString & defaultRoute) = 0;
83 virtual void AddCommands(PCLI & cli) = 0;
91 #if OPAL_SIP || OPAL_H323
100 bool Initialise(PArgList & args, ostream & output,
bool verbose);
108 void AddCommands(PCLI & cli);
111 bool SetUIMode(
const PCaselessString & str);
116 #endif // OPAL_SIP || OPAL_H323
127 virtual bool Initialise(PArgList & args,
bool verbose,
const PString & defaultRoute);
132 virtual void AddCommands(PCLI & cli);
140 const PArgList & args,
157 virtual bool Initialise(PArgList & args,
bool verbose,
const PString & defaultRoute);
164 virtual void AddCommands(PCLI & cli);
168 bool UseGatekeeperFromArgs(
const PArgList & args,
const char * host,
const char * ident,
const char * pass,
const char * inter);
176 PCLASSINFO(OpalConsoleSkinnyEndPoint, OpalSkinnyEndPoint)
180 virtual
void GetArgumentSpec(ostream & strm) const;
181 virtual
bool Initialise(PArgList & args,
bool verbose, const PString & defaultRoute);
184 PDECLARE_NOTIFIER(PCLI::Arguments, OpalConsoleSkinnyEndPoint, CmdRegister);
185 PDECLARE_NOTIFIER(PCLI::Arguments, OpalConsoleSkinnyEndPoint, CmdStatus);
186 virtual void AddCommands(PCLI & cli);
189 #endif // OPAL_SKINNY
200 virtual bool Initialise(PArgList & args,
bool verbose,
const PString & defaultRoute);
204 virtual void AddCommands(PCLI & cli);
213 PCLASSINFO(OpalConsoleCapiEndPoint, OpalCapiEndPoint)
217 virtual
void GetArgumentSpec(ostream & strm) const;
218 virtual
bool Initialise(PArgList & args,
bool verbose, const PString & defaultRoute);
221 virtual void AddCommands(PCLI & cli);
235 virtual bool Initialise(PArgList & args,
bool verbose,
const PString &);
250 bool SetPresentationVideoDevice(
const PVideoDevice::OpenArgs & args) {
return manager.
SetVideoInputDevice(args, OpalVideoFormat::ePresentation); }
251 const PVideoDevice::OpenArgs & GetPresentationVideoDevice()
const {
return manager.
GetVideoInputDevice(OpalVideoFormat::ePresentation); }
252 bool SetPresentationPreviewDevice(
const PVideoDevice::OpenArgs & args) {
return manager.
SetVideoPreviewDevice(args, OpalVideoFormat::ePresentation); }
253 const PVideoDevice::OpenArgs & GetPresentationPreviewDevice()
const {
return manager.
GetVideoPreviewDevice(OpalVideoFormat::ePresentation); }
254 bool SetPresentationOutputDevice(
const PVideoDevice::OpenArgs & args) {
return manager.
SetVideoOutputDevice(args, OpalVideoFormat::ePresentation); }
255 const PVideoDevice::OpenArgs & GetPresentationOutputDevice()
const {
return manager.
GetVideoOutputDevice(OpalVideoFormat::ePresentation); }
256 bool SetSpeakerVideoDevice(
const PVideoDevice::OpenArgs & args) {
return manager.
SetVideoInputDevice(args, OpalVideoFormat::eSpeaker); }
257 const PVideoDevice::OpenArgs & GetSpeakerVideoDevice()
const {
return manager.
GetVideoInputDevice(OpalVideoFormat::eSpeaker); }
258 bool SetSpeakerPreviewDevice(
const PVideoDevice::OpenArgs & args) {
return manager.
SetVideoPreviewDevice(args, OpalVideoFormat::eSpeaker); }
259 const PVideoDevice::OpenArgs & GetSpeakerPreviewDevice()
const {
return manager.
GetVideoPreviewDevice(OpalVideoFormat::eSpeaker); }
260 bool SetSpeakerOutputDevice(
const PVideoDevice::OpenArgs & args) {
return manager.
SetVideoOutputDevice(args, OpalVideoFormat::eSpeaker); }
261 const PVideoDevice::OpenArgs & GetSpeakerOutputDevice()
const {
return manager.
GetVideoOutputDevice(OpalVideoFormat::eSpeaker); }
262 bool SetSignVideoDevice(
const PVideoDevice::OpenArgs & args) {
return manager.
SetVideoInputDevice(args, OpalVideoFormat::eSignLanguage); }
263 const PVideoDevice::OpenArgs & GetSignVideoDevice()
const {
return manager.
GetVideoInputDevice(OpalVideoFormat::eSignLanguage); }
264 bool SetSignPreviewDevice(
const PVideoDevice::OpenArgs & args) {
return manager.
SetVideoPreviewDevice(args, OpalVideoFormat::eSignLanguage); }
265 const PVideoDevice::OpenArgs & GetSignPreviewDevice()
const {
return manager.
GetVideoPreviewDevice(OpalVideoFormat::eSignLanguage); }
266 bool SetSignOutputDevice(
const PVideoDevice::OpenArgs & args) {
return manager.
SetVideoOutputDevice(args, OpalVideoFormat::eSignLanguage); }
267 const PVideoDevice::OpenArgs & GetSignOutputDevice()
const {
return manager.
GetVideoOutputDevice(OpalVideoFormat::eSignLanguage); }
274 virtual void AddCommands(PCLI & cli);
277 void SetRingInfo(ostream & out,
bool verbose,
const PString & filename,
const PString & device,
const PString & driver);
298 #endif // OPAL_HAS_PCSS
309 virtual bool Initialise(PArgList & args,
bool,
const PString &);
312 virtual void AddCommands(PCLI &);
326 virtual bool Initialise(PArgList & args,
bool,
const PString &);
329 virtual void AddCommands(PCLI &);
332 #endif // OPAL_HAS_MIXER
351 virtual void Usage(ostream & strm,
const PArgList & args);
357 bool verbose =
false,
358 const PString & defaultRoute = PString::Empty()
361 virtual void EndRun(
bool interrupt =
false);
362 virtual void Broadcast(
const PString & msg);
392 bool GetCallFromArgs(PCLI::Arguments & args, PSafePtr<OpalCall> & call)
const;
396 PSafePtr<OpalCall> call;
400 if ((connection = call->GetConnectionAs<CONTYPE>(0)) != NULL)
403 args.WriteError(
"Not a suitable call for operation.");
408 PCLI::Arguments & args,
411 PSafePtr<OpalMediaStream> & stream
424 virtual OpalConsoleSkinnyEndPoint * CreateSkinnyEndPoint();
430 virtual OpalConsoleCapiEndPoint * CreateCapiEndPoint();
454 typedef map<PString, OpalMediaStatistics>
StatsMap;
489 const PString & defaultRoute = PString::Empty()
492 virtual void EndRun(
bool interrupt);
493 virtual void Broadcast(
const PString & msg);
496 PCLI * CreateCLIStandard();
498 PCLITelnet * CreateCLITelnet(WORD port);
501 PCLICurses * CreateCLICurses();
552 template <
class Manager,
557 PProcess::CodeStatus Status = PProcess::ReleaseCode,
565 : PProcess(Manuf, Name, MajorVersion, MinorVersion, Status, BuildNumber)
572 delete this->m_manager;
577 this->SetTerminationValue(1);
578 this->m_manager =
new Manager;
579 if (this->m_manager->Initialise(this->GetArguments(), Verbose)) {
580 this->SetTerminationValue(0);
581 this->m_manager->Run();
587 if (this->m_manager == NULL)
590 this->m_manager->EndRun(
true);
599 #endif // OPAL_OPAL_CONSOLE_MGR_H