4 * OpenH323 Channel Driver for ASTERISK PBX.
6 * For The NuFone Network
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.
32 #define VERSION(a,b,c) ((a)*10000+(b)*100+(c))
34 class MyH323EndPoint
: public H323EndPoint
36 PCLASSINFO(MyH323EndPoint
, H323EndPoint
);
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
);
61 MyH323Connection(MyH323EndPoint
&, unsigned, unsigned);
63 H323Channel
* CreateRealTimeLogicalChannel(const H323Capability
&,
64 H323Channel::Directions
,
66 const H245_H2250LogicalChannelParameters
*,
68 H323Connection::AnswerCallResponse
OnAnswerCall(const PString
&,
69 const 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
&);
95 virtual BOOL
HandleSignalPDU(H323SignalPDU
&pdu
);
96 BOOL
EmbedTunneledInfo(H323SignalPDU
&pdu
);
99 PString sourceAliases
;
103 int cid_presentation
;
107 int transfer_capability
;
112 int remoteTunnelOptions
;
116 unsigned progressSetup
;
117 unsigned progressAlert
;
120 RTP_DataFrame::PayloadTypes dtmfCodec
;
124 class MyH323_ExternalRTPChannel
: public H323_ExternalRTPChannel
126 PCLASSINFO(MyH323_ExternalRTPChannel
, H323_ExternalRTPChannel
);
129 MyH323_ExternalRTPChannel(
130 MyH323Connection
& connection
,
131 const H323Capability
& capability
,
132 Directions direction
,
135 ~MyH323_ExternalRTPChannel();
139 BOOL
OnReceivedAckPDU(const H245_H2250LogicalChannelAckParameters
& param
);
144 PIPSocket::Address localIpAddr
;
145 PIPSocket::Address remoteIpAddr
;
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
);
164 #include "compat_h323.h"
166 #endif /* !defined AST_H323_H */