1 /*
2  * h323ep.h
3  *
4  * H.323 protocol handler
5  *
6  * Open H323 Library
7  *
8  * Copyright (c) 1998-2001 Equivalence Pty. Ltd.
9  *
10  * The contents of this file are subject to the Mozilla Public License
11  * Version 1.0 (the "License"); you may not use this file except in
12  * compliance with the License. You may obtain a copy of the License at
13  * http://www.mozilla.org/MPL/
14  *
15  * Software distributed under the License is distributed on an "AS IS"
16  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
17  * the License for the specific language governing rights and limitations
18  * under the License.
19  *
20  * The Original Code is Open H323 Library.
21  *
22  * The Initial Developer of the Original Code is Equivalence Pty. Ltd.
23  *
24  * Portions of this code were written with the assisance of funding from
25  * Vovida Networks, Inc. http://www.vovida.com.
26  *
27  * Contributor(s): ______________________________________.
28  *
29  * $Id$
30  *
31  */
32 
33 #ifndef __OPAL_H323EP_H
34 #define __OPAL_H323EP_H
35 
36 #include "h323.h"
37 #include "h323con.h"
38 
39 #ifdef P_USE_PRAGMA
40 #pragma interface
41 #endif
42 
43 // Add Feature Support
44 #ifdef H323_H460
45 #include "h460/h4601.h"
46 #endif
47 
48 #ifdef H323_H46025
49 #include "h460/h460_std25_pidf_lo.h"
50 #endif
51 
52 // Add Association Support
53 #ifdef H323_H461
54 #include "h460/h461_base.h"
55 #endif
56 
57 // Add NAT Method Support
58 #ifdef P_STUN
59 #include <ptclib/pnat.h>
60 class PSTUNClient;
61 #endif
62 
63 // Add H.224 Handlers
64 #ifdef H323_H224
65 #include <h224/h224.h>
66 #endif
67 
68 // Add T.140 Methods
69 #ifdef H323_T140
70 #include <h323t140.h>
71 #endif
72 
73 class PHandleAggregator;
74 
75 /* The following classes have forward references to avoid including the VERY
76    large header files for H225 and H245. If an application requires access
77    to the protocol classes they can include them, but for simple usage their
78    inclusion can be avoided.
79  */
80 class H225_EndpointType;
81 class H225_ArrayOf_SupportedProtocols;
82 class H225_VendorIdentifier;
83 class H225_H221NonStandard;
84 class H225_ServiceControlDescriptor;
85 class H225_ArrayOf_AliasAddress;
86 
87 class H323SignalPDU;
88 class H323ConnectionsCleaner;
89 class H323ServiceControlSession;
90 
91 #if H323_H224
92 class H224_H281Handler;
93 #endif
94 
95 #ifdef H323_T120
96 class OpalT120Protocol;
97 #endif
98 
99 #ifdef H323_T38
100 class OpalT38Protocol;
101 #endif
102 
103 #ifdef H323_H460P
104 struct PresSubDetails;
105 class H460PresenceHandler;
106 #endif
107 
108 #ifdef H323_GNUGK
109 class GNUGK_Feature;
110 #endif
111 
112 #ifdef H323_UPnP
113 class PNatMethod_UPnP;
114 #endif
115 
116 #ifdef H323_FILE
117 class H323FileTransferHandler;
118 class H323FileTransferList;
119 #endif
120 
121 ///////////////////////////////////////////////////////////////////////////////
122 
123 /**This class manages the H323 endpoint.
124    An endpoint may have zero or more listeners to create incoming connections
125    or zero or more outgoing conenctions initiated via the MakeCall() function.
126    Once a conection exists it is managed by this class instance.
127 
128    The main thing this class embodies is the capabilities of the application,
129    that is the codecs and protocols it is capable of.
130 
131    An application may create a descendent off this class and overide the
132    CreateConnection() function, if they require a descendent of H323Connection
133    to be created. This would be quite likely in most applications.
134  */
135 class H323EndPoint : public PObject
136 {
137   PCLASSINFO(H323EndPoint, PObject);
138 
139   public:
140     enum {
141       DefaultTcpPort = 1720,
142       DefaultTLSPort = 1300
143     };
144 
145   /**@name Construction */
146   //@{
147     /**Create a new endpoint.
148      */
149     H323EndPoint();
150 
151     /**Destroy endpoint.
152      */
153     ~H323EndPoint();
154 
155     /**Set the endpoint information in H225 PDU's.
156       */
157     virtual void SetEndpointTypeInfo(
158       H225_EndpointType & info
159     ) const;
160 
161     /**Set the vendor information in H225 PDU's.
162       */
163     virtual void SetVendorIdentifierInfo(
164       H225_VendorIdentifier & info
165     ) const;
166 
167     /**Set the Gateway supported protocol default always H.323
168       */
169     PBoolean SetGatewaySupportedProtocol(
170         H225_ArrayOf_SupportedProtocols & protocols
171     ) const;
172 
173    /**Set the gateway prefixes
174       Override this to set the acceptable prefixes to the gatekeeper
175       */
176     virtual PBoolean OnSetGatewayPrefixes(
177         PStringList & prefixes
178     ) const;
179 
180     /**Set the H221NonStandard information in H225 PDU's.
181       */
182     virtual void SetH221NonStandardInfo(
183       H225_H221NonStandard & info
184     ) const;
185   //@}
186 
187 
188   /**@name Capabilities */
189   //@{
190     /**Add a codec to the capabilities table. This will assure that the
191        assignedCapabilityNumber field in the codec is unique for all codecs
192        installed on this endpoint.
193 
194        If the specific instnace of the capability is already in the table, it
195        is not added again. Ther can be multiple instances of the same
196        capability class however.
197      */
198     void AddCapability(
199       H323Capability * capability   ///< New codec specification
200     );
201 
202     /**Set the capability descriptor lists. This is three tier set of
203        codecs. The top most level is a list of particular capabilities. Each
204        of these consists of a list of alternatives that can operate
205        simultaneously. The lowest level is a list of codecs that cannot
206        operate together. See H323 section 6.2.8.1 and H245 section 7.2 for
207        details.
208 
209        If descriptorNum is P_MAX_INDEX, the the next available index in the
210        array of descriptors is used. Similarly if simultaneous is P_MAX_INDEX
211        the the next available SimultaneousCapabilitySet is used. The return
212        value is the index used for the new entry. Note if both are P_MAX_INDEX
213        then the return value is the descriptor index as the simultaneous index
214        must be zero.
215 
216        Note that the capability specified here is automatically added to the
217        capability table using the AddCapability() function. A specific
218        instance of a capability is only ever added once, so multiple
219        SetCapability() calls with the same H323Capability pointer will only
220        add that capability once.
221      */
222     PINDEX SetCapability(
223       PINDEX descriptorNum, ///< The member of the capabilityDescriptor to add
224       PINDEX simultaneous,  ///< The member of the SimultaneousCapabilitySet to add
225       H323Capability * cap  ///< New capability specification
226     );
227 
228     /**Manually remove capability type. This removes the specified Capability type out of the
229        default capability list.
230       */
231     PBoolean RemoveCapability(
232         H323Capability::MainTypes capabilityType  ///< capability type
233     );
234 
235 #ifdef H323_VIDEO
236     /**Set the Video Frame Size. This is used for capabilities
237        that use 1 definition for all Video Frame Sizes. This will remove all capabilities
238        not matching the specified Frame Size and send a message to the remaining video capabilities
239        to set the maximum framesize allowed to the specified value
240       */
241     PBoolean SetVideoFrameSize(H323Capability::CapabilityFrameSize frameSize,
242                           int frameUnits = 1
243     );
244 
245     /**Set the Video Encoder size and rate.
246         This is used for generic Video Capabilities to set the appropriate level for a given encoder
247         frame size and rate.
248       */
249     PBoolean SetVideoEncoder(unsigned frameWidth, unsigned frameHeight, unsigned frameRate);
250 
251 #endif
252 
253     /**Add all matching capabilities in list.
254        All capabilities that match the specified name are added. See the
255        capabilities code for details on the matching algorithm.
256       */
257     PINDEX AddAllCapabilities(
258       PINDEX descriptorNum, ///< The member of the capabilityDescriptor to add
259       PINDEX simultaneous,  ///< The member of the SimultaneousCapabilitySet to add
260       const PString & name  ///< New capabilities name, if using "known" one.
261     );
262 
263     /**Add all user input capabilities to this endpoints capability table.
264       */
265     void AddAllUserInputCapabilities(
266       PINDEX descriptorNum, ///< The member of the capabilityDescriptor to add
267       PINDEX simultaneous   ///< The member of the SimultaneousCapabilitySet to add
268     );
269 
270 #ifdef H323_VIDEO
271 #ifdef H323_H239
272     /** Open Extended Video Session
273       */
274     PBoolean OpenExtendedVideoSession(
275         const PString & token        ///< Connection Token
276     );
277 
278     /** Open Extended Video Session
279       */
280     PBoolean OpenExtendedVideoSession(
281         const PString & token,       ///< Connection Token
282         H323ChannelNumber & num      ///< Opened Channel number
283     );
284 
285     PBoolean CloseExtendedVideoSession(
286         const PString & token        ///< Connection Token
287     );
288 
289     PBoolean CloseExtendedVideoSession(
290         const PString & token,             ///< Connection Token
291         const H323ChannelNumber & num      ///< channel number
292     );
293 
294     /**Add all Extended Video capabilities to this endpoints capability table.
295       */
296     void AddAllExtendedVideoCapabilities(
297       PINDEX descriptorNum, ///< The member of the capabilityDescriptor to add
298       PINDEX simultaneous   ///< The member of the SimultaneousCapabilitySet to add
299     );
300 #endif
301 #endif
302 
303     /**Remove capabilites in table.
304       */
305     void RemoveCapabilities(
306       const PStringArray & codecNames
307     );
308 
309     /**Reorder capabilites in table.
310       */
311     void ReorderCapabilities(
312       const PStringArray & preferenceOrder
313     );
314 
315     /**Find a capability that has been registered.
316      */
317     H323Capability * FindCapability(
318       const H245_Capability & cap  ///< H245 capability table entry
319     ) const;
320 
321     /**Find a capability that has been registered.
322      */
323     H323Capability * FindCapability(
324       const H245_DataType & dataType  ///< H245 data type of codec
325     ) const;
326 
327     /**Find a capability that has been registered.
328      */
329     H323Capability * FindCapability(
330       H323Capability::MainTypes mainType,   ///< Main type of codec
331       unsigned subType                      ///< Subtype of codec
332     ) const;
333   //@}
334 
335   /**@name Gatekeeper management */
336   //@{
337     /**Use and register with an explicit gatekeeper.
338        This will call other functions according to the following table:
339 
340            address    identifier   function
341            empty      empty        DiscoverGatekeeper()
342            non-empty  empty        SetGatekeeper()
343            empty      non-empty    LocateGatekeeper()
344            non-empty  non-empty    SetGatekeeperZone()
345 
346        The localAddress field, if non-empty, indicates the interface on which
347        to look for the gatekeeper. An empty string is equivalent to "ip$*:*"
348        which is any interface or port.
349 
350        If the endpoint is already registered with a gatekeeper that meets
351        the same criteria then the gatekeeper is not changed, otherwise it is
352        deleted (with unregistration) and new one created and registered to.
353      */
354     PBoolean UseGatekeeper(
355       const PString & address = PString::Empty(),     ///< Address of gatekeeper to use.
356       const PString & identifier = PString::Empty(),  ///< Identifier of gatekeeper to use.
357       const PString & localAddress = PString::Empty() ///< Local interface to use.
358     );
359 
360     /**Select and register with an explicit gatekeeper.
361        This will use the specified transport and a string giving a transport
362        dependent address to locate a specific gatekeeper. The endpoint will
363        register with that gatekeeper and, if successful, set it as the current
364        gatekeeper used by this endpoint.
365 
366        Note the transport being passed in will be deleted by this function or
367        the H323Gatekeeper object it becomes associated with. Also if transport
368        is NULL then a H323TransportUDP is created.
369      */
370     PBoolean SetGatekeeper(
371       const PString & address,          ///< Address of gatekeeper to use.
372       H323Transport * transport = NULL  ///< Transport over which to talk to gatekeeper.
373     );
374 
375     /**Select and register with an explicit gatekeeper and zone.
376        This will use the specified transport and a string giving a transport
377        dependent address to locate a specific gatekeeper. The endpoint will
378        register with that gatekeeper and, if successful, set it as the current
379        gatekeeper used by this endpoint.
380 
381        The gatekeeper identifier is set to the spplied parameter to allow the
382        gatekeeper to either allocate a zone or sub-zone, or refuse to register
383        if the zones do not match.
384 
385        Note the transport being passed in will be deleted by this function or
386        the H323Gatekeeper object it becomes associated with. Also if transport
387        is NULL then a H323TransportUDP is created.
388      */
389     PBoolean SetGatekeeperZone(
390       const PString & address,          ///< Address of gatekeeper to use.
391       const PString & identifier,       ///< Identifier of gatekeeper to use.
392       H323Transport * transport = NULL  ///< Transport over which to talk to gatekeeper.
393     );
394 
395     /**Locate and select gatekeeper.
396        This function will use the automatic gatekeeper discovery methods to
397        locate the gatekeeper on the particular transport that has the specified
398        gatekeeper identifier name. This is often the "Zone" for the gatekeeper.
399 
400        Note the transport being passed in will be deleted becomes owned by the
401        H323Gatekeeper created by this function and will be deleted by it. Also
402        if transport is NULL then a H323TransportUDP is created.
403      */
404     PBoolean LocateGatekeeper(
405       const PString & identifier,       ///< Identifier of gatekeeper to locate.
406       H323Transport * transport = NULL  ///< Transport over which to talk to gatekeeper.
407     );
408 
409     /**Discover and select gatekeeper.
410        This function will use the automatic gatekeeper discovery methods to
411        locate the first gatekeeper on a particular transport.
412 
413        Note the transport being passed in will be deleted becomes owned by the
414        H323Gatekeeper created by this function and will be deleted by it. Also
415        if transport is NULL then a H323TransportUDP is created.
416      */
417     PBoolean DiscoverGatekeeper(
418       H323Transport * transport = NULL  ///< Transport over which to talk to gatekeeper.
419     );
420 
421     /**Create a gatekeeper.
422        This allows the application writer to have the gatekeeper as a
423        descendent of the H323Gatekeeper in order to add functionality to the
424        base capabilities in the library.
425 
426        The default creates an instance of the H323Gatekeeper class.
427      */
428     virtual H323Gatekeeper * CreateGatekeeper(
429       H323Transport * transport  ///< Transport over which gatekeepers communicates.
430     );
431 
432     /**Get the gatekeeper we are registered with.
433      */
GetGatekeeper()434     H323Gatekeeper * GetGatekeeper() const { return gatekeeper; }
435 
436     /**Return if endpoint is registered with gatekeeper.
437       */
438     PBoolean IsRegisteredWithGatekeeper() const;
439 
440     /**Unregister and delete the gatekeeper we are registered with.
441        The return value indicates FALSE if there was an error during the
442        unregistration. However the gatekeeper is still removed and its
443        instance deleted regardless of this error.
444      */
445     PBoolean RemoveGatekeeper(
446       int reason = -1    ///< Reason for gatekeeper removal
447     );
448 
449     /**Force the endpoint to reregister with Gatekeeper
450       */
451     void ForceGatekeeperReRegistration();
452 
453     /**Set the H.235 password for the gatekeeper.
454       */
455     virtual void SetGatekeeperPassword(
456       const PString & password
457     );
458 
459     /**Get the H.235 password for the gatekeeper.
460       */
GetGatekeeperPassword()461     virtual const PString & GetGatekeeperPassword() const { return gatekeeperPassword; }
462 
463     /** Check the IP of the Gatekeeper on reregistration
464         Use this to check if Gatekeeper IP had changed (used for DDNS type registrations)
465         Default returns FALSE
466       */
467     virtual PBoolean GatekeeperCheckIP(const H323TransportAddress & oldAddr,H323TransportAddress & newaddress);
468 
469     /**Create priority list for Gatekeeper authenticators.
470       */
471     virtual void SetAuthenticatorOrder(PStringList & names);
472 
473     /**Create a list of authenticators for gatekeeper.
474       */
475     virtual H235Authenticators CreateAuthenticators();
476 
477     /**Called when sending a Admission Request to the gatekeeper
478      */
479     virtual void OnAdmissionRequest(H323Connection & connection);
480 
481     /**Called when the gatekeeper sends a GatekeeperConfirm
482       */
483     virtual void  OnGatekeeperConfirm();
484 
485     /**Called when the gatekeeper sends a GatekeeperReject
486       */
487     virtual void  OnGatekeeperReject();
488 
489     /**Called when the gatekeeper sends a RegistrationConfirm
490       */
491     virtual void OnRegistrationConfirm(const H323TransportAddress & rasAddress);
492 
493     /**Called when the gatekeeper sends a RegistrationReject
494       */
495     virtual void  OnRegistrationReject();
496 
497     /**Called when Unregistered by Gatekeeper
498      */
499     virtual void OnUnRegisterRequest();
500 
501     /**Called when reply Unregister to Gatekeeper
502      */
503     virtual void OnUnRegisterConfirm();
504 
505     /**Called when TTL registration fails
506      */
507     virtual void OnRegisterTTLFail();
508 
509     /**When an IP address change has been detected
510        This will remove the listener and gatekeeper
511        and bind to the new detected IP address
512      */
513     virtual PBoolean OnDetectedIPChange(PIPSocket::Address newIP = PIPSocket::Address::GetAny(4));
514   //@}
515 
516   /**@name Connection management */
517   //@{
518     /**Add a listener to the endpoint.
519        This allows for the automatic creating of incoming call connections. An
520        application should use OnConnectionEstablished() to monitor when calls
521        have arrived and been successfully negotiated.
522 
523        Note if this returns TRUE, then the endpoint is responsible for
524        deleting the H323Listener listener object. If FALSE is returned then
525        the object is not deleted and it is up to the caller to release the
526        memory allocated for the object.
527 
528        If a listener already exists on the same transport address then it is
529        ignored, but TRUE is still returned. The caller does not need to delete
530        the object.
531       */
532     PBoolean StartListener(
533       H323Listener * listener ///< Transport dependent listener.
534     );
535 
536     /**Add a listener to the endpoint.
537        This allows for the automatic creating of incoming call connections. An
538        application should use OnConnectionEstablished() to monitor when calls
539        have arrived and been successfully negotiated.
540 
541        If a listener already exists on the same address then it is ignored,
542        but TRUE is still returned.
543 
544        If the iface string is empty then "*" is assumed which will listen on
545        the standard TCP port on INADDR_ANY.
546       */
547     PBoolean StartListener(
548       const H323TransportAddress & iface ///< Address of interface to listen on.
549     );
550 
551     /**Add listeners to the endpoint.
552        Set the collection of listeners which will allow the automatic
553        creating of incoming call connections. An application should use
554        OnConnectionEstablished() to monitor when calls have arrived and been
555        successfully negotiated.
556 
557        If a listener already exists on the interface specified in the list
558        then it is ignored. If a listener does not yet exist a new one is
559        created and if a listener is running that is not in the list then it
560        is stopped and removed.
561 
562        If the array is empty then the string "*" is assumed which will listen
563        on the standard TCP port on INADDR_ANY.
564 
565        Returns TRUE if at least one interface was successfully started.
566       */
567     PBoolean StartListeners(
568       const H323TransportAddressArray & ifaces ///< Interfaces to listen on.
569     );
570 
571     /**Remove a listener from the endpoint.
572        If the listener parameter is NULL then all listeners are removed.
573       */
574     PBoolean RemoveListener(
575       H323Listener * listener ///< Transport dependent listener.
576     );
577 
578     /**Return a list of the transport addresses for all listeners on this endpoint
579       */
580     H323TransportAddressArray GetInterfaceAddresses(
581       PBoolean excludeLocalHost = TRUE,       ///< Flag to exclude 127.0.0.1
582       H323Transport * associatedTransport = NULL
583                           ///< Associated transport for precedence and translation
584     );
585 
586      /**Make a Authenticated call to a remote party.
587     This Function sets Security Information to be included when calling
588     a EP which requires Authentication
589        */
590       H323Connection * MakeAuthenticatedCall (
591                         const PString & remoteParty,  ///* Remote party to call
592                         const PString & UserName,     ///* UserName to Use (Default is LocalPartyName)
593                         const PString & Password,     ///* Password to Use (MUST NOT BE EMPTY)
594                         PString & token,              ///* String to receive token for connection
595                         void * userData = NULL        ///* user data to pass to CreateConnection
596      );
597 
598      /**Make a Supplementary call to a remote party.
599         This Function makes a Non Call supplementary connection (lightweight call) for the purpose
600         of delivering H.450 & H.460 non call content such as instant messaging and messagebank messages
601        */
602       H323Connection * MakeSupplimentaryCall (
603                         const PString & remoteParty,  ///* Remote party to call
604                         PString & token,              ///* String to receive token for connection
605                         void * userData = NULL        ///* user data to pass to CreateConnection
606       );
607 
608     /**Make a call to a remote party. An appropriate transport is determined
609        from the remoteParty parameter. The general form for this parameter is
610        [alias@][transport$]host[:port] where the default alias is the same as
611        the host, the default transport is "ip" and the default port is 1720.
612 
613        This function returns almost immediately with the call occurring in a
614        new background thread. Note that the call could be created and cleared
615        ie OnConnectionCleared is called BEFORE this function returns. It is
616        guaranteed that the token variable is set before OnConnectionCleared
617        called.
618 
619        Note, the returned pointer to the connection is not locked and may be
620        deleted at any time. This is extremely unlikely immediately after the
621        function is called, but you should not keep this pointer beyond that
622        brief time. The the FindConnectionWithLock() function for future
623        references to the connection object. It is recommended that
624        MakeCallLocked() be usedin instead.
625      */
626     H323Connection * MakeCall(
627       const PString & remoteParty,     ///< Remote party to call
628       PString & token,                 ///< String to receive token for connection
629       void * userData = NULL,           ///< user data to pass to CreateConnection
630       PBoolean supplementary = false   ///< Whether the call is a supplementary call
631     );
632 
633     /**Make a call to a remote party using the specified transport.
634        The remoteParty may be a hostname, alias or other user name that is to
635        be passed to the transport, if present.
636 
637        If the transport parameter is NULL the transport is determined from the
638        remoteParty description.
639 
640        This function returns almost immediately with the call occurring in a
641        new background thread. Note that the call could be created and cleared
642        ie OnConnectionCleared is called BEFORE this function returns. It is
643        guaranteed that the token variable is set before OnConnectionCleared
644        called.
645 
646        Note, the returned pointer to the connection is not locked and may be
647        deleted at any time. This is extremely unlikely immediately after the
648        function is called, but you should not keep this pointer beyond that
649        brief time. The the FindConnectionWithLock() function for future
650        references to the connection object. It is recommended that
651        MakeCallLocked() be usedin instead.
652      */
653     H323Connection * MakeCall(
654       const PString & remoteParty,  ///< Remote party to call
655       H323Transport * transport,    ///< Transport to use for call.
656       PString & token,              ///< String to receive token for connection
657       void * userData = NULL,        ///< user data to pass to CreateConnection
658       PBoolean supplementary = false   ///< Whether the call is a supplementary call
659     );
660 
661     /**Make a call to a remote party using the specified transport.
662        The remoteParty may be a hostname, alias or other user name that is to
663        be passed to the transport, if present.
664 
665        If the transport parameter is NULL the transport is determined from the
666        remoteParty description.
667 
668        This function returns almost immediately with the call occurring in a
669        new background thread. However the call will not progress very far
670      */
671     H323Connection * MakeCallLocked(
672       const PString & remoteParty,     ///< Remote party to call
673       PString & token,                 ///< String to receive token for connection
674       void * userData = NULL,          ///< user data to pass to CreateConnection
675       H323Transport * transport = NULL ///< Transport to use for call.
676     );
677 
678 #ifdef H323_H450
679 
680   /**@name H.450.2 Call Transfer */
681 
682     /**Setup the transfer of an existing call (connection) to a new remote party
683        using H.450.2.  This sends a Call Transfer Setup Invoke message from the
684        B-Party (transferred endpoint) to the C-Party (transferred-to endpoint).
685 
686        If the transport parameter is NULL the transport is determined from the
687        remoteParty description. The general form for this parameter is
688        [alias@][transport$]host[:port] where the default alias is the same as
689        the host, the default transport is "ip" and the default port is 1720.
690 
691        This function returns almost immediately with the transfer occurring in a
692        new background thread.
693 
694        Note, the returned pointer to the connection is not locked and may be
695        deleted at any time. This is extremely unlikely immediately after the
696        function is called, but you should not keep this pointer beyond that
697        brief time. The the FindConnectionWithLock() function for future
698        references to the connection object.
699 
700        This function is declared virtual to allow an application to override
701        the function and get the new call token of the forwarded call.
702      */
703     virtual H323Connection * SetupTransfer(
704       const PString & token,        ///< Existing connection to be transferred
705       const PString & callIdentity, ///< Call identity of the secondary call (if it exists)
706       const PString & remoteParty,  ///< Remote party to transfer the existing call to
707       PString & newToken,           ///< String to receive token for the new connection
708       void * userData = NULL        ///< user data to pass to CreateConnection
709     );
710 
711     /**Initiate the transfer of an existing call (connection) to a new remote
712        party using H.450.2.  This sends a Call Transfer Initiate Invoke
713        message from the A-Party (transferring endpoint) to the B-Party
714        (transferred endpoint).
715      */
716     void TransferCall(
717       const PString & token,        ///< Existing connection to be transferred
718       const PString & remoteParty,  ///< Remote party to transfer the existing call to
719       const PString & callIdentity = PString::Empty()
720                                     ///< Call Identity of secondary call if present
721     );
722 
723     /**Transfer the call through consultation so the remote party in the
724        primary call is connected to the called party in the second call
725        using H.450.2.  This sends a Call Transfer Identify Invoke message
726        from the A-Party (transferring endpoint) to the C-Party
727        (transferred-to endpoint).
728      */
729     void ConsultationTransfer(
730       const PString & primaryCallToken,   ///< Token of primary call
731       const PString & secondaryCallToken  ///< Token of secondary call
732     );
733 
734     /**Place the call on hold, suspending all media channels (H.450.4)
735     * NOTE: Only Local Hold is implemented so far.
736     */
737     void HoldCall(
738       const PString & token,        ///< Existing connection to be transferred
739       PBoolean localHold   ///< true for Local Hold, false for Remote Hold
740     );
741 
742     /** Initiate Call intrusion
743         Designed similar to MakeCall function
744       */
745     H323Connection * IntrudeCall(
746       const PString & remoteParty,  ///< Remote party to intrude call
747       PString & token,              ///< String to receive token for connection
748       unsigned capabilityLevel,     ///< Capability level
749       void * userData = NULL        ///< user data to pass to CreateConnection
750     );
751 
752     H323Connection * IntrudeCall(
753       const PString & remoteParty,  ///< Remote party to intrude call
754       H323Transport * transport,    ///< Transport to use for call.
755       PString & token,              ///< String to receive token for connection
756       unsigned capabilityLevel,     ///< Capability level
757       void * userData = NULL        ///< user data to pass to CreateConnection
758     );
759 
760   //@}
761 
762 
763   /**@name H.450.7 MWI */
764 
765     /**Received a message wait indication.
766         Override to collect MWI messages.
767         default returns true.
768         return false indicates MWI rejected.
769       */
770     virtual PBoolean OnReceivedMWI(const H323Connection::MWIInformation & mwiInfo);
771 
772     /**Received a message wait indication Clear.
773         Override to remove any outstanding MWIs.
774         default returns true.
775         return false indicates MWI rejected.
776       */
777     virtual PBoolean OnReceivedMWIClear(const PString & user);
778 
779     /**Received a message wait indication request on a mail server (Interrogate).
780         This is used for enquiring on a mail server if
781         there are any active messages for the served user.
782         An implementer may populate a H323Connection::MWInformation struct and call
783         H323Connection::SetMWINonCallParameters to set the interrogate reply
784         default returns true. if SetMWINonCallParameters called the connect message
785         will contain a reply msg to the caller.
786         return false indicates MWI rejected.
787       */
788     virtual PBoolean OnReceivedMWIRequest(
789         H323Connection * connection,   ///< Connection the request came in on
790         const PString & user           ///< User request made for
791     );
792 
793     /** Get the Msg Centre name for H450.7 MWI service. */
GetMWIMessageCentre()794     const PString & GetMWIMessageCentre()  { return mwiMsgCentre; }
795 
796     /** Set the MWI MessageCentre Alias Address (Required when using H323plus as videoMail server for callback) */
SetMWIMessageCentre(const PString & msgCtr)797     void SetMWIMessageCentre(const PString & msgCtr)  {  mwiMsgCentre = msgCtr; }
798 
799   //@}
800 
801 #endif // H323_H450
802 
803     /** Use DNS SRV and ENUM to resolve all the possible addresses a call party
804        can be found. Only effective if not registered with Gatekeeper
805       */
806     PBoolean ResolveCallParty(
807       const PString & _remoteParty,
808       PStringList & addresses
809     );
810 
811     /**Parse a party address into alias and transport components.
812        An appropriate transport is determined from the remoteParty parameter.
813        The general form for this parameter is [alias@][transport$]host[:port]
814        where the default alias is the same as the host, the default transport
815        is "ip" and the default port is 1720.
816       */
817     virtual PBoolean ParsePartyName(
818       const PString & party,          ///< Party name string.
819       PString & alias,                ///< Parsed alias name
820       H323TransportAddress & address  ///< Parsed transport address
821     );
822 
823     /**Clear a current connection.
824        This hangs up the connection to a remote endpoint. Note that this function
825        is asynchronous
826       */
827     virtual PBoolean ClearCall(
828       const PString & token,  ///< Token for identifying connection
829       H323Connection::CallEndReason reason =
830                   H323Connection::EndedByLocalUser ///< Reason for call clearing
831     );
832 
833      /**Clearing a current connection.
834         A connection is being cleared callback. This can be used for PBX applications
835         to reallocate the line early without waiting for the cleaner thread to clean-up
836         the connection.
837        */
838      virtual void OnCallClearing(H323Connection * connection,       ///* Connection being Cleared
839                               H323Connection::CallEndReason reason  ///* Reason for call being cleared
840      );
841 
842     /**Clear a current connection.
843        This hangs up the connection to a remote endpoint. Note that these functions
844        are synchronous
845       */
846     virtual PBoolean ClearCallSynchronous(
847       const PString & token,            ///< Token for identifying connection
848       H323Connection::CallEndReason reason =
849                         H323Connection::EndedByLocalUser ///< Reason for call clearing
850     );
851     virtual PBoolean ClearCallSynchronous(
852       const PString & token,                ///< Token for identifying connection
853       H323Connection::CallEndReason reason, ///< Reason for call clearing
854       PSyncPoint * sync
855     );
856 
857     /**Clear all current connections.
858        This hangs up all the connections to remote endpoints. The wait
859        parameter is used to wait for all the calls to be cleared and their
860        memory usage cleaned up before returning. This is typically used in
861        the destructor for your descendant of H323EndPoint.
862       */
863     virtual void ClearAllCalls(
864       H323Connection::CallEndReason reason =
865                   H323Connection::EndedByLocalUser, ///< Reason for call clearing
866       PBoolean wait = TRUE   ///< Flag for wait for calls to e cleared.
867     );
868 
869     /**Determine if the connectionMutex will block
870       */
871     virtual PBoolean WillConnectionMutexBlock();
872 
873     /**Determine if a connection is active.
874       */
875     virtual PBoolean HasConnection(
876       const PString & token   ///< Token for identifying connection
877     );
878 
879     /**Find a connection that uses the specified token.
880        This searches the endpoint for the connection that contains the token
881        as provided by functions such as MakeCall() (as built by the
882        BuildConnectionToken() function). if not found it will then search for
883        the string representation of the CallIdentifier for the connection, and
884        finally try for the string representation of the ConferenceIdentifier.
885 
886        Note the caller of this function MUSt call the H323Connection::Unlock()
887        function if this function returns a non-NULL pointer. If it does not
888        then a deadlock can occur.
889       */
890     H323Connection * FindConnectionWithLock(
891       const PString & token     ///< Token to identify connection
892     );
893 
894     /**Get all calls current on the endpoint.
895       */
896     PStringList GetAllConnections();
897 
898     /**Call back for incoming call.
899        This function is called from the OnReceivedSignalSetup() function
900        before it sends the Alerting PDU. It gives an opportunity for an
901        application to alter the reply before transmission to the other
902        endpoint.
903 
904        If FALSE is returned the connection is aborted and a Release Complete
905        PDU is sent.
906 
907        The default behaviour simply returns TRUE.
908      */
909     virtual PBoolean OnIncomingCall(
910       H323Connection & connection,    ///< Connection that was established
911       const H323SignalPDU & setupPDU,   ///< Received setup PDU
912       H323SignalPDU & alertingPDU       ///< Alerting PDU to send
913     );
914     virtual PBoolean OnIncomingCall(
915       H323Connection & connection,           ///< Connection that was established
916       const H323SignalPDU & setupPDU,        ///< Received setup PDU
917       H323SignalPDU & alertingPDU,           ///< Alerting PDU to send
918       H323Connection::CallEndReason & reason ///< reason for call refusal, if returned false
919     );
920 
921     /**Handle a connection transfer.
922        This gives the application an opportunity to abort the transfer.
923        The default behaviour just returns TRUE.
924       */
925     virtual PBoolean OnCallTransferInitiate(
926       H323Connection & connection,    ///< Connection to transfer
927       const PString & remoteParty     ///< Party transferring to.
928     );
929 
930     /**Handle a transfer via consultation.
931        This gives the transferred-to user an opportunity to abort the transfer.
932        The default behaviour just returns TRUE.
933       */
934     virtual PBoolean OnCallTransferIdentify(
935       H323Connection & connection    ///< Connection to transfer
936     );
937 
938     /**
939       * Callback for ARQ send to a gatekeeper. This allows the endpoint
940       * to change or check fields in the ARQ before it is sent.
941       */
942     virtual void OnSendARQ(
943       H323Connection & conn,
944       H225_AdmissionRequest & arq
945     );
946 
947    /**
948       * Callback for ACF sent back from gatekeeper.
949       */
950     virtual void OnReceivedACF(
951       H323Connection & conn,
952       const H225_AdmissionConfirm & acf
953     );
954 
955    /**
956       * Callback for ARJ sent back from  gatekeeper.
957       */
958     virtual void OnReceivedARJ(
959       H323Connection & conn,
960       const H225_AdmissionReject & arj
961     );
962 
963     /**Call back for answering an incoming call.
964        This function is called from the OnReceivedSignalSetup() function
965        before it sends the Connect PDU. It gives an opportunity for an
966        application to alter the reply before transmission to the other
967        endpoint.
968 
969        It also gives an application time to wait for some event before
970        signalling to the endpoint that the connection is to proceed. For
971        example the user pressing an "Answer call" button.
972 
973        If AnswerCallDenied is returned the connection is aborted and a Release
974        Complete PDU is sent. If AnswerCallNow is returned then the H.323
975        protocol proceeds. Finally if AnswerCallPending is returned then the
976        protocol negotiations are paused until the AnsweringCall() function is
977        called.
978 
979        The default behaviour simply returns AnswerNow.
980      */
981     virtual H323Connection::AnswerCallResponse OnAnswerCall(
982       H323Connection & connection,    ///< Connection that was established
983       const PString & callerName,       ///< Name of caller
984       const H323SignalPDU & setupPDU,   ///< Received setup PDU
985       H323SignalPDU & connectPDU        ///< Connect PDU to send.
986     );
987 
988     /**Call back for remote party being alerted.
989        This function is called from the SendSignalSetup() function after it
990        receives the optional Alerting PDU from the remote endpoint. That is
991        when the remote "phone" is "ringing".
992 
993        If FALSE is returned the connection is aborted and a Release Complete
994        PDU is sent.
995 
996        The default behaviour simply returns TRUE.
997      */
998     virtual PBoolean OnAlerting(
999       H323Connection & connection,    ///< Connection that was established
1000       const H323SignalPDU & alertingPDU,  ///< Received Alerting PDU
1001       const PString & user                ///< Username of remote endpoint
1002     );
1003 
1004     /**A call back function when a connection indicates it is to be forwarded.
1005        An H323 application may handle this call back so it can make
1006        complicated decisions on if the call forward ius to take place. If it
1007        decides to do so it must call MakeCall() and return TRUE.
1008 
1009        The default behaviour simply returns FALSE and that the automatic
1010        call forwarding should take place. See ForwardConnection()
1011       */
1012     virtual PBoolean OnConnectionForwarded(
1013       H323Connection & connection,    ///< Connection to be forwarded
1014       const PString & forwardParty,   ///< Remote party to forward to
1015       const H323SignalPDU & pdu       ///< Full PDU initiating forwarding
1016     );
1017 
1018     /**Forward the call using the same token as the specified connection.
1019        Return TRUE if the call is being redirected.
1020 
1021        The default behaviour will replace the current call in the endpoints
1022        call list using the same token as the call being redirected. Not that
1023        even though the same token is being used the actual object is
1024        completely mad anew.
1025       */
1026     virtual PBoolean ForwardConnection(
1027       H323Connection & connection,    ///< Connection to be forwarded
1028       const PString & forwardParty,   ///< Remote party to forward to
1029       const H323SignalPDU & pdu       ///< Full PDU initiating forwarding
1030     );
1031 
1032     /**A call back function whenever a connection is established.
1033        This indicates that a connection to a remote endpoint was established
1034        with a control channel and zero or more logical channels.
1035 
1036        The default behaviour does nothing.
1037       */
1038     virtual void OnConnectionEstablished(
1039       H323Connection & connection,    ///< Connection that was established
1040       const PString & token           ///< Token for identifying connection
1041     );
1042 
1043     /**Determine if a connection is established.
1044       */
1045     virtual PBoolean IsConnectionEstablished(
1046       const PString & token   ///< Token for identifying connection
1047     );
1048 
1049     /**A call back function whenever a connection is broken.
1050        This indicates that a connection to a remote endpoint is no longer
1051        available.
1052 
1053        The default behaviour does nothing.
1054       */
1055     virtual void OnConnectionCleared(
1056       H323Connection & connection,    ///< Connection that was established
1057       const PString & token           ///< Token for identifying connection
1058     );
1059 
1060     /**Build a unique token for the connection.
1061        This identifies the call using the Q931 transport host name and the
1062        Q931 call reference number.
1063       */
1064     static PString BuildConnectionToken(
1065       const H323Transport & transport,  ///< Transport for connection
1066       unsigned callReference,           ///< Call reference of Q.931 link
1067       PBoolean fromRemote                   ///< Call reference is from remote endpoint
1068     );
1069 
1070     /**Handle a new incoming connection.
1071        This will examine the setup PDU and either attach the signalling
1072        transport to an existing connection that has the same Q.931 call
1073        reference, or creates a new connection using CreateConnection().
1074       */
1075     virtual H323Connection * OnIncomingConnection(
1076       H323Transport * transport,  ///< Transport for connection
1077       H323SignalPDU & setupPDU    ///< Setup PDU
1078     );
1079 
1080     /**Called when an outgoing call connects
1081        If FALSE is returned the connection is aborted and a Release Complete
1082        PDU is sent.
1083 
1084        The default behaviour simply returns TRUE.
1085       */
1086     virtual PBoolean OnOutgoingCall(
1087         H323Connection & conn,
1088         const H323SignalPDU & connectPDU
1089     );
1090 
1091     /**Create a connection that uses the specified call reference.
1092       */
1093     virtual H323Connection * CreateConnection(
1094       unsigned callReference,     ///< Call reference to use
1095       void * userData,            ///< user data to pass to CreateConnection
1096       H323Transport * transport,  ///< Transport for connection
1097       H323SignalPDU * setupPDU    ///< Setup PDU, NULL if outgoing call
1098     );
1099     virtual H323Connection * CreateConnection(
1100       unsigned callReference,   ///< Call reference to use
1101       void * userData           ///< user data to pass to CreateConnection
1102     );
1103     virtual H323Connection * CreateConnection(
1104       unsigned callReference    ///< Call reference to use
1105     );
1106 
1107     /**Clean up connections.
1108        This function is called from a background thread and checks for closed
1109        connections to clean up.
1110 
1111        This would not normally be called by an application.
1112       */
1113     virtual void CleanUpConnections();
1114   //@}
1115 
1116   /**@name Caller Authentication */
1117   //@{
1118     /**Create a list of authenticators for Call Authentication.
1119        To Create a list of Autheniticators the Endpoint MUST have
1120        set EPSecurityPassword (via SetEPCredentials()) and either
1121        set CallAuthPolicy (via SetEPSecurityPolicy()) or set
1122        isSecureCall to TRUE (via MakeAuthenticatedCall())
1123       */
1124      virtual H235Authenticators CreateEPAuthenticators();
1125 
1126     /** Retrieve Password and UserName for EPAuthentication
1127         NOTE: Returns FALSE is EPSecurityPassword.IsEmpty()
1128        */
1129     virtual PBoolean GetEPCredentials(PString & password,   ///* Password to use for call
1130                                   PString & username        ///* Username to use for call
1131                                   );
1132 
1133      /** Set the Password and UserName for EPAuthentication for Connection
1134        */
1135      virtual void SetEPCredentials(PString password,   ///* Password to use for call
1136                                    PString username    ///* Username to use for call
1137                                    );
1138 
1139      enum EPSecurityPolicy
1140      {
1141          SecNone,           ///* Default: Do Not Include Call Authenication
1142          SecRequest,        ///* Request Authentication but Accept if Missing/Fail
1143          SecRequired        ///* Calls are Rejected with EndedBySecurityDenial if Authenitication fails.
1144      };
1145 
1146      /** Set the EP Security Policy
1147        */
1148      virtual void SetEPSecurityPolicy(EPSecurityPolicy policy);
1149 
1150      /** Get the EP Security Policy
1151        */
1152      virtual EPSecurityPolicy GetEPSecurityPolicy();
1153 
1154      /** Retrieve the List of UserNames/Passwords to be used
1155      to Authenticate Incoming Calls.
1156        */
1157      H235AuthenticatorList GetAuthenticatorList();
1158 
1159      /** Call Authentication Call Back
1160      This fires for all the Authentication Methods created by
1161      CreateEPAuthenticators() The Function Supplies the Name of
1162      the Authentication process and the supplied SenderID (Username)
1163      and this is then check against EPAuthList to:
1164      1. Check if the username exists and if so
1165      2. Return the password in the clear to validate.
1166      Returning FALSE indicates that Authentication Failed failed for that Method..
1167        */
1168      virtual PBoolean OnCallAuthentication(const PString & username,  ///* UserName of Caller
1169                                         PString & password         ///* Password related to caller
1170                                         );
1171 
1172      /** Disable all authenticators using insecure MD5 hashing
1173        */
DisableMD5Authenticators()1174      virtual void DisableMD5Authenticators() { m_disableMD5Authenticators = TRUE; }
1175  //@}
1176 
1177 #ifdef H323_H235
1178   /**@name Media Encryption */
1179   //@{
1180      enum H235MediaPolicy
1181      {
1182          encyptNone = 0,           ///< Default: Do Not Include Media Encryption
1183          encyptRequest = 1,        ///< Request Encryption but Accept if Missing/Fail
1184          encyptRequired = 2        ///< Calls are Rejected with EndedBySecurityDenial if no Media Encryption.
1185      };
1186 
1187      enum H235MediaCipher
1188      {
1189          encypt128 = 128             ///< Default: AES128
1190 #ifdef H323_H235_AES256
1191          ,encypt192 = 192,           ///< AES192
1192          encypt256  = 256            ///< AES256
1193 #endif
1194      };
1195 
1196     /** Enable Media Encryption
1197         This enables media encryption.
1198       */
1199      virtual void SetH235MediaEncryption(H235MediaPolicy policy,     ///< How endpoint handles Encryption
1200                                          H235MediaCipher level,      ///< Maximum supported Cipher
1201                                          unsigned maxTokenSize = 1024///< Maximum DH token size
1202                                          );
1203 
1204     /** Get Media Encryption Policy
1205         This get the media encryption policy.
1206       */
1207     H235MediaPolicy GetH235MediaPolicy();
1208 
1209     /** Get Media Encryption Cipher
1210         This get the media encryption Cipher.
1211       */
1212     H235MediaCipher GetH235MediaCipher();
1213 
1214     /** H235SetDiffieHellmanFiles Set DH prameters from File (can be multiple file paths seperated by ;)
1215         Data must be stored in INI format with the section being the OID of the Algorith
1216         Parameter names are as below and all values are base64 encoded. eg:
1217            [OID]
1218            PRIME=
1219            GENERATOR=
1220 
1221        Default Parameters are replaced if OID is one of
1222             1024bit "0.0.8.235.0.3.43"
1223             1536bit "0.0.8.235.0.3.44"
1224             2048bit "0.0.8.235.0.3.45"
1225             4096bit "0.0.8.235.0.3.47"
1226             6144bit "0.0.8.235.0.4.77"
1227             8192bit "0.0.8.235.0.4.78"
1228        Default operation calls SetEncryptionCacheFiles();
1229       */
1230     virtual void H235SetDiffieHellmanFiles(const PString & file);
1231 
1232     /** Set Encryption Cache File Paths (can be multiple file paths seperated by ;)
1233         Data must be stored in INI format with the section being the OID of the Algorith
1234         Parameter names are as below and all values are base64 encoded. eg:
1235            [OID]
1236            PRIME=
1237            GENERATOR=
1238            PUBLIC=  <optional>
1239            PRIVATE= <optional>
1240 
1241        Default Parameters are replaced if OID is one of
1242             1024bit "0.0.8.235.0.3.43"
1243             1536bit "0.0.8.235.0.3.44"
1244             2048bit "0.0.8.235.0.3.45"
1245             4096bit "0.0.8.235.0.3.47"
1246             6144bit "0.0.8.235.0.4.77"
1247             8192bit "0.0.8.235.0.4.78"
1248 
1249         This function call should only be called by the implementer directly for testing purposes
1250         use H235SetDiffieHellmanFiles in production.
1251       */
1252     virtual void SetEncryptionCacheFiles(const PString & cachefile);
1253 
1254     /** Get Encryption Cache File Path (can be mulitple file paths)
1255       */
1256     virtual const PString & GetEncryptionCacheFiles();
1257 
1258     /** Load custom DiffieHellman Parameters for media encryption
1259 
1260        Default Parameters are replaced if OID is one of
1261             1024bit "0.0.8.235.0.3.43"
1262             1536bit "0.0.8.235.0.3.44"
1263             2048bit "0.0.8.235.0.3.45"
1264             4096bit "0.0.8.235.0.3.47"
1265             6144bit "0.0.8.235.0.4.77"
1266             8192bit "0.0.8.235.0.4.78"
1267       */
1268     virtual void LoadDiffieHellmanParameters(const PString & oid,
1269                                              const PBYTEArray & pData,
1270                                              const PBYTEArray & gData);
1271 
1272     /**Initialise Encryption cache
1273        Use this to create the encryption information at Startup rather than at the
1274        start of every call. This speeds up call establishment for high media encryption
1275        sessions. MUST Call EncryptionCacheRemove() to cleanup cache
1276       */
1277     virtual void EncryptionCacheInitialise();
1278 
1279     /**Remove Encryption cache
1280        Use this to remove the encryption information
1281       */
1282     virtual void EncryptionCacheRemove();
1283 
1284     /** On Media Encryption
1285         Fires when an encryption session negotiated
1286         Fires for each media session direction
1287      */
OnMediaEncryption(unsigned,H323Channel::Directions,const PString &)1288     virtual void OnMediaEncryption(unsigned /*session*/,
1289                                 H323Channel::Directions /*dir*/,
1290                                 const PString & /*cipher*/
1291                                 ) {};
1292   //@}
1293 #endif
1294 
1295   /**@name Logical Channels management */
1296   //@{
1297     /**Call back for opening a logical channel.
1298 
1299        The default behaviour simply returns TRUE.
1300       */
1301     virtual PBoolean OnStartLogicalChannel(
1302       H323Connection & connection,    ///< Connection for the channel
1303       H323Channel & channel           ///< Channel being started
1304     );
1305 
1306     /**Call back for closed a logical channel.
1307 
1308        The default behaviour does nothing.
1309       */
1310     virtual void OnClosedLogicalChannel(
1311       H323Connection & connection,    ///< Connection for the channel
1312       const H323Channel & channel     ///< Channel being started
1313     );
1314 
1315 #ifdef H323_AUDIO_CODECS
1316     /**Open a channel for use by an audio codec.
1317        The H323AudioCodec class will use this function to open the channel to
1318        read/write PCM data.
1319 
1320        The default function creates a PSoundChannel using the member variables
1321        soundChannelPlayDevice or soundChannelRecordDevice.
1322       */
1323     virtual PBoolean OpenAudioChannel(
1324       H323Connection & connection,  ///< Connection for the channel
1325       PBoolean isEncoding,              ///< Direction of data flow
1326       unsigned bufferSize,          ///< Size of each sound buffer
1327       H323AudioCodec & codec        ///< codec that is doing the opening
1328     );
1329 #endif
1330 
1331 #ifdef H323_VIDEO
1332     /**Open a channel for use by an video codec.
1333        The H323VideoCodec class will use this function to open the channel to
1334        read/write image data (which is one frame in a video stream - YUV411 format).
1335 
1336        The default function creates a PVideoChannel using the member variables.
1337       */
1338     virtual PBoolean OpenVideoChannel(
1339       H323Connection & connection,  ///< Connection for the channel
1340       PBoolean isEncoding,              ///< Direction of data flow
1341       H323VideoCodec & codec        ///< codec doing the opening
1342     );
1343 
1344 #ifdef H323_H239
1345     /**Open a channel for use by an application share application.
1346        The H323VideoCodec class will use this function to open the channel to
1347        read/write image data (which is one frame in a video stream - YUV411 format).
1348 
1349        The default function creates a PVideoChannel using the member variables.
1350       */
1351     virtual PBoolean OpenExtendedVideoChannel(
1352       H323Connection & connection,  ///< Connection for the channel
1353       PBoolean isEncoding,              ///< Direction of data flow
1354       H323VideoCodec & codec        ///< codec doing the opening
1355     );
1356 #endif // H323_H239
1357 #endif // NO_H323_VIDEO
1358 
1359     /**Callback from the RTP session for statistics monitoring.
1360        This is called every so many packets on the transmitter and receiver
1361        threads of the RTP session indicating that the statistics have been
1362        updated.
1363 
1364        The default behaviour does nothing.
1365       */
1366     virtual void OnRTPStatistics(
1367       const H323Connection & connection,  ///< Connection for the channel
1368       const RTP_Session & session         ///< Session with statistics
1369     ) const;
1370 
1371    /**Callback from the RTP session for statistics monitoring.
1372        This is called at the end of the RTP session indicating that the statistics
1373        of the call
1374 
1375        The default behaviour does nothing.
1376       */
1377     virtual void OnRTPFinalStatistics(
1378       const H323Connection & connection,  ///< Connection for the channel
1379       const RTP_Session & session         ///< Session with statistics
1380     ) const;
1381 
1382   //@}
1383 
1384   /**@name Indications */
1385   //@{
1386     /**Call back for remote enpoint has sent user input as a string.
1387 
1388        The default behaviour does nothing.
1389       */
1390     virtual void OnUserInputString(
1391       H323Connection & connection,  ///< Connection for the input
1392       const PString & value         ///< String value of indication
1393     );
1394 
1395     /**Call back for remote enpoint has sent user input.
1396 
1397        The default behaviour calls H323Connection::OnUserInputTone().
1398       */
1399     virtual void OnUserInputTone(
1400       H323Connection & connection,  ///< Connection for the input
1401       char tone,                    ///< DTMF tone code
1402       unsigned duration,            ///< Duration of tone in milliseconds
1403       unsigned logicalChannel,      ///< Logical channel number for RTP sync.
1404       unsigned rtpTimestamp         ///< RTP timestamp in logical channel sync.
1405     );
1406 
1407 #ifdef H323_GNUGK
1408      /**Call back from GK admission confirm to notify the Endpoint it is behind a NAT
1409     (GNUGK Gatekeeper) The default does nothing. Override this to notify the user they are behind a NAT.
1410      */
1411     virtual void OnGatekeeperNATDetect(
1412         PIPSocket::Address publicAddr,         ///< Public address as returned by the Gatekeeper
1413         const PString & gkIdentifier,                ///< Identifier at the gatekeeper
1414         H323TransportAddress & gkRouteAddress  ///< Gatekeeper Route Address
1415         );
1416 
1417      /**Call back from GK admission confirm to notify the Endpoint it is not detected as being NAT
1418     (GNUGK Gatekeeper) The default does nothing. Override this to notify the user they are not NAT
1419     so they can confirm that it is true.
1420      */
1421     virtual void OnGatekeeperOpenNATDetect(
1422         const PString & gkIdentifier,                ///< Identifier at the gatekeeper
1423         H323TransportAddress & gkRouteAddress  ///< Gatekeeper Route Address
1424         );
1425 
1426     /** Fired with the keep-alive connection to GnuGk fails or is re-established
1427         This allows the endpoint to re-register.
1428       */
1429     virtual void NATLostConnection(PBoolean lost);
1430 #endif
1431 
1432     /** Call back for GK assigned aliases returned from the gatekeeper in the RCF.
1433         The default returns FALSE which appends the new aliases to the existing alias list.
1434         By overriding this function and returning TRUE overrides the default operation
1435       */
1436     virtual PBoolean OnGatekeeperAliases(
1437         const H225_ArrayOf_AliasAddress & aliases  ///< Alias List returned from the gatekeeper
1438         );
1439   //@}
1440 
1441 #ifdef H323_H248
1442   /**@name Service Control */
1443   //@{
1444     /**Call back for HTTP based Service Control.
1445        An application may override this to use an HTTP link to display
1446        call information/CDR's or Billing information.
1447 
1448        The default behaviour does nothing.
1449       */
1450     virtual void OnHTTPServiceControl(
1451       unsigned operation,  ///< Control operation
1452       unsigned sessionId,  ///< Session ID for HTTP page
1453       const PString & url  ///< URL to use.
1454     );
1455 
1456     /**Call back for Call Credit Service Control.
1457        An application may override this to display call credit Information.
1458 
1459        The default behaviour does nothing.
1460       */
1461     virtual void OnCallCreditServiceControl(
1462       const PString & amount,         ///< UTF-8 string for amount, including currency.
1463       PBoolean mode,                      ///< Flag indicating that calls will debit the account.
1464       const unsigned & durationLimit  ///< Duration Limit (used to decrement display)
1465     );
1466 
1467 #ifdef H323_H350
1468     /**Call back for LDAP based Service Control.
1469        An application may override this to use an LDAP directory to query
1470        White Page searches.
1471 
1472        The default behaviour does nothing.
1473       */
1474     virtual void OnH350ServiceControl(
1475         const PString & url,
1476         const PString & BaseDN
1477         );
1478 #endif
1479 
1480     /**Call back for call credit information.
1481        An application may override this to display call credit information
1482        on registration, or when a call is started.
1483 
1484        The canDisplayAmountString member variable must also be set to TRUE
1485        for this to operate.
1486 
1487        The default behaviour does nothing.
1488       */
1489     virtual void OnCallCreditServiceControl(
1490       const PString & amount,  ///< UTF-8 string for amount, including currency.
1491       PBoolean mode          ///< Flag indicating that calls will debit the account.
1492     );
1493 
1494     /**Handle incoming service control session information.
1495        Default behaviour calls session.OnChange()
1496      */
1497     virtual void OnServiceControlSession(
1498       unsigned type,
1499       unsigned sessionid,
1500       const H323ServiceControlSession & session,
1501       H323Connection * connection
1502     );
1503 
1504     /**Create the service control session object.
1505      */
1506     virtual H323ServiceControlSession * CreateServiceControlSession(
1507       const H225_ServiceControlDescriptor & contents
1508     );
1509   //@}
1510 #endif // H323_H248
1511 
1512   /**@name Other services */
1513   //@{
1514 #ifdef H323_T120
1515     /**Create an instance of the T.120 protocol handler.
1516        This is called when the OpenLogicalChannel subsystem requires that
1517        a T.120 channel be established.
1518 
1519        Note that if the application overrides this it should return a pointer to a
1520        heap variable (using new) as it will be automatically deleted when the
1521        H323Connection is deleted.
1522 
1523        The default behavour returns NULL.
1524       */
1525     virtual OpalT120Protocol * CreateT120ProtocolHandler(
1526       const H323Connection & connection  ///< Connection for which T.120 handler created
1527     ) const;
1528 #endif
1529 
1530 #ifdef H323_T38
1531     /**Create an instance of the T.38 protocol handler.
1532        This is called when the OpenLogicalChannel subsystem requires that
1533        a T.38 fax channel be established.
1534 
1535        Note that if the application overrides this it should return a pointer to a
1536        heap variable (using new) as it will be automatically deleted when the
1537        H323Connection is deleted.
1538 
1539        The default behavour returns NULL.
1540       */
1541     virtual OpalT38Protocol * CreateT38ProtocolHandler(
1542       const H323Connection & connection  ///< Connection for which T.38 handler created
1543     ) const;
1544 #endif
1545 
1546 #if H323_H224
1547 
1548     /** Create an instance of the H.224 protocol handler.
1549         This is called when the subsystem requires that a H.224 channel be established.
1550 
1551         Note that if the application overrides this it should return a pointer to a
1552         heap variable (using new) as it will be automatically deleted when the Connection
1553         is deleted.
1554 
1555         The default behaviour creates a new OpalH224Handler.
1556       */
1557     virtual OpalH224Handler * CreateH224ProtocolHandler(
1558       H323Channel::Directions dir,
1559       H323Connection & connection,
1560       unsigned sessionID
1561     ) const;
1562 
1563     /** On Create an instance of the H.224 handler.
1564         This is called when the subsystem creates a H.224 Handler.
1565 
1566         Use this to derive implementers classes
1567         return false to not create Handler.
1568 
1569      The default behavour returns false
1570       */
1571     virtual PBoolean OnCreateH224Handler(
1572         H323Channel::Directions dir,
1573         const H323Connection & connection,
1574         const PString & id,
1575         H224_Handler * m_handler
1576     ) const;
1577 
1578 
1579 #ifdef H224_H281
1580     /** Create an instance of the H.281 protocol handler.
1581 
1582         *** NOTE This function is depreciated for H323plus 1.26 ***
1583         *** Use OnCreateH224Handler function call instead ***
1584 
1585         This is called when the subsystem requires that a H.224 channel be established.
1586 
1587         Note that if the application overrides this it should return a pointer to a
1588         heap variable (using new) as it will be automatically deleted when the Connection
1589         is deleted.
1590 
1591         The default behaviour creates a new OpalH281Handler.
1592       */
1593     virtual H224_H281Handler * CreateH281ProtocolHandler(
1594       OpalH224Handler & h224Handler
1595     ) const;
1596 #endif
1597 
1598 #endif  // H323_H224
1599 
1600 #ifdef H323_T140
1601     /** Create an instance of the RFC4103 protocol handler.
1602 
1603      The default behavour returns a new H323_RFC4103Handler;
1604      */
1605     virtual H323_RFC4103Handler * CreateRFC4103ProtocolHandler(
1606         H323Channel::Directions dir,
1607         H323Connection & connection,
1608         unsigned sessionID
1609     );
1610 #endif // H323_T140
1611 
1612 #ifdef H323_FILE
1613     /** Open File Transfer Session
1614         Use this to initiate a file transfer.
1615       */
1616     PBoolean OpenFileTransferSession(
1617         const H323FileTransferList & list,      ///< List of Files Requested
1618         const PString & token,                  ///< Connection Token
1619         H323ChannelNumber & num                 ///< Opened Channel number
1620     );
1621 
1622     /** Open a File Transfer Channel.
1623         This is called when the subsystem requires that a File Transfer channel be established.
1624 
1625         An implementer should override this function to facilitate file transfer.
1626         If transmitting, list of files should be populated to notify the channel which files to read.
1627         If receiving, the list of files should be altered to include path information for the storage
1628         of received files.
1629 
1630         The default behaviour returns FALSE to indicate File Transfer is not implemented.
1631       */
1632     virtual PBoolean OpenFileTransferChannel(H323Connection & connection,         ///< Connection
1633                                            PBoolean isEncoder,                    ///< direction of channel
1634                                            H323FileTransferList & filelist        ///< Transfer File List
1635                                            );
1636 #endif
1637   //@}
1638 
1639   /**@name Additional call services */
1640   //@{
1641     /** Called when an endpoint receives a SETUP PDU with a
1642         conference goal of "invite"
1643 
1644         The default behaviour is to return FALSE, which will close the connection
1645      */
1646     virtual PBoolean OnConferenceInvite(
1647       PBoolean sending,                       ///< direction
1648       const H323Connection * connection,  ///< Connection
1649       const H323SignalPDU & setupPDU      ///< PDU message
1650     );
1651 
1652     /** Called when an endpoint receives a SETUP PDU with a
1653         conference goal of "callIndependentSupplementaryService"
1654 
1655         The default behaviour is to return FALSE, which will close the connection
1656      */
1657     virtual PBoolean OnSendCallIndependentSupplementaryService(
1658       const H323Connection * connection,  ///< Connection
1659       H323SignalPDU & pdu                 ///< PDU message
1660     );
1661 
1662     virtual PBoolean OnReceiveCallIndependentSupplementaryService(
1663       const H323Connection * connection,  ///< Connection
1664       const H323SignalPDU & pdu                 ///< PDU message
1665     );
1666 
1667     /** Called when an endpoint receives a SETUP PDU with a
1668         conference goal of "capability_negotiation"
1669 
1670         The default behaviour is to return FALSE, which will close the connection
1671      */
1672     virtual PBoolean OnNegotiateConferenceCapabilities(
1673       const H323SignalPDU & setupPDU
1674     );
1675   //@}
1676 
1677   /**@name Member variable access */
1678   //@{
1679     /**Set the user name to be used for the local end of any connections. This
1680        defaults to the logged in user as obtained from the
1681        PProcess::GetUserName() function.
1682 
1683        Note that this name is technically the first alias for the endpoint.
1684        Additional aliases may be added by the use of the AddAliasName()
1685        function, however that list will be cleared when this function is used.
1686      */
1687     virtual void SetLocalUserName(
1688       const PString & name  ///< Local name of endpoint (prime alias)
1689     );
1690 
1691     /**Get the user name to be used for the local end of any connections. This
1692        defaults to the logged in user as obtained from the
1693        PProcess::GetUserName() function.
1694      */
GetLocalUserName()1695     virtual const PString & GetLocalUserName() const
1696         { return localAliasNames.GetSize() > 0 ? localAliasNames[0] : *(new PString()); }
1697 
1698     /**Add an alias name to be used for the local end of any connections. If
1699        the alias name already exists in the list then is is not added again.
1700 
1701        The list defaults to the value set in the SetLocalUserName() function.
1702        Note that calling SetLocalUserName() will clear the alias list.
1703      */
1704     PBoolean AddAliasName(
1705       const PString & name  ///< New alias name to add
1706     );
1707 
1708     /**Remove an alias name used for the local end of any connections.
1709        defaults to an empty list.
1710      */
1711     PBoolean RemoveAliasName(
1712       const PString & name  ///< New alias namer to add
1713     );
1714 
1715     /**Get the user name to be used for the local end of any connections. This
1716        defaults to the logged in user as obtained from the
1717        PProcess::GetUserName() function.
1718      */
GetAliasNames()1719     const PStringList & GetAliasNames() const { return localAliasNames; }
1720 
1721     /*Get the supported Speaking language
1722 		Use this to set languages supported by the caller/called
1723 	 */
GetLocalLanguages()1724 	const PStringList & GetLocalLanguages() const { return localLanguages; }
1725 
1726     /*Set Whether to use the Q931 Display called and calling numbers instead
1727       of the default AliasAddresses in the caller display.
1728 	 */
SetQ931Display(PBoolean success)1729     void SetQ931Display(PBoolean success)  { useQ931Display = success; }
1730 
1731     /*Determine Whether to use the Q931 Display called and calling numbers instead
1732       of the default AliasAddresses in the caller display.
1733 	 */
UseQ931Display()1734     PBoolean UseQ931Display()  { return useQ931Display; }
1735 
1736 #if P_LDAP
1737 
1738     /**Get the default ILS server to use for user lookup.
1739       */
GetDefaultILSServer()1740     const PString & GetDefaultILSServer() const { return ilsServer; }
1741 
1742     /**Set the default ILS server to use for user lookup.
1743       */
SetDefaultILSServer(const PString & server)1744     void SetDefaultILSServer(
1745       const PString & server
1746       ) { ilsServer = server; }
1747 
1748 #endif
1749 
1750     /**Get the default fast start mode.
1751       */
IsFastStartDisabled()1752     PBoolean IsFastStartDisabled() const
1753       { return disableFastStart; }
1754 
1755     /**Set the default fast start mode.
1756       */
DisableFastStart(PBoolean mode)1757     void DisableFastStart(
1758       PBoolean mode ///< New default mode
1759     ) { disableFastStart = mode; }
1760 
1761     /**Get the default H.245 tunneling mode.
1762       */
IsH245TunnelingDisabled()1763     PBoolean IsH245TunnelingDisabled() const
1764       { return disableH245Tunneling; }
1765 
1766     /**Set the default H.245 tunneling mode.
1767       */
DisableH245Tunneling(PBoolean mode)1768     void DisableH245Tunneling(
1769       PBoolean mode ///< New default mode
1770     ) { disableH245Tunneling = mode; }
1771 
1772     /**Check if H.245 messages are sent in Setup.
1773       */
IsH245inSetupDisabled()1774     PBoolean IsH245inSetupDisabled() const
1775       { return disableH245inSetup; }
1776 
1777     /**Set the default for sending H.245 in Setup.
1778       */
DisableH245inSetup(PBoolean mode)1779     void DisableH245inSetup(
1780       PBoolean mode ///< New default mode
1781     ) { disableH245inSetup = mode; }
1782 
1783     /** Get the default H.245 QoS mode.
1784       */
IsH245QoSDisabled()1785     PBoolean IsH245QoSDisabled() const
1786       { return disableH245QoS; }
1787 
1788     /** Disable H.245 QoS support
1789       */
DisableH245QoS(PBoolean mode)1790     void DisableH245QoS(
1791       PBoolean mode ///< New default mode
1792     ) { disableH245QoS = mode; }
1793 
1794     /**Get the detect in-band DTMF flag.
1795       */
DetectInBandDTMFDisabled()1796     PBoolean DetectInBandDTMFDisabled() const
1797       { return disableDetectInBandDTMF; }
1798 
1799     /**Set the detect in-band DTMF flag.
1800       */
DisableDetectInBandDTMF(PBoolean mode)1801     void DisableDetectInBandDTMF(
1802       PBoolean mode ///< New default mode
1803     ) { disableDetectInBandDTMF = mode; }
1804 
1805     /**Disable RFC2833InBandDTMF.
1806       */
RFC2833InBandDTMFDisabled()1807     PBoolean RFC2833InBandDTMFDisabled() const
1808       { return disableRFC2833InBandDTMF; }
1809 
1810     /**Set the RFC2833 flag.
1811       */
DisableRFC2833InBandDTMF(PBoolean mode)1812     void DisableRFC2833InBandDTMF(
1813       PBoolean mode ///< New default mode
1814     ) { disableRFC2833InBandDTMF = mode; }
1815 
1816    /**Disable extended user input.
1817       */
ExtendedUserInputDisabled()1818     PBoolean ExtendedUserInputDisabled() const
1819       { return disableExtendedUserInput; }
1820 
1821     /**Set the extended user input flag.
1822       */
DisableExtendedUserInput(PBoolean mode)1823     void DisableExtendedUserInput(
1824       PBoolean mode ///< New default mode
1825     ) { disableExtendedUserInput = mode; }
1826 
1827 
1828     /**Get the flag indicating the endpoint can display an amount string.
1829       */
CanDisplayAmountString()1830     PBoolean CanDisplayAmountString() const
1831       { return canDisplayAmountString; }
1832 
1833     /**Set the flag indicating the endpoint can display an amount string.
1834       */
SetCanDisplayAmountString(PBoolean mode)1835     void SetCanDisplayAmountString(
1836       PBoolean mode ///< New default mode
1837     ) { canDisplayAmountString = mode; }
1838 
1839     /**Get the flag indicating the call will automatically clear after a time.
1840       */
CanEnforceDurationLimit()1841     PBoolean CanEnforceDurationLimit() const
1842       { return canEnforceDurationLimit; }
1843 
1844     /**Set the flag indicating the call will automatically clear after a time.
1845       */
SetCanEnforceDurationLimit(PBoolean mode)1846     void SetCanEnforceDurationLimit(
1847       PBoolean mode ///< New default mode
1848     ) { canEnforceDurationLimit = mode; }
1849 
1850 #ifdef H323_RTP_AGGREGATE
1851     /**Set the RTP aggregation size
1852       */
SetRTPAggregatationSize(PINDEX size)1853     void SetRTPAggregatationSize(
1854       PINDEX size            ///< max connections per aggregation thread. Value of 1 or zero disables aggregation
1855     ) { rtpAggregationSize = size; }
1856 
1857     /**Get the RTP aggregation size
1858       */
GetRTPAggregationSize()1859     PINDEX GetRTPAggregationSize() const
1860     { return rtpAggregationSize; }
1861 
1862     /** Get the aggregator used for RTP channels
1863       */
1864     PHandleAggregator * GetRTPAggregator();
1865 #endif
1866 
1867 #ifdef H323_SIGNAL_AGGREGATE
1868     /**Set the signalling aggregation size
1869       */
SetSignallingAggregationSize(PINDEX size)1870     void SetSignallingAggregationSize(
1871       PINDEX size            ///< max connections per aggregation thread. Value of 1 or zero disables aggregation
1872     ) { signallingAggregationSize = size; }
1873 
1874     /**Get the RTP aggregation size
1875       */
GetSignallingAggregationSize()1876     PINDEX GetSignallingAggregationSize() const
1877     { return signallingAggregationSize; }
1878 
1879     /** Get the aggregator used for signalling channels
1880       */
1881     PHandleAggregator * GetSignallingAggregator();
1882 #endif
1883 
1884 #ifdef H323_H450
1885 
1886   /**@name H.450.11 Call Intrusion */
1887     /**Get Call Intrusion Protection Level of the end point.
1888       */
GetCallIntrusionProtectionLevel()1889     unsigned GetCallIntrusionProtectionLevel() const { return callIntrusionProtectionLevel; }
1890 
1891     /**Set Call Intrusion Protection Level of the end point.
1892       */
SetCallIntrusionProtectionLevel(unsigned level)1893     void SetCallIntrusionProtectionLevel(
1894       unsigned level  ///< New level from 0 to 3
1895     ) { PAssert(level<=3, PInvalidParameter); callIntrusionProtectionLevel = level; }
1896 
1897     /**Called from H.450 OnReceivedInitiateReturnError
1898       */
1899     virtual void OnReceivedInitiateReturnError();
1900 
1901   //@}
1902 
1903 #endif // H323_H450
1904 
1905 #ifdef H323_AUDIO_CODECS
1906 #ifdef P_AUDIO
1907 
1908     /**Set the name for the sound channel to be used for output.
1909        If the name is not suitable for use with the PSoundChannel class then
1910        the function will return FALSE and not change the device.
1911 
1912        This defaults to the value of the PSoundChannel::GetDefaultDevice()
1913        function.
1914      */
1915     virtual PBoolean SetSoundChannelPlayDevice(const PString & name);
1916     virtual PBoolean SetSoundChannelPlayDriver(const PString & name);
1917 
1918     /**Get the name for the sound channel to be used for output.
1919        This defaults to the value of the PSoundChannel::GetDefaultDevice()
1920        function.
1921      */
GetSoundChannelPlayDevice()1922     const PString & GetSoundChannelPlayDevice() const { return soundChannelPlayDevice; }
GetSoundChannelPlayDriver()1923     const PString & GetSoundChannelPlayDriver() const { return soundChannelPlayDriver; }
1924 
1925     /**Set the name for the sound channel to be used for input.
1926        If the name is not suitable for use with the PSoundChannel class then
1927        the function will return FALSE and not change the device.
1928 
1929        This defaults to the value of the PSoundChannel::GetDefaultDevice()
1930        function.
1931      */
1932     virtual PBoolean SetSoundChannelRecordDevice(const PString & name);
1933     virtual PBoolean SetSoundChannelRecordDriver(const PString & name);
1934 
1935     /**Get the name for the sound channel to be used for input.
1936        This defaults to the value of the PSoundChannel::GetDefaultDevice()
1937        function.
1938      */
GetSoundChannelRecordDevice()1939     const PString & GetSoundChannelRecordDevice() const { return soundChannelRecordDevice; }
GetSoundChannelRecordDriver()1940     const PString & GetSoundChannelRecordDriver() const { return soundChannelRecordDriver; }
1941 
1942     /**Get default the sound channel buffer depth.
1943       */
GetSoundChannelBufferDepth()1944     unsigned GetSoundChannelBufferDepth() const { return soundChannelBuffers; }
1945 
1946     /**Set the default sound channel buffer depth.
1947       */
1948     void SetSoundChannelBufferDepth(
1949       unsigned depth    ///< New depth
1950     );
1951 
1952 #endif  // P_AUDIO
1953 
1954     /**Get the default silence detection mode.
1955       */
GetSilenceDetectionMode()1956     H323AudioCodec::SilenceDetectionMode GetSilenceDetectionMode() const
1957       { return defaultSilenceDetection; }
1958 
1959     /**Set the default silence detection mode.
1960       */
SetSilenceDetectionMode(H323AudioCodec::SilenceDetectionMode mode)1961     void SetSilenceDetectionMode(
1962       H323AudioCodec::SilenceDetectionMode mode ///< New default mode
1963     ) { defaultSilenceDetection = mode; }
1964 
1965 #endif  // H323_AUDIO_CODECS
1966 
1967     /**Get the default mode for sending User Input Indications.
1968       */
GetSendUserInputMode()1969     H323Connection::SendUserInputModes GetSendUserInputMode() const { return defaultSendUserInputMode; }
1970 
1971     /**Set the default mode for sending User Input Indications.
1972       */
SetSendUserInputMode(H323Connection::SendUserInputModes mode)1973     void SetSendUserInputMode(H323Connection::SendUserInputModes mode) { defaultSendUserInputMode = mode; }
1974 
1975 #ifdef H323_AUDIO_CODECS
1976 
1977     /**See if should auto-start receive audio channels on connection.
1978      */
CanAutoStartReceiveAudio()1979     PBoolean CanAutoStartReceiveAudio() const { return autoStartReceiveAudio; }
1980 
1981     /**See if should auto-start transmit audio channels on connection.
1982      */
CanAutoStartTransmitAudio()1983     PBoolean CanAutoStartTransmitAudio() const { return autoStartTransmitAudio; }
1984 
1985 #endif
1986 
1987 #ifdef H323_VIDEO
1988 
1989     /**See if should auto-start receive video channels on connection.
1990      */
CanAutoStartReceiveVideo()1991     PBoolean CanAutoStartReceiveVideo() const { return autoStartReceiveVideo; }
1992 
1993     /**See if should auto-start transmit video channels on connection.
1994      */
CanAutoStartTransmitVideo()1995     PBoolean CanAutoStartTransmitVideo() const { return autoStartTransmitVideo; }
1996 
1997 #ifdef H323_H239
1998     /**See if should auto-start receive extended Video channels on connection.
1999      */
CanAutoStartReceiveExtVideo()2000     PBoolean CanAutoStartReceiveExtVideo() const { return autoStartReceiveExtVideo; }
2001 
2002     /**See if should auto-start transmit extended Video channels on connection.
2003      */
CanAutoStartTransmitExtVideo()2004     PBoolean CanAutoStartTransmitExtVideo() const { return autoStartTransmitExtVideo; }
2005 
2006 #endif  // H323_H239
2007 #endif  // H323_VIDEO
2008 
2009 #ifdef H323_T38
2010 
2011     /**See if should auto-start receive fax channels on connection.
2012      */
CanAutoStartReceiveFax()2013     PBoolean CanAutoStartReceiveFax() const { return autoStartReceiveFax; }
2014 
2015     /**See if should auto-start transmit fax channels on connection.
2016      */
CanAutoStartTransmitFax()2017     PBoolean CanAutoStartTransmitFax() const { return autoStartTransmitFax; }
2018 
2019 #endif // H323_T38
2020 
2021     /**See if should automatically do call forward of connection.
2022      */
CanAutoCallForward()2023     PBoolean CanAutoCallForward() const { return autoCallForward; }
2024 
2025     /**Get the set of listeners (incoming call transports) for this endpoint.
2026      */
GetListeners()2027     const H323ListenerList & GetListeners() const { return listeners; }
2028 
2029     /**Get the current capability table for this endpoint.
2030      */
GetCapabilities()2031     const H323Capabilities & GetCapabilities() const { return capabilities; }
2032 
2033     /**Endpoint types.
2034      */
2035     enum TerminalTypes {
2036       e_TerminalOnly = 50,
2037       e_TerminalAndMC = 70,
2038       e_GatewayOnly = 60,
2039       e_GatewayAndMC = 80,
2040       e_GatewayAndMCWithDataMP = 90,
2041       e_GatewayAndMCWithAudioMP = 100,
2042       e_GatewayAndMCWithAVMP = 110,
2043       e_GatekeeperOnly = 120,
2044       e_GatekeeperWithDataMP = 130,
2045       e_GatekeeperWithAudioMP = 140,
2046       e_GatekeeperWithAVMP = 150,
2047       e_MCUOnly = 160,
2048       e_MCUWithDataMP = 170,
2049       e_MCUWithAudioMP = 180,
2050       e_MCUWithAVMP = 190,
2051 #ifdef H323_H461
2052       e_SET_H461 = 240
2053 #endif
2054     };
2055 
2056     /**Get the endpoint terminal type.
2057      */
GetTerminalType()2058     TerminalTypes GetTerminalType() const { return terminalType; }
2059 
2060     /**Set the endpoint terminal type.
2061     */
2062     void SetTerminalType(TerminalTypes type);
2063 
2064     /**Determine if endpoint is terminal type.
2065      */
2066     PBoolean IsTerminal() const;
2067 
2068     /**Determine if SET is terminal type.
2069      */
2070     PBoolean IsSimpleEndPoint() const;
2071 
2072     /**Determine if endpoint is gateway type.
2073      */
2074     PBoolean IsGateway() const;
2075 
2076     /**Determine if endpoint is gatekeeper type.
2077      */
2078     PBoolean IsGatekeeper() const;
2079 
2080     /**Determine if endpoint is gatekeeper type.
2081      */
2082     PBoolean IsMCU() const;
2083 
2084 #ifdef H323_AUDIO_CODECS
2085     /**Get the default maximum audio jitter delay parameter.
2086        Defaults to 50ms
2087      */
GetMinAudioJitterDelay()2088     unsigned GetMinAudioJitterDelay() const { return minAudioJitterDelay; }
2089 
2090     /**Get the default maximum audio delay jitter parameter.
2091        Defaults to 250ms.
2092      */
GetMaxAudioJitterDelay()2093     unsigned GetMaxAudioJitterDelay() const { return maxAudioJitterDelay; }
2094 
2095     /**Set the maximum audio delay jitter parameter.
2096      */
2097     void SetAudioJitterDelay(
2098       unsigned minDelay,   ///< New minimum jitter buffer delay in milliseconds
2099       unsigned maxDelay    ///< New maximum jitter buffer delay in milliseconds
2100     );
2101 #endif
2102 
2103     /**Get the initial bandwidth parameter.
2104      */
GetInitialBandwidth()2105     unsigned GetInitialBandwidth() const { return initialBandwidth; }
2106 
2107     /**Get the initial bandwidth parameter.
2108      */
SetInitialBandwidth(unsigned bandwidth)2109     void SetInitialBandwidth(unsigned bandwidth) { initialBandwidth = bandwidth; }
2110 
2111     /**Set the BitRate to appear in the BearerCapabilities for Setup messages
2112      */
OnBearerCapabilityTransferRate(unsigned & bitRate)2113     virtual void OnBearerCapabilityTransferRate(unsigned & bitRate)
2114         { if (initialBandwidth > bitRate) bitRate = initialBandwidth; }
2115 
2116 #ifdef H323_VIDEO
OnSetInitialBandwidth(H323VideoCodec *)2117     virtual void OnSetInitialBandwidth(H323VideoCodec * /*codec*/) {};
2118 #endif
2119 
2120     /**Called when an outgoing PDU requires a feature set
2121      */
2122     virtual PBoolean OnSendFeatureSet(unsigned, H225_FeatureSet &, PBoolean);
2123 
2124     /**Called when an incoming PDU contains a feature set
2125      */
2126     virtual void OnReceiveFeatureSet(unsigned, const H225_FeatureSet &, PBoolean = false);
2127 
2128 #ifdef H323_H460
2129     /**Get the complete list of Gatekeeper features
2130       */
2131     H460_FeatureSet * GetGatekeeperFeatures();
2132 #endif
2133 
2134     /**Load the Base FeatureSet usually called when you initialise the endpoint prior to
2135        registering with a gatekeeper.
2136       */
2137     virtual void LoadBaseFeatureSet();
2138 
2139     /**Callback when creating Feature Instance. This can be used to disable features on
2140        a case by case basis by returning FALSE
2141        Default returns TRUE
2142       */
2143     virtual PBoolean OnFeatureInstance(int instType, const PString & identifer);
2144 
2145     /**Handle Unsolicited Information PDU received on the signal listening socket not
2146        associated with a connection.
2147      */
2148     virtual PBoolean HandleUnsolicitedInformation(const H323SignalPDU & pdu);
2149 
2150 #ifdef H323_H460
2151     /** Get the Endpoint FeatureSet
2152         This creates a new instance of the featureSet
2153      */
GetFeatureSet()2154     H460_FeatureSet * GetFeatureSet() {  return features.DeriveNewFeatureSet(); };
2155 
2156     /** Is the FeatureSet disabled
2157       */
FeatureSetDisabled()2158     PBoolean FeatureSetDisabled()  {  return disableH460; }
2159 
2160     /** Disable all FeatureSets. Use this for pre H323v4 interoperability
2161       */
FeatureSetDisable()2162     void FeatureSetDisable()  {  disableH460 = TRUE;  }
2163 
2164     /** Feature Callback
2165       */
FeatureCallBack(const PString & FeatID,PINDEX msgID,const PString & message)2166     virtual void FeatureCallBack(const PString & FeatID,        ///< Feature Identifier
2167                                 PINDEX msgID,                    ///< Message Identifer
2168                                 const PString & message            ///< Message
2169                                 ) {};
2170 
2171 #ifdef H323_H46017
2172 
2173     /** Create a H.460.17 TCP connection
2174         to the gatekeeper to tunnel RAS messages through
2175       */
2176     PBoolean H46017CreateConnection(
2177                                const PString & gatekeeper,   ///< Gatekeeper IP/URL (incl port if not SRV) to connect to
2178                                PBoolean useSRV = true        ///< Whether to use h323rs._tcp SRV records to resolve
2179                                );
2180 
RegisteredWithH46017()2181     PBoolean RegisteredWithH46017() const { return m_registeredWithH46017; }
TryingWithH46017()2182     PBoolean TryingWithH46017() const { return m_tryingH46017; }
GetH46017Transport()2183     H323Transport * GetH46017Transport() { return m_h46017Transport; }
2184 #endif
2185 
2186 #ifdef H323_H46018
2187 
2188     /** Disable H.460.18 Feature. (By Default it is enabled)
2189       */
2190     void H46018Enable(PBoolean enable);
2191 
2192     /** Query whether we are using H.460.18
2193       */
2194     PBoolean H46018IsEnabled();
2195 
2196     /** Signal that H.460.18 has been received. ie. We are behind a NAT/FW
2197       */
H46018Received()2198     void H46018Received() {};
2199 
2200     /** Whether H.460.18 is in Operation for this call
2201       */
2202     PBoolean H46018InOperation();
2203 #endif
2204 
2205 #ifdef H323_H46019M
2206     /** Disable H.460.19 Multiplex Feature. (By Default it is enabled)
2207       */
2208     void H46019MEnable(PBoolean enable);
2209 
2210     /** Query whether we are using H.460.19 Multiplexing
2211       */
2212     PBoolean H46019MIsEnabled();
2213 
2214     /** Enable H.460.19 Multiplex Send. (By Default it is disabled)
2215       */
2216     void H46019MSending(PBoolean enable);
2217 
2218     /** Query whether we are using H.460.19 Multiplex Sending (H.460.19M Must be enabled)
2219       */
2220     PBoolean H46019MIsSending();
2221 #endif
2222 
2223 #ifdef H323_H46023
2224     /** Disable H.460.23 Feature. (By Default it is enabled)
2225       */
2226     void H46023Enable(PBoolean enable);
2227 
2228     /** Query whether we are using H.460.23
2229       */
2230     PBoolean H46023IsEnabled();
2231 
2232     /** Based on the available information select the appropriate NAT Method.
2233         if H.460.17 for signalling and H.460.23 NAT test == blocked then H.460.26 (tunnel in signalling)
2234         if H.460.17 for signalling and H.460.23 NAT test == blocked but Alternate (UPnP) then H.460.24 (directMedia)
2235     `   If H.460.17 for signalling and H.460.23 NAT test <> blocked then H.460.19 (classic H.460.18/.19)
2236 
2237         if H.460.18 for signalling and H.460.23 NAT test <> blocked then H.460.24 available
2238         if H.460.18 for signalling and H.460.23 NAT test == blocked then Media failure!
2239 
2240         Override to change implementors logic
2241       */
2242     virtual PBoolean H46023NatMethodSelection(const PString & method);
2243 #endif
2244 
2245 #ifdef H323_H46025
2246     /** Disable H.460.25 Feature. (By Default it is disabled)
2247       */
2248     void H46025Enable(PBoolean enable);
2249 
2250     /** Query whether we are using H.460.25
2251       */
2252     PBoolean H46025IsEnabled();
2253 
2254     /** Get Device Information
2255       */
2256     virtual bool H46025DeviceInformation(H323_H46025_Message::Device & device);
2257 
2258     /** Get Civic Information
2259       */
2260     virtual bool H46025CivicInformation(H323_H46025_Message::Civic & civic);
2261 
2262     /** Get GPS Information
2263       */
2264     virtual bool H46025GPSInformation(H323_H46025_Message::Geodetic & gps);
2265 
2266 #endif
2267 
2268 #ifdef H323_H46026
2269     /** Disable H.460.26 Feature. (By Default it is enabled)
2270       */
H46026Enable(PBoolean enable)2271     void H46026Enable(PBoolean enable) { m_h46026enabled = enable; }
2272 
2273     /** Query whether we are using H.460.26
2274       */
H46026IsEnabled()2275     PBoolean H46026IsEnabled() const { return m_h46026enabled; }
2276 #endif
2277 
2278 #ifdef H323_H460IM
2279 
2280     /** Main function to enable the feature
2281      */
EnableIM()2282     void EnableIM() { m_IMenabled = true; };
2283 
2284     /** Callback from the H460 feature to check if the
2285         feature is enabled
2286       */
IMisDisabled()2287     PBoolean IMisDisabled() { return !m_IMenabled; };
2288 
2289 	/** Internal Flag to indicate the current call is an IM call
2290       */
IsIMCall()2291     PBoolean IsIMCall() { return m_IMcall;  }
2292 
2293 	/** Internal Flag to set the current call as an IM call
2294       */
SetIMCall(PBoolean state)2295     void SetIMCall(PBoolean state) { m_IMcall = state; }
2296 
2297     /** Main call to open IM session
2298       */
2299     virtual PBoolean IMMakeCall(const PString & number,
2300         PBoolean session,  // set to true if persistent
2301         PString & token,
2302         const PString & msg = PString());
2303 
2304 	/** Send a message
2305       */
2306     virtual void IMSend(const PString & msg);
2307 
2308     /** An IM Message has been received
2309       */
2310     virtual void IMReceived(const PString & token, const PString & msg, PBoolean session = TRUE);
2311 
2312 
2313     virtual void IMWrite(PBoolean start);
2314     virtual void IMCloseSession();
2315 
2316     // Internal
2317     virtual void IMWriteFacility(H323Connection * connection);
2318     virtual void IMOpenSession(const PString & token);
2319     virtual void IMClearConnection(const PString & token);
2320     virtual void IMSupport(const PString & token);
2321     virtual void IMSessionInvite(const PString & username);
2322 
2323     // Call backs
2324     virtual PBoolean IMWriteEvent(PBoolean & state);
2325 
2326     // Events
2327     virtual void IMSessionDetails(const PString & token,
2328         const PString & number,
2329         const PString & CallerID,
2330         const PString & enc
2331         );
2332 
2333     virtual void IMSessionOpen(const PString & token);
2334     virtual void IMSessionClosed(const PString & token);
2335     virtual void IMSessionWrite(const PString & token, PBoolean state);
2336     virtual void IMSessionError(const PString & token, int reason = 0);
2337 
2338 
2339     /** An alert a message has been successfully sent */
2340     virtual void IMSent(const PString & token, PBoolean success, int reason = 0);
2341 
2342     // Events to pass out.
2343     enum {
2344         uiIMIdle = 0,
2345         uiIMOpen = 1,
2346         uiIMClose = 2,
2347         uiIMStartWrite = 3,
2348         uiIMEndWrite = 4,
2349         uiIMQuick = 5
2350     } uiIMstate;
2351 
2352     // Events to the user
OnIMSessionState(const PString & session,const short & state)2353     virtual void OnIMSessionState(const PString & session, const short & state) {};
OnIMReceived(const PString & session,const PString & message)2354     virtual void OnIMReceived(const PString & session, const PString & message) {};
OnIMSent(const PString & session,PBoolean success,const short & errcode)2355     virtual void OnIMSent(const PString & session, PBoolean success, const short & errcode) {};
OnIMSessionDetails(const PString & token,const PString & number,const PString & CallerID,const PString & enc)2356     virtual void OnIMSessionDetails(const PString & token, const PString & number,
2357         const PString & CallerID, const PString & enc) {};
OnIMSessionError(const PString & token,const short & reason)2358     virtual void OnIMSessionError(const PString & token, const short & reason) {};
2359 
2360 #endif
2361 
2362 #ifdef H323_H460P
2363 
2364     /** Get the presence handler. By default it returns NULL
2365         Implementor must create an instance of the presencehandler
2366         to enable presence
2367       */
GetPresenceHandler()2368     H460PresenceHandler * GetPresenceHandler()  { return presenceHandler; }
2369 
2370 	enum presenceStates {
2371         e_preHidden,
2372         e_preAvailable,
2373         e_preOnline,
2374         e_preOffline,
2375         e_preOnCall,
2376         e_preVoiceMail,
2377         e_preNotAvailable,
2378         e_preAway,
2379         e_preGeneric
2380 	};
2381 
2382     /** Set the local Presence State.
2383         Calling this will enable Presence in the endpoint
2384       */
2385     void PresenceSetLocalState(const PStringList & alias, presenceStates localstate, const PString & localdisplay = PString(), PBoolean updateOnly = false);
2386 
2387     enum presenceInstruction {
2388         e_subscribe,
2389         e_unsubscribe,
2390         e_block,
2391         e_unblock
2392     };
2393 
2394     enum presenceFeature {
2395         e_preAudio,
2396         e_preVideo,
2397         e_preExtVideo,
2398         e_preData
2399     };
2400 
2401     struct presenceLocale {
2402         PString        m_locale;
2403         PString        m_region;
2404         PString        m_country;
2405         PString        m_countryCode;
2406         PString        m_latitude;
2407         PString        m_longitude;
2408         PString        m_elevation;
2409     };
2410 
2411     void PresenceAddFeature(presenceFeature feat);
2412 
2413     void PresenceAddFeatureH460();
2414 
2415     void PresenceSetLocale(const presenceLocale & info);
2416 
2417     /** Set Presence Instructions.
2418       */
2419     void PresenceSetInstruction(const PString & epalias,
2420                                 unsigned type,
2421                                 const PString & alias,
2422                                 const PString & display);
2423 
2424     void PresenceSetInstruction(const PString & epalias,
2425                                 unsigned type,
2426                                 const PStringList & list,
2427                                  PBoolean autoSend = true);
2428 
2429     /** Submit Presence Authorizations.
2430       */
2431     void PresenceSendAuthorization(const OpalGloballyUniqueID & id,
2432                                     const PString & epalias,
2433                                     PBoolean approved,
2434                                     const PStringList & subscribe);
2435 
2436     /** Received Notifications
2437       */
2438     virtual void PresenceNotification(const PString & locAlias,
2439                                     const PString & subAlias,
2440                                     unsigned state,
2441                                     const PString & display);
2442 
2443     /** Received Instructions
2444       */
2445     virtual void PresenceInstruction(const PString & locAlias,
2446                                     unsigned type,
2447                                     const PString & subAlias,
2448                                     const PString & subDisplay);
2449 
2450     virtual void PresenceInstruction(const PString & locAlias,
2451                                     unsigned type,
2452                                     const PString & subAlias,
2453                                     const PString & subDisplay,
2454                                     const PString & subAvatar
2455                                     );
2456 
2457     virtual void PresenceInstruction(const PString & locAlias,
2458                                     unsigned type,
2459                                     const PString & subAlias,
2460                                     const PString & subDisplay,
2461                                     const PString & subAvatar,
2462                                     unsigned category
2463                                     );
2464 
2465     /** Received Request for authorization
2466       */
2467     virtual void PresenceAuthorization(const OpalGloballyUniqueID & id,
2468                                     const PString & locAlias,
2469                                     const std::map<PString,PresSubDetails> & Aliases);
2470 #endif
2471 
2472 #ifdef H323_H460PRE
2473 
2474     /** Get the registration priority
2475       */
2476     unsigned GetRegistrationPriority();
2477 
2478     /** Set the registration priority from 0-9 default 0
2479       */
2480     void SetRegistrationPriority(unsigned value);
2481 
2482     /** Get Pre-emption status
2483       */
2484     PBoolean GetPreempt();
2485 
2486     /** Set to Preempt other registration
2487       */
2488     void SetPreempt(PBoolean topreempt);
2489 
2490     /** Set this registration to be Preempted
2491       */
2492     void SetPreempted(PBoolean ispreempted);
2493 
2494     /** Is this registration Preempted
2495       */
2496     PBoolean IsPreempted();
2497 
2498     /**Prempt the previous registration
2499       */
2500     void PreemptRegistration();
2501 
2502     /** Notification of the local registration being PreEmpted.
2503         Note this does not stop the gatekeeper periodically retrying to register
2504         Once the other device has deregistered then registration will restored.
2505       */
2506     virtual void OnNotifyPreempt(PBoolean unregister);
2507 
2508     /** Notification of Priority.
2509         This provides an opportunity to preEmpt the previous
2510         registration. CAll PreemptRegistration() to preEmpt.
2511       */
2512     virtual void OnNotifyPriority();
2513 
2514 
2515 #endif  // H323_H460PRE
2516 
2517 #ifdef H323_H461
2518     void SetASSETEnabled(PBoolean success);
2519     PBoolean IsASSETEnabled();
2520 
2521     enum H461Mode {
2522         e_H461Disabled,
2523         e_H461EndPoint,
2524         e_H461ASSET
2525     };
2526 
2527     virtual void SetEndPointASSETMode(H461Mode mode);
2528     virtual H461Mode GetEndPointASSETMode();
2529 
2530     H461DataStore * GetASSETDataStore();
2531     void SetASSETDataStore(H461DataStore * dataStore);
2532 #endif  // H323_H461
2533 
2534 #endif
2535 
2536 
2537 #ifdef H323_AEC
AECEnabled()2538     PBoolean AECEnabled()   {  return enableAEC; }
2539 
SetAECEnabled(PBoolean enabled)2540     void SetAECEnabled(PBoolean enabled)  { enableAEC = enabled; }
2541 #endif
2542 
2543 #ifdef H323_TLS
2544     void EnableIPSec(PBoolean enable);
2545 
2546     PBoolean TLS_SetCAFile(const PFilePath & caFile);
2547     PBoolean TLS_SetCADirectory(const PDirectory & dir);
2548     PBoolean TLS_AddCACertificate(const PString & caData);
2549     PBoolean TLS_SetCertificate(const PFilePath & certDir);
2550     PBoolean TLS_SetPrivateKey(const PFilePath & privFile, const PString & password);
2551     PBoolean TLS_SetCipherList(const PString & ciphers);
2552     PBoolean TLS_SetDHParameters(const PFilePath & pkcs3);
2553     PBoolean TLS_SetDHParameters(const PBYTEArray & dh_p, const PBYTEArray & dh_g);
2554     PBoolean TLS_Initialise(const PIPSocket::Address & binding = PIPSocket::GetDefaultIpAny(),
2555                             WORD port = DefaultTLSPort);
2556 
2557     PBoolean InitialiseTransportContext();
2558     PSSLContext * GetTransportContext();
2559 
OnSecureSignallingChannel(bool)2560     virtual void OnSecureSignallingChannel(bool /* isSecured */) {};
2561 #endif
2562 
2563     PBoolean IsTLSEnabled();
2564     PBoolean IsIPSecEnabled();
2565     void SetTLSMediaPolicy(H323TransportSecurity::Policy policy);
2566     H323TransportSecurity * GetTransportSecurity();
2567 
2568 #ifdef H323_FRAMEBUFFER
2569     void EnableVideoFrameBuffer(PBoolean enable);
2570     PBoolean HasVideoFrameBuffer();
2571 #endif
2572 
2573 #ifdef H323_UPnP
2574     /**Set UPnP
2575       */
2576     void SetUPnP(PBoolean active);
2577 
2578     /**Initialise UPnP
2579       */
2580     PBoolean InitialiseUPnP();
2581 
2582     /**On UPnP detected and tested.
2583        return true to make available.
2584       */
2585     virtual PBoolean OnUPnPAvailable(const PString & device,
2586                              const PIPSocket::Address & publicIP,
2587                              PNatMethod_UPnP * nat);
2588 #endif
2589 
2590 #ifdef P_STUN
2591 
2592     /**Return the STUN server to use.
2593        Returns NULL if address is a local address as per IsLocalAddress().
2594        Always returns the STUN server if address is zero.
2595        Note, the pointer is NOT to be deleted by the user.
2596       */
2597     PSTUNClient * GetSTUN(
2598       const PIPSocket::Address & address = 0
2599     ) const;
2600 
2601     /**Set the STUN server address, is of the form host[:port]
2602       */
2603     void SetSTUNServer(
2604       const PString & server
2605     );
2606 
2607     /**Type of NAT detected (if available) when initialing STUN Client
2608       */
STUNNatType(int)2609     virtual PBoolean STUNNatType(int /*type*/) { return FALSE; };
2610 
2611     /** Retrieve the first available
2612         NAT Traversal Techniques
2613      */
2614     PNatMethod * GetPreferedNatMethod(
2615         const PIPSocket::Address & address = 0
2616     );
2617 
2618     /** Get the Nat Methods List
2619        */
2620     H323NatStrategy & GetNatMethods() const;
2621 
NATMethodCallBack(const PString &,PINDEX,const PString &)2622     virtual void NATMethodCallBack(const PString & /*NatID*/,    ///< Method Identifier
2623                                 PINDEX /*msgID*/,                ///< Message Identifer
2624                                 const PString & /*message*/        ///< Message
2625                                 ) {};
2626 
2627 #endif // P_STUN
2628 
OnUnsolicitedInformation(const H323SignalPDU &)2629     virtual PBoolean OnUnsolicitedInformation(const H323SignalPDU & /*pdu*/)
2630     { return FALSE; }
2631 
2632     /**Determine if the address is "local", ie does not need STUN
2633      */
2634     virtual PBoolean IsLocalAddress(
2635       const PIPSocket::Address & remoteAddress
2636     ) const;
2637 
2638     /**Provide TCP address translation hook
2639      */
TranslateTCPAddress(PIPSocket::Address &,const PIPSocket::Address &)2640     virtual void TranslateTCPAddress(
2641       PIPSocket::Address & /*localAddr*/,
2642       const PIPSocket::Address & /*remoteAddr */
2643     ) { }
2644     void InternalTranslateTCPAddress(
2645       PIPSocket::Address & /*localAddr*/,
2646       const PIPSocket::Address & /*remoteAddr */,
2647       const H323Connection * conn = NULL
2648     );
2649 
2650     /**Provide TCP Port translation hook
2651      */
TranslateTCPPort(WORD &,const PIPSocket::Address &)2652     virtual void TranslateTCPPort(
2653         WORD & /*ListenPort*/,                     ///* Local listening port
2654         const PIPSocket::Address & /*remoteAddr*/  ///* Remote address
2655     ) { };
2656 
2657     /**Get the TCP port number base for H.245 channels
2658      */
GetTCPPortBase()2659     WORD GetTCPPortBase() const { return tcpPorts.base; }
2660 
2661     /**Get the TCP port number base for H.245 channels.
2662      */
GetTCPPortMax()2663     WORD GetTCPPortMax() const { return tcpPorts.max; }
2664 
2665     /**Set the TCP port number base and max for H.245 channels.
2666      */
2667     void SetTCPPorts(unsigned tcpBase, unsigned tcpMax);
2668 
2669     /**Get the next TCP port number for H.245 channels
2670      */
2671     WORD GetNextTCPPort();
2672 
2673     /**Get the UDP port number base for RAS channels
2674      */
GetUDPPortBase()2675     WORD GetUDPPortBase() const { return udpPorts.base; }
2676 
2677     /**Get the UDP port number base for RAS channels.
2678      */
GetUDPPortMax()2679     WORD GetUDPPortMax() const { return udpPorts.max; }
2680 
2681     /**Set the UDP port number base and max for RAS channels.
2682      */
2683     void SetUDPPorts(unsigned udpBase, unsigned udpMax);
2684 
2685     /**Get the next UDP port number for RAS channels
2686      */
2687     WORD GetNextUDPPort();
2688 
2689     /**Get the UDP port number base for RTP channels.
2690      */
GetRtpIpPortBase()2691     WORD GetRtpIpPortBase() const { return rtpIpPorts.base; }
2692 
2693     /**Get the max UDP port number for RTP channels.
2694      */
GetRtpIpPortMax()2695     WORD GetRtpIpPortMax() const { return rtpIpPorts.max; }
2696 
2697     /**Set the UDP port number base and max for RTP channels.
2698      */
2699     void SetRtpIpPorts(unsigned udpBase, unsigned udpMax);
2700 
2701     /**Get the UDP port number pair for RTP channels.
2702      */
2703     WORD GetRtpIpPortPair();
2704 
2705 #ifdef H323_H46019M
2706    /**Set the UDP port number base for Multiplex RTP/RTCP channels.
2707      */
2708     void SetMultiplexPort(unsigned rtpPort);
2709 
2710    /**Get the UDP port number base for Multiplex RTP/RTCP channels.
2711      */
2712     WORD GetMultiplexPort();
2713 
2714    /**Get next Multiplex RTP/RTCP channel ID.
2715       Each call indexes the counter by 1;
2716      */
2717     unsigned GetMultiplexID();
2718 #endif
2719 
2720     /**Get the IP Type Of Service byte for RTP channels.
2721      */
GetRtpIpTypeofService()2722     BYTE GetRtpIpTypeofService() const { return rtpIpTypeofService; }
2723 
2724     /**Set the IP Type Of Service byte for RTP channels.
2725      */
SetRtpIpTypeofService(unsigned tos)2726     void SetRtpIpTypeofService(unsigned tos) { rtpIpTypeofService = (BYTE)tos; }
2727 
2728     /**Get the IP Type Of Service byte for TCP channels.
2729      */
GetTcpIpTypeofService()2730     BYTE GetTcpIpTypeofService() const { return tcpIpTypeofService; }
2731 
2732     /**Set the IP Type Of Service byte for TCP channels.
2733      */
SetTcpIpTypeofService(unsigned tos)2734     void SetTcpIpTypeofService(unsigned tos) { tcpIpTypeofService = (BYTE)tos; }
2735 
2736     /** Get the default timeout for connecting via TCP
2737       */
GetSignallingChannelConnectTimeout()2738     const PTimeInterval & GetSignallingChannelConnectTimeout() const { return signallingChannelConnectTimeout; }
2739 
2740     /**Get the default timeout for calling another endpoint.
2741      */
GetSignallingChannelCallTimeout()2742     const PTimeInterval & GetSignallingChannelCallTimeout() const { return signallingChannelCallTimeout; }
2743 
2744     /**Get the default timeout for incoming H.245 connection.
2745      */
GetControlChannelStartTimeout()2746     const PTimeInterval & GetControlChannelStartTimeout() const { return controlChannelStartTimeout; }
2747 
2748     /**Get the default timeout for waiting on an end session.
2749      */
GetEndSessionTimeout()2750     const PTimeInterval & GetEndSessionTimeout() const { return endSessionTimeout; }
2751 
2752     /**Get the default timeout for master slave negotiations.
2753      */
GetMasterSlaveDeterminationTimeout()2754     const PTimeInterval & GetMasterSlaveDeterminationTimeout() const { return masterSlaveDeterminationTimeout; }
2755 
2756     /**Get the default retries for H245 master slave negotiations.
2757      */
GetMasterSlaveDeterminationRetries()2758     unsigned GetMasterSlaveDeterminationRetries() const { return masterSlaveDeterminationRetries; }
2759 
2760     /**Get the default timeout for H245 capability exchange negotiations.
2761      */
GetCapabilityExchangeTimeout()2762     const PTimeInterval & GetCapabilityExchangeTimeout() const { return capabilityExchangeTimeout; }
2763 
2764     /**Get the default timeout for H245 logical channel negotiations.
2765      */
GetLogicalChannelTimeout()2766     const PTimeInterval & GetLogicalChannelTimeout() const { return logicalChannelTimeout; }
2767 
2768     /**Get the default timeout for H245 request mode negotiations.
2769      */
GetRequestModeTimeout()2770     const PTimeInterval & GetRequestModeTimeout() const { return logicalChannelTimeout; }
2771 
2772     /**Get the default timeout for H245 round trip delay negotiations.
2773      */
GetRoundTripDelayTimeout()2774     const PTimeInterval & GetRoundTripDelayTimeout() const { return roundTripDelayTimeout; }
2775 
2776     /**Get the default rate H245 round trip delay is calculated by connection.
2777      */
GetRoundTripDelayRate()2778     const PTimeInterval & GetRoundTripDelayRate() const { return roundTripDelayRate; }
2779 
2780     /**Get the flag for clearing a call if the round trip delay calculation fails.
2781      */
ShouldClearCallOnRoundTripFail()2782     PBoolean ShouldClearCallOnRoundTripFail() const { return clearCallOnRoundTripFail; }
2783 
2784     /**Get the amount of time with no media that should cause call to clear
2785      */
2786     const PTimeInterval & GetNoMediaTimeout() const;
2787 
2788     /**Set the amount of time with no media that should cause call to clear
2789      */
2790     PBoolean SetNoMediaTimeout(PTimeInterval newInterval);
2791 
2792     /**Get the default timeout for GatekeeperRequest and Gatekeeper discovery.
2793      */
GetGatekeeperRequestTimeout()2794     const PTimeInterval & GetGatekeeperRequestTimeout() const { return gatekeeperRequestTimeout; }
2795 
2796     /**Get the default retries for GatekeeperRequest and Gatekeeper discovery.
2797      */
GetGatekeeperRequestRetries()2798     unsigned GetGatekeeperRequestRetries() const { return gatekeeperRequestRetries; }
2799 
2800     /**Get the default timeout for RAS protocol transactions.
2801      */
GetRasRequestTimeout()2802     const PTimeInterval & GetRasRequestTimeout() const { return rasRequestTimeout; }
2803 
2804     /**Get the default retries for RAS protocol transations.
2805      */
GetRasRequestRetries()2806     unsigned GetRasRequestRetries() const { return rasRequestRetries; }
2807 
2808     /**Get the default time for gatekeeper to reregister.
2809        A value of zero disables the keep alive facility.
2810      */
GetGatekeeperTimeToLive()2811     const PTimeInterval & GetGatekeeperTimeToLive() const { return registrationTimeToLive; }
2812 
2813     /**Get the iNow Gatekeeper Access Token OID.
2814      */
GetGkAccessTokenOID()2815     const PString & GetGkAccessTokenOID() const { return gkAccessTokenOID; }
2816 
2817     /**Set the iNow Gatekeeper Access Token OID.
2818      */
SetGkAccessTokenOID(const PString & token)2819     void SetGkAccessTokenOID(const PString & token) { gkAccessTokenOID = token; }
2820 
2821     /**Get flag to indicate whether to send GRQ on gatekeeper registration
2822      */
GetSendGRQ()2823     PBoolean GetSendGRQ() const
2824     { return sendGRQ; }
2825 
2826     /**Sent flag to indicate whether to send GRQ on gatekeeper registration
2827      */
SetSendGRQ(PBoolean v)2828     void SetSendGRQ(PBoolean v)
2829     { sendGRQ = v; }
2830 
2831 #ifdef H323_H450
2832 
2833     /**Get the default timeout for Call Transfer Timer CT-T1.
2834      */
GetCallTransferT1()2835     const PTimeInterval & GetCallTransferT1() const { return callTransferT1; }
2836 
2837     /**Get the default timeout for Call Transfer Timer CT-T2.
2838      */
GetCallTransferT2()2839     const PTimeInterval & GetCallTransferT2() const { return callTransferT2; }
2840 
2841     /**Get the default timeout for Call Transfer Timer CT-T3.
2842      */
GetCallTransferT3()2843     const PTimeInterval & GetCallTransferT3() const { return callTransferT3; }
2844 
2845     /**Get the default timeout for Call Transfer Timer CT-T4.
2846      */
GetCallTransferT4()2847     const PTimeInterval & GetCallTransferT4() const { return callTransferT4; }
2848 
2849     /** Get Call Intrusion timers timeout */
GetCallIntrusionT1()2850     const PTimeInterval & GetCallIntrusionT1() const { return callIntrusionT1; }
GetCallIntrusionT2()2851     const PTimeInterval & GetCallIntrusionT2() const { return callIntrusionT2; }
GetCallIntrusionT3()2852     const PTimeInterval & GetCallIntrusionT3() const { return callIntrusionT3; }
GetCallIntrusionT4()2853     const PTimeInterval & GetCallIntrusionT4() const { return callIntrusionT4; }
GetCallIntrusionT5()2854     const PTimeInterval & GetCallIntrusionT5() const { return callIntrusionT5; }
GetCallIntrusionT6()2855     const PTimeInterval & GetCallIntrusionT6() const { return callIntrusionT6; }
2856 
2857     /**Get the dictionary of <callIdentities, connections>
2858      */
GetCallIdentityDictionary()2859     H323CallIdentityDict& GetCallIdentityDictionary() { return secondaryConnectionsActive; }
2860 
2861     /**Get the next available invoke Id for H450 operations
2862       */
GetNextH450CallIdentityValue()2863     unsigned GetNextH450CallIdentityValue() const { return ++nextH450CallIdentity; }
2864 
2865 #endif // H323_H450
2866 
2867     /**Get the default stack size of cleaner threads.
2868      */
GetCleanerThreadStackSize()2869     PINDEX GetCleanerThreadStackSize() const { return cleanerThreadStackSize; }
2870 
2871     /**Get the default stack size of listener threads.
2872      */
GetListenerThreadStackSize()2873     PINDEX GetListenerThreadStackSize() const { return listenerThreadStackSize; }
2874 
2875     /**Get the default stack size of signalling channel threads.
2876      */
GetSignallingThreadStackSize()2877     PINDEX GetSignallingThreadStackSize() const { return signallingThreadStackSize; }
2878 
2879     /**Get the default stack size of control channel threads.
2880      */
GetControlThreadStackSize()2881     PINDEX GetControlThreadStackSize() const { return controlThreadStackSize; }
2882 
2883     /**Get the default stack size of logical channel threads.
2884      */
GetChannelThreadStackSize()2885     PINDEX GetChannelThreadStackSize() const { return logicalThreadStackSize; }
2886 
2887     /**Get the default stack size of RAS channel threads.
2888      */
GetRasThreadStackSize()2889     PINDEX GetRasThreadStackSize() const { return rasThreadStackSize; }
2890 
2891     /**Get the default stack size of jitter buffer threads.
2892      */
UseJitterBuffer()2893     PBoolean UseJitterBuffer() const { return useJitterBuffer; }
2894 
2895     /**Get the default stack size of jitter buffer threads.
2896      */
GetJitterThreadStackSize()2897     PINDEX GetJitterThreadStackSize() const { return jitterThreadStackSize; }
2898 
2899     /** Get the priority at which channel threads run
2900       */
GetChannelThreadPriority()2901     PThread::Priority GetChannelThreadPriority() const { return channelThreadPriority; }
2902 
GetConnections()2903     H323ConnectionDict & GetConnections() { return connectionsActive; };
2904 
EnableH225KeepAlive()2905     PBoolean EnableH225KeepAlive() const { return m_useH225KeepAlive; }
EnableH245KeepAlive()2906     PBoolean EnableH245KeepAlive() const { return m_useH245KeepAlive; }
2907 
GetDefaultLanguages(const PStringList &)2908     virtual PBoolean GetDefaultLanguages(const PStringList & /*languages*/)  { return false; }
OnReceiveLanguages(const PStringList &)2909     virtual void OnReceiveLanguages(const PStringList & /*languages*/)  { }
2910 
2911   //@}
2912 
2913     /**
2914      * default settings H.221 settings
2915      */
2916     static BYTE defaultT35CountryCode;
2917     static BYTE defaultT35Extension;
2918     static WORD defaultManufacturerCode;
2919 
2920   protected:
2921     H323Gatekeeper * InternalCreateGatekeeper(H323Transport * transport);
2922     PBoolean InternalRegisterGatekeeper(H323Gatekeeper * gk, PBoolean discovered);
2923     H323Connection * FindConnectionWithoutLocks(const PString & token);
2924     virtual H323Connection * InternalMakeCall(
2925       const PString & existingToken, /// Existing connection to be transferred
2926       const PString & callIdentity,  /// Call identity of the secondary call (if it exists)
2927       unsigned capabilityLevel,      /// Intrusion capability level
2928       const PString & remoteParty,   /// Remote party to call
2929       H323Transport * transport,     /// Transport to use for call.
2930       PString & token,               /// String to use/receive token for connection
2931       void * userData,               /// user data to pass to CreateConnection
2932       PBoolean supplementary = false ///< Whether the call is a supplementary call
2933     );
2934 
2935     // Configuration variables, commonly changed
2936     PStringList localAliasNames;
2937 
2938 	PStringList localLanguages;
2939     PBoolean    useQ931Display;
2940 
2941 #ifdef H323_AUDIO_CODECS
2942     H323AudioCodec::SilenceDetectionMode defaultSilenceDetection;
2943     unsigned minAudioJitterDelay;
2944     unsigned maxAudioJitterDelay;
2945 #ifdef P_AUDIO
2946     PString     soundChannelPlayDevice;
2947     PString     soundChannelPlayDriver;
2948     PString     soundChannelRecordDevice;
2949     PString     soundChannelRecordDriver;
2950     unsigned    soundChannelBuffers;
2951 #endif // P_AUDIO
2952     PBoolean    autoStartReceiveAudio;
2953     PBoolean    autoStartTransmitAudio;
2954 #endif // H323_AUDIO_CODECS
2955 
2956 #ifdef H323_VIDEO
2957     PString     videoChannelPlayDevice;
2958     PString     videoChannelRecordDevice;
2959     PBoolean        autoStartReceiveVideo;
2960     PBoolean        autoStartTransmitVideo;
2961 
2962 #ifdef H323_H239
2963     PBoolean        autoStartReceiveExtVideo;
2964     PBoolean        autoStartTransmitExtVideo;
2965 #endif // H323_H239
2966 #endif // H323_VIDEO
2967 
2968 #ifdef H323_T38
2969     PBoolean        autoStartReceiveFax;
2970     PBoolean        autoStartTransmitFax;
2971 #endif // H323_T38
2972 
2973     PBoolean        autoCallForward;
2974     PBoolean        disableFastStart;
2975     PBoolean        disableH245Tunneling;
2976     PBoolean        disableH245inSetup;
2977     PBoolean        disableH245QoS;
2978     PBoolean        disableDetectInBandDTMF;
2979     PBoolean        disableRFC2833InBandDTMF;
2980     PBoolean        disableExtendedUserInput;
2981     PBoolean        canDisplayAmountString;
2982     PBoolean        canEnforceDurationLimit;
2983 
2984 #ifdef H323_H450
2985     unsigned    callIntrusionProtectionLevel;
2986     PString     mwiMsgCentre;
2987 #endif // H323_H450
2988 
2989     H323Connection::SendUserInputModes defaultSendUserInputMode;
2990 
2991 #ifdef P_LDAP
2992     PString     ilsServer;
2993 #endif // P_LDAP
2994 
2995     // Some more configuration variables, rarely changed.
2996     BYTE          rtpIpTypeofService;
2997     BYTE          tcpIpTypeofService;
2998     PTimeInterval signallingChannelConnectTimeout;
2999     PTimeInterval signallingChannelCallTimeout;
3000     PTimeInterval controlChannelStartTimeout;
3001     PTimeInterval endSessionTimeout;
3002     PTimeInterval masterSlaveDeterminationTimeout;
3003     unsigned      masterSlaveDeterminationRetries;
3004     PTimeInterval capabilityExchangeTimeout;
3005     PTimeInterval logicalChannelTimeout;
3006     PTimeInterval requestModeTimeout;
3007     PTimeInterval roundTripDelayTimeout;
3008     PTimeInterval roundTripDelayRate;
3009     PTimeInterval noMediaTimeout;
3010     PTimeInterval gatekeeperRequestTimeout;
3011     unsigned      gatekeeperRequestRetries;
3012     PTimeInterval rasRequestTimeout;
3013     unsigned      rasRequestRetries;
3014     PTimeInterval registrationTimeToLive;
3015     PString       gkAccessTokenOID;
3016     PBoolean          sendGRQ;
3017 
3018     unsigned initialBandwidth;  // in 100s of bits/sev
3019     PBoolean     clearCallOnRoundTripFail;
3020 
3021     struct PortInfo {
3022       void Set(
3023         unsigned base,
3024         unsigned max,
3025         unsigned range,
3026         unsigned dflt
3027       );
3028       WORD GetNext(
3029         unsigned increment
3030       );
3031 
3032       PMutex mutex;
3033       WORD   base;
3034       WORD   max;
3035       WORD   current;
3036     } tcpPorts, udpPorts, rtpIpPorts;
3037 
3038 #ifdef P_STUN
3039     H323NatStrategy * natMethods;
3040 #endif
3041 
3042 #ifdef H323_H46019M
3043     struct MuxIDInfo {
3044        PMutex mutex;
3045          unsigned   base;
3046          unsigned   max;
3047          unsigned   current;
3048        unsigned GetNext(
3049           unsigned increment
3050        );
3051     } rtpMuxID;
3052     WORD defaultMultiRTPPort;
3053 #endif
3054 
3055     BYTE t35CountryCode;
3056     BYTE t35Extension;
3057     WORD manufacturerCode;
3058 
3059     TerminalTypes terminalType;
3060     PBoolean rewriteParsePartyName;
3061 
3062 #ifdef H323_H450
3063 
3064     /* Protect against absence of a response to the ctIdentify reqest
3065        (Transferring Endpoint - Call Transfer with a secondary Call) */
3066     PTimeInterval callTransferT1;
3067     /* Protect against failure of completion of the call transfer operation
3068        involving a secondary Call (Transferred-to Endpoint) */
3069     PTimeInterval callTransferT2;
3070     /* Protect against failure of the Transferred Endpoint not responding
3071        within sufficient time to the ctInitiate APDU (Transferring Endpoint) */
3072     PTimeInterval callTransferT3;
3073     /* May optionally operate - protects against absence of a response to the
3074        ctSetup request (Transferred Endpoint) */
3075     PTimeInterval callTransferT4;
3076 
3077     /** Call Intrusion Timers */
3078     PTimeInterval callIntrusionT1;
3079     PTimeInterval callIntrusionT2;
3080     PTimeInterval callIntrusionT3;
3081     PTimeInterval callIntrusionT4;
3082     PTimeInterval callIntrusionT5;
3083     PTimeInterval callIntrusionT6;
3084 
3085     H323CallIdentityDict secondaryConnectionsActive;
3086 
3087     mutable PAtomicInteger nextH450CallIdentity;
3088             /// Next available callIdentity for H450 Transfer operations via consultation.
3089 
3090 #endif // H323_H450
3091 
3092     PINDEX cleanerThreadStackSize;
3093     PINDEX listenerThreadStackSize;
3094     PINDEX signallingThreadStackSize;
3095     PINDEX controlThreadStackSize;
3096     PINDEX logicalThreadStackSize;
3097     PINDEX rasThreadStackSize;
3098     PINDEX jitterThreadStackSize;
3099     PBoolean useJitterBuffer;
3100 
3101 #ifdef H323_RTP_AGGREGATE
3102     PINDEX rtpAggregationSize;
3103     PHandleAggregator * rtpAggregator;
3104 #endif
3105 
3106 #ifdef H323_SIGNAL_AGGREGATE
3107     PINDEX signallingAggregationSize;
3108     PHandleAggregator * signallingAggregator;
3109 #endif
3110 
3111     PThread::Priority channelThreadPriority;
3112 
3113     // Dynamic variables
3114     H323ListenerList listeners;
3115     H323Capabilities capabilities;
3116     H323Gatekeeper * gatekeeper;
3117     PString          gatekeeperPassword;
3118     PStringList      gkAuthenticatorOrder;
3119 
3120     H323ConnectionDict       connectionsActive;
3121 
3122     PMutex                   connectionsMutex;
3123     PMutex                   noMediaMutex;
3124     PStringSet               connectionsToBeCleaned;
3125     H323ConnectionsCleaner * connectionsCleaner;
3126     PSyncPoint               connectionsAreCleaned;
3127 
3128     // Call Authentication
3129     PString EPSecurityUserName;       /// Local UserName Authenticated Call
3130     PString EPSecurityPassword;       /// Local Password Authenticated Call
3131     PBoolean isSecureCall;               /// Flag to Specify Call to make is Authenticated.
3132     EPSecurityPolicy CallAuthPolicy;   /// Incoming Call Authentication acceptance level
3133     H235AuthenticatorList EPAuthList;  /// List of Usernames & Password to check incoming call Against
3134     PBoolean m_disableMD5Authenticators; /// Disable MD5 based authenticatos (MD5 + CAT)
3135 
3136 #ifdef H323_H460
3137     H460_FeatureSet features;
3138     PBoolean disableH460;
3139 
3140 #ifdef H323_H46017
3141     PBoolean m_tryingH46017;
3142     PBoolean m_registeredWithH46017;
3143     H323Transport * m_h46017Transport;
3144 #endif
3145 
3146 #ifdef H323_H46018
3147     PBoolean m_h46018enabled;
3148 #endif
3149 
3150 #ifdef H323_H46019M
3151     PBoolean m_h46019Menabled;
3152     PBoolean m_h46019Msend;
3153 #endif
3154 
3155 #ifdef H323_H46023
3156     PBoolean m_h46023enabled;
3157 #endif
3158 
3159 #ifdef H323_H46023
3160     PBoolean m_h46025enabled;
3161 #endif
3162 
3163 #ifdef H323_H46026
3164     PBoolean m_h46026enabled;
3165 #endif
3166 
3167 #ifdef H323_UPnP
3168     PBoolean m_UPnPenabled;
3169 #endif
3170 
3171 #ifdef H323_H460IM
3172     PBoolean m_IMenabled;
3173     PBoolean m_IMcall;
3174     PBoolean m_IMsession;
3175     PBoolean m_IMwriteevent;
3176     PString m_IMmsg;
3177     PStringList m_IMsessions;
3178     PMutex m_IMmutex;
3179 
3180     // Multipoint Text functions
3181     //short m_IMMultiMode;
3182     //PBoolean m_IMmodeSent;
3183 #endif
3184 
3185 #ifdef H323_H460P
3186     H460PresenceHandler * presenceHandler;
3187 #endif
3188 
3189 #ifdef H323_H460PRE
3190 	unsigned m_regPrior;
3191 	PBoolean m_preempt;
3192     PBoolean m_preempted;
3193 #endif
3194 
3195 #ifdef H323_H461
3196     PBoolean m_ASSETEnabled;
3197     H323EndPoint::H461Mode m_h461ASSETMode;
3198     H461DataStore * m_h461DataStore;
3199 #endif
3200 
3201 #endif
3202 
3203 #ifdef H323_AEC
3204     PBoolean enableAEC;
3205 #endif
3206 
3207 #ifdef H323_GNUGK
3208     GNUGK_Feature * gnugk;
3209 #endif
3210 
3211 #ifdef H323_FRAMEBUFFER
3212     PBoolean useVideoBuffer;
3213 #endif
3214 
3215     H323TransportSecurity m_transportSecurity;
3216 #ifdef H323_TLS
3217     PSSLContext * m_transportContext;
3218 #endif
3219 
3220     void RegInvokeReRegistration();
3221     PMutex reregmutex;
3222     PThread  *  RegThread;
3223     PDECLARE_NOTIFIER(PThread, H323EndPoint, RegMethod);
3224 
3225     PBoolean m_useH225KeepAlive;
3226     PBoolean m_useH245KeepAlive;
3227 
3228 };
3229 
3230 /////////////////////////////////////////////////////////////////////
3231 
3232 
3233 #endif // __OPAL_H323EP_H
3234 
3235 
3236 /////////////////////////////////////////////////////////////////////////////
3237