Remove debug output.
[asterisk-bristuff.git] / channels / h323 / ast_h323.h
blobc4f24c5297ab86f1de338ac1459a80d65cedf224
1 /*
2 * ast_h323.h
4 * OpenH323 Channel Driver for ASTERISK PBX.
5 * By Jeremy McNamara
6 * For The NuFone Network
7 *
8 * This code has been derived from code created by
9 * Michael Manousos and Mark Spencer
11 * This file is part of the chan_h323 driver for Asterisk
13 * chan_h323 is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
18 * chan_h323 is distributed WITHOUT ANY WARRANTY; without even
19 * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
20 * PURPOSE. See the GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26 * Version Info: $Id$
29 #ifndef AST_H323_H
30 #define AST_H323_H
32 #define VERSION(a,b,c) ((a)*10000+(b)*100+(c))
34 class MyH323EndPoint : public H323EndPoint
36 PCLASSINFO(MyH323EndPoint, H323EndPoint);
38 public:
39 MyH323EndPoint();
40 int MyMakeCall(const PString &, PString &, void *_callReference, void *_opts);
41 BOOL ClearCall(const PString &, H323Connection::CallEndReason reason);
42 BOOL ClearCall(const PString &);
44 void OnClosedLogicalChannel(H323Connection &, const H323Channel &);
45 void OnConnectionEstablished(H323Connection &, const PString &);
46 void OnConnectionCleared(H323Connection &, const PString &);
47 virtual H323Connection * CreateConnection(unsigned, void *, H323Transport *, H323SignalPDU *);
48 void SendUserTone(const PString &, char);
49 BOOL OnConnectionForwarded(H323Connection &, const PString &, const H323SignalPDU &);
50 BOOL ForwardConnection(H323Connection &, const PString &, const H323SignalPDU &);
51 void SetEndpointTypeInfo( H225_EndpointType & info ) const;
52 void SetGateway(void);
53 PStringArray SupportedPrefixes;
56 class MyH323Connection : public H323Connection
58 PCLASSINFO(MyH323Connection, H323Connection);
60 public:
61 MyH323Connection(MyH323EndPoint &, unsigned, unsigned);
62 ~MyH323Connection();
63 H323Channel * CreateRealTimeLogicalChannel(const H323Capability &,
64 H323Channel::Directions,
65 unsigned,
66 const H245_H2250LogicalChannelParameters *,
67 RTP_QOS *);
68 H323Connection::AnswerCallResponse OnAnswerCall(const PString &,
69 const H323SignalPDU &,
70 H323SignalPDU &);
71 void OnReceivedReleaseComplete(const H323SignalPDU &);
72 BOOL OnAlerting(const H323SignalPDU &, const PString &);
73 BOOL OnSendReleaseComplete(H323SignalPDU &);
74 BOOL OnReceivedSignalSetup(const H323SignalPDU &);
75 BOOL OnReceivedFacility(const H323SignalPDU &);
76 BOOL OnSendSignalSetup(H323SignalPDU &);
77 BOOL OnStartLogicalChannel(H323Channel &);
78 BOOL OnClosingLogicalChannel(H323Channel &);
79 virtual void SendUserInputTone(char tone, unsigned duration = 0, unsigned logicalChannel = 0, unsigned rtpTimestamp = 0);
80 virtual void OnUserInputTone(char, unsigned, unsigned, unsigned);
81 virtual void OnUserInputString(const PString &value);
82 BOOL OnReceivedProgress(const H323SignalPDU &);
83 BOOL MySendProgress();
84 void OnSendCapabilitySet(H245_TerminalCapabilitySet &);
85 void OnSetLocalCapabilities();
86 void SetCapabilities(int, int, void *, int);
87 BOOL OnReceivedCapabilitySet(const H323Capabilities &, const H245_MultiplexCapability *,
88 H245_TerminalCapabilitySetReject &);
89 void SetCause(int _cause) { cause = _cause; };
90 virtual BOOL StartControlChannel(const H225_TransportAddress & h245Address);
91 void SetCallOptions(void *opts, BOOL isIncoming);
92 void SetCallDetails(void *callDetails, const H323SignalPDU &setupPDU, BOOL isIncoming);
93 virtual H323Connection::CallEndReason SendSignalSetup(const PString&, const H323TransportAddress&);
94 #ifdef TUNNELLING
95 virtual BOOL HandleSignalPDU(H323SignalPDU &pdu);
96 BOOL EmbedTunneledInfo(H323SignalPDU &pdu);
97 #endif
99 PString sourceAliases;
100 PString destAliases;
101 PString sourceE164;
102 PString destE164;
103 int cid_presentation;
104 int cid_ton;
105 PString rdnis;
106 int redirect_reason;
107 int transfer_capability;
109 WORD sessionId;
110 BOOL bridging;
111 #ifdef TUNNELLING
112 int remoteTunnelOptions;
113 int tunnelOptions;
114 #endif
116 unsigned progressSetup;
117 unsigned progressAlert;
118 int cause;
120 RTP_DataFrame::PayloadTypes dtmfCodec;
121 int dtmfMode;
124 class MyH323_ExternalRTPChannel : public H323_ExternalRTPChannel
126 PCLASSINFO(MyH323_ExternalRTPChannel, H323_ExternalRTPChannel);
128 public:
129 MyH323_ExternalRTPChannel(
130 MyH323Connection & connection,
131 const H323Capability & capability,
132 Directions direction,
133 unsigned sessionID);
135 ~MyH323_ExternalRTPChannel();
137 /* Overrides */
138 BOOL Start(void);
139 BOOL OnReceivedAckPDU(const H245_H2250LogicalChannelAckParameters & param);
141 protected:
142 BYTE payloadCode;
144 PIPSocket::Address localIpAddr;
145 PIPSocket::Address remoteIpAddr;
146 WORD localPort;
147 WORD remotePort;
151 * The MyProcess is a necessary descendant PProcess class so that the H323EndPoint
152 * objected to be created from within that class. (Solves the who owns main() problem).
154 class MyProcess : public PProcess
156 PCLASSINFO(MyProcess, PProcess);
158 public:
159 MyProcess();
160 ~MyProcess();
161 void Main();
164 #include "compat_h323.h"
166 #endif /* !defined AST_H323_H */