diff -ur ../clean/asterisk-1.6.2.17-rc2/channels/h323/ast_h323.cxx channels/h323/ast_h323.cxx --- ../clean/asterisk-1.6.2.17-rc2/channels/h323/ast_h323.cxx 2010-05-25 00:07:11.000000000 +0200 +++ channels/h323/ast_h323.cxx 2011-02-14 12:17:28.000000000 +0200 @@ -120,11 +120,9 @@ const char *h323product = "H.323 Channel Driver for Asterisk"; PDECLARE_PROCESS(MyProcess,PProcess,h323manufact,h323product,MAJOR_VERSION,MINOR_VERSION,BUILD_TYPE,BUILD_NUMBER) -static MyProcess localProcess; // active for the life of the DLL -/* void MyProcess::Main() -{ +static MyProcess *localProcess = NULL; // active for the life of the DLL +void MyProcess::Main() { } -*/ //////////////////////////////////////////////// @@ -226,23 +224,6 @@ (logstream ? (PTrace::ClearOptions((unsigned)-1), PTrace::Begin(0, __FILE__, __LINE__)) : std::cout) #define endl my_endl -void MyProcess::Main() -{ - PTrace::Initialise(PTrace::GetLevel(), NULL, traceOptions); - PTrace::SetStream(logstream); - - cout << " == Creating H.323 Endpoint" << endl; - if (endPoint) { - cout << " == ENDPOINT ALREADY CREATED" << endl; - return; - } - endPoint = new MyH323EndPoint(); - /* Due to a bug in the H.323 recomendation/stack we should request a sane - amount of bandwidth from the GK - this function is ignored if not using a GK - We are requesting 128 (64k in each direction), which is the worst case codec. */ - endPoint->SetInitialBandwidth(1280); -} - void PAssertFunc(const char *msg) { ast_log(LOG_ERROR, "%s\n", msg); @@ -2256,9 +2237,19 @@ void h323_end_point_create(void) { channelsOpen = 0; - logstream = new PAsteriskLog(); - PTrace::SetStream(logstream); + if (!localProcess) + localProcess=new MyProcess(); + if (!logstream) { + logstream = new PAsteriskLog(); + PTrace::Initialise(PTrace::GetLevel(), NULL, traceOptions); + PTrace::SetStream(logstream); + } + cout << " == Creating H.323 Endpoint" << endl; endPoint = new MyH323EndPoint(); + /* Due to a bug in the H.323 recomendation/stack we should request a sane + amount of bandwidth from the GK - this function is ignored if not using a GK + We are requesting 128 (64k in each direction), which is the worst case codec. */ + endPoint->SetInitialBandwidth(1280); } void h323_gk_urq(void) @@ -2369,13 +2360,21 @@ /* Addition of functions just to make the channel driver compile with H323Plus */ #if VERSION(OPENH323_MAJOR, OPENH323_MINOR, OPENH323_BUILD) > VERSION(1,19,4) /* Alternate RTP port information for Same NAT */ +#if VERSION(OPENH323_MAJOR, OPENH323_MINOR, OPENH323_BUILD) > VERSION(1,21,0) +PBoolean MyH323_ExternalRTPChannel::OnReceivedAltPDU(const H245_ArrayOf_GenericInformation & alternate ) +#else BOOL MyH323_ExternalRTPChannel::OnReceivedAltPDU(const H245_ArrayOf_GenericInformation & alternate ) +#endif { return TRUE; } /* Alternate RTP port information for Same NAT */ +#if VERSION(OPENH323_MAJOR, OPENH323_MINOR, OPENH323_BUILD) > VERSION(1,21,0) +PBoolean MyH323_ExternalRTPChannel::OnSendingAltPDU(H245_ArrayOf_GenericInformation & alternate) const +#else BOOL MyH323_ExternalRTPChannel::OnSendingAltPDU(H245_ArrayOf_GenericInformation & alternate) const +#endif { return TRUE; } @@ -2386,7 +2385,11 @@ } /* Alternate RTP port information for Same NAT */ +#if VERSION(OPENH323_MAJOR, OPENH323_MINOR, OPENH323_BUILD) > VERSION(1,21,0) +PBoolean MyH323_ExternalRTPChannel::OnReceivedAckAltPDU(const H245_ArrayOf_GenericInformation & alternate) +#else BOOL MyH323_ExternalRTPChannel::OnReceivedAckAltPDU(const H245_ArrayOf_GenericInformation & alternate) +#endif { return TRUE; } @@ -2673,10 +2676,14 @@ close(_timerChangePipe[1]); #endif if (logstream) { - PTrace::SetStream(NULL); +// PTrace::SetStream(NULL); delete logstream; logstream = NULL; } + if (localProcess) { + delete localProcess; + localProcess = NULL; + } } } /* extern "C" */ diff -ur ../clean/asterisk-1.6.2.17-rc2/channels/h323/ast_h323.h channels/h323/ast_h323.h --- ../clean/asterisk-1.6.2.17-rc2/channels/h323/ast_h323.h 2009-03-17 22:53:55.000000000 +0200 +++ channels/h323/ast_h323.h 2011-02-14 03:22:25.000000000 +0200 @@ -101,8 +101,11 @@ virtual void OnReceivedLocalCallHold(int linkedId); virtual void OnReceivedLocalCallRetrieve(int linkedId); #endif +#if VERSION(OPENH323_MAJOR, OPENH323_MINOR, OPENH323_BUILD) > VERSION(1,21,0) + void MyHoldCall(PBoolean localHold); +#else void MyHoldCall(BOOL localHold); - +#endif PString sourceAliases; PString destAliases; PString sourceE164; @@ -152,12 +155,18 @@ PIPSocket::Address localIpAddr; PIPSocket::Address remoteIpAddr; /* Additional functions in order to have chan_h323 compile with H323Plus */ -#if VERSION(OPENH323_MAJOR, OPENH323_MINOR, OPENH323_BUILD) > VERSION(1,19,4) +#if VERSION(OPENH323_MAJOR, OPENH323_MINOR, OPENH323_BUILD) > VERSION(1,21,0) + PBoolean OnReceivedAltPDU(const H245_ArrayOf_GenericInformation & alternate ); + PBoolean OnSendingAltPDU(H245_ArrayOf_GenericInformation & alternate) const; + PBoolean OnReceivedAckAltPDU(const H245_ArrayOf_GenericInformation & alternate); +#elif VERSION(OPENH323_MAJOR, OPENH323_MINOR, OPENH323_BUILD) > VERSION(1,19,4) BOOL OnReceivedAltPDU(const H245_ArrayOf_GenericInformation & alternate ); BOOL OnSendingAltPDU(H245_ArrayOf_GenericInformation & alternate) const; - void OnSendOpenAckAlt(H245_ArrayOf_GenericInformation & alternate) const; BOOL OnReceivedAckAltPDU(const H245_ArrayOf_GenericInformation & alternate); #endif +#if VERSION(OPENH323_MAJOR, OPENH323_MINOR, OPENH323_BUILD) > VERSION(1,19,4) + void OnSendOpenAckAlt(H245_ArrayOf_GenericInformation & alternate) const; +#endif WORD localPort; WORD remotePort; };