2006-09-19 19:04:13 +00:00
|
|
|
#ifndef COMPAT_H323_H
|
|
|
|
#define COMPAT_H323_H
|
|
|
|
|
|
|
|
#if VERSION(OPENH323_MAJOR,OPENH323_MINOR,OPENH323_BUILD) < VERSION(1,17,3)
|
|
|
|
/**
|
|
|
|
* Workaround for broken (less than 1.17.3) OpenH323 stack to be able to
|
|
|
|
* make TCP connections from specific address
|
|
|
|
*/
|
|
|
|
class MyH323TransportTCP : public H323TransportTCP
|
|
|
|
{
|
|
|
|
PCLASSINFO(MyH323TransportTCP, H323TransportTCP);
|
|
|
|
|
|
|
|
public:
|
|
|
|
MyH323TransportTCP(
|
|
|
|
H323EndPoint & endpoint, ///< H323 End Point object
|
|
|
|
PIPSocket::Address binding = PIPSocket::GetDefaultIpAny(), ///< Local interface to use
|
2009-02-18 20:11:57 +00:00
|
|
|
PBoolean listen = FALSE ///< Flag for need to wait for remote to connect
|
2006-09-19 19:04:13 +00:00
|
|
|
);
|
|
|
|
/**Connect to the remote party.
|
|
|
|
*/
|
2009-02-18 20:11:57 +00:00
|
|
|
virtual PBoolean Connect();
|
2006-09-19 19:04:13 +00:00
|
|
|
};
|
|
|
|
#else
|
|
|
|
#define MyH323TransportTCP H323TransportTCP
|
|
|
|
#endif /* <VERSION(1,17,3) */
|
|
|
|
|
|
|
|
class MyH323TransportUDP: public H323TransportUDP
|
|
|
|
{
|
|
|
|
PCLASSINFO(MyH323TransportUDP, H323TransportUDP);
|
|
|
|
|
|
|
|
public:
|
|
|
|
MyH323TransportUDP(H323EndPoint &endpoint,
|
|
|
|
PIPSocket::Address binding = PIPSocket::GetDefaultIpAny(),
|
|
|
|
WORD localPort = 0,
|
|
|
|
WORD remotePort = 0): H323TransportUDP(endpoint, binding, localPort, remotePort)
|
|
|
|
{
|
|
|
|
}
|
2009-02-18 20:11:57 +00:00
|
|
|
virtual PBoolean DiscoverGatekeeper(H323Gatekeeper &,
|
2006-09-19 19:04:13 +00:00
|
|
|
H323RasPDU &,
|
|
|
|
const H323TransportAddress &);
|
|
|
|
protected:
|
|
|
|
PDECLARE_NOTIFIER(PThread, MyH323TransportUDP, DiscoverMain);
|
|
|
|
H323Gatekeeper *discoverGatekeeper;
|
|
|
|
H323RasPDU *discoverPDU;
|
|
|
|
const H323TransportAddress *discoverAddress;
|
2009-02-18 20:11:57 +00:00
|
|
|
PBoolean discoverResult;
|
|
|
|
PBoolean discoverReady;
|
2006-09-19 19:04:13 +00:00
|
|
|
PMutex discoverMutex;
|
|
|
|
};
|
|
|
|
|
|
|
|
template <class _Abstract_T, typename _Key_T = PString>
|
|
|
|
class MyPFactory: public PFactory<_Abstract_T, _Key_T>
|
|
|
|
{
|
|
|
|
public:
|
2006-09-22 19:54:20 +00:00
|
|
|
template <class _Concrete_T> class Worker: public PFactory<_Abstract_T, _Key_T>::WorkerBase
|
2006-09-19 19:04:13 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
Worker(const _Key_T &_key, bool singleton = false)
|
|
|
|
:PFactory<_Abstract_T, _Key_T>::WorkerBase(singleton), key(_key)
|
|
|
|
{
|
|
|
|
PFactory<_Abstract_T, _Key_T>::Register(key, this);
|
|
|
|
}
|
|
|
|
~Worker()
|
|
|
|
{
|
|
|
|
PFactory<_Abstract_T, _Key_T>::Unregister(key);
|
|
|
|
}
|
2006-09-22 19:54:20 +00:00
|
|
|
protected:
|
|
|
|
virtual _Abstract_T *Create(const _Key_T &) const { return new _Concrete_T; }
|
2006-09-19 19:04:13 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
PString key;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifdef H323_REGISTER_CAPABILITY
|
|
|
|
#undef H323_REGISTER_CAPABILITY
|
|
|
|
#endif
|
|
|
|
#define H323_REGISTER_CAPABILITY(cls, capName) static MyPFactory<H323Capability>::Worker<cls> cls##Factory(capName, true)
|
|
|
|
|
2006-09-22 19:56:07 +00:00
|
|
|
#ifdef OPAL_MEDIA_FORMAT_DECLARE
|
|
|
|
#undef OPAL_MEDIA_FORMAT_DECLARE
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define OPAL_MEDIA_FORMAT_DECLARE(classname, _fullName, _defaultSessionID, _rtpPayloadType, _needsJitter,_bandwidth, _frameSize, _frameTime, _timeUnits, _timeStamp) \
|
|
|
|
class classname : public OpalMediaFormat \
|
|
|
|
{ \
|
|
|
|
public: \
|
|
|
|
classname() \
|
|
|
|
: OpalMediaFormat(_fullName, _defaultSessionID, _rtpPayloadType, _needsJitter, _bandwidth, \
|
|
|
|
_frameSize, _frameTime, _timeUnits, _timeStamp){} \
|
|
|
|
}; \
|
|
|
|
static MyPFactory<OpalMediaFormat>::Worker<classname> classname##Factory(_fullName, true)
|
|
|
|
|
2006-09-19 19:04:13 +00:00
|
|
|
#endif /* !defined AST_H323_H */
|