Debian Codegraph @

addons/ooh323c/src/ootypes.h

raw symbols SCIP
1 /*
2 * Copyright (C) 2004-2005 by Objective Systems, Inc.
3 *
4 * This software is furnished under an open source license and may be
5 * used and copied only in accordance with the terms of this license.
6 * The text of the license may generally be found in the root
7 * directory of this installation in the COPYING file. It
8 * can also be viewed online at the following URL:
9 *
10 * http://www.obj-sys.com/open/license.html
11 *
12 * Any redistributions of this file including modified versions must
13 * maintain this copyright notice.
14 *
15 *****************************************************************************/
16 /*! \mainpage
17 * <H1>ooH323c Stack Functions</H1>
18 *
19 * The <B>Objective Open H.323 for C (ooH323c)</B> protocol stack is an
20 * open source applications program interface (API) for building H.323 based
21 * applications. The stack implements Q.931/H.225 call signaling procedures,
22 * H.245 logical channel operations, and Registration, Admission, and Status
23 * (RAS) messaging for Gatekeeper communications.
24 *
25 * The categories of user functions provided are as follows:
26 * <UL>
27 * <LI>Stack command functions. These are high level functions used to
28 * initiate common H.323 telephony operations (for example, to make a
29 * call).</LI>
30 * <LI>Gatekeeper functions. These are high level functions for
31 * managing communications with a gatekeeper using RAS messages.</LI>
32 * <LI>H.323 endpoint management functions. These are function for
33 * used for managing the global H.323 endpoint.</LI>
34 * <LI>Call management functions. These are functions used to manage
35 * active calls within the stack.</LI>
36 * <LI>Capability management functions. These functions are used for
37 * negotiating capabilities between two different terminals.</LI>
38 * <LI>H.225 and H.245 message handling functions. Functions for
39 * creating and handling H.323 standard ASN.1 messages.</LI>
40 * <LI>Q.931 functions. Functions for the execution of various
41 * standard Q.931 operations.</LI>
42 * <LI>TCP/IP and UDP socket communication functions. Low-level
43 * functions for writing data to and receiving data from sockets.</LI>
44 * </UL>
45 */
46 /**
47 * @file ootypes.h
48 * This file contains definitions of common constants and data structures.
49 */
50 #ifndef _OOTYPES_H_
51 #define _OOTYPES_H_
52
53 #include "ooSocket.h"
54 #include "MULTIMEDIA-SYSTEM-CONTROL.h"
55 #include "H323-MESSAGES.h"
56 #include "ooasn1.h"
57
58 #ifdef HAVE_CONFIG_H
59 #include "config.h"
60 #endif
61
62
63
64 #define OOH323C_VERSION "v0.8.3m"
65
66 #ifndef EXTERN
67 #ifdef MAKE_DLL
68 #define EXTERN __declspec(dllexport)
69 #else
70 #define EXTERN
71 #endif /* MAKE_DLL */
72 #endif /* EXTERN */
73
74 /**
75 * @defgroup ootypes Common type and constant definitions.
76 * @{
77 */
78 /* Function return codes */
79 #define OO_FAILED -1
80 #define OO_OK 0
81
82 /* TODO: States for both local and remote initiation should be maintained
83 separately */
84 /**
85 * States defined for master/slave determination procedure.
86 */
87 typedef enum OOMasterSlaveState {
88 OO_MasterSlave_Idle,
89 OO_MasterSlave_DetermineSent,
90 OO_MasterSlave_AckReceived,
91 OO_MasterSlave_Master,
92 OO_MasterSlave_Slave
93 } OOMasterSlaveState;
94
95 typedef enum OOMSAckStatus {
96 OO_msAck_localSent,
97 OO_msAck_remoteReceived
98 } OOMSAckStatus;
99
100 /**
101 * States defined for the capability exchange procedure.
102 */
103 typedef enum {
104 OO_LocalTermCapExchange_Idle,
105 OO_LocalTermCapSetSent,
106 OO_LocalTermCapSetAckRecvd,
107 OO_RemoteTermCapExchange_Idle,
108 OO_RemoteTermCapSetRecvd,
109 OO_RemoteTermCapSetAckSent
110 } OOCapExchangeState;
111
112 /**
113 * Call clear reason codes.
114 */
115 typedef enum OOCallClearReason {
116 OO_REASON_UNKNOWN=0,
117 OO_REASON_INVALIDMESSAGE,
118 OO_REASON_TRANSPORTFAILURE,
119 OO_REASON_NOROUTE,
120 OO_REASON_NOUSER,
121 OO_REASON_NOBW,
122 OO_REASON_GK_NOCALLEDUSER,
123 OO_REASON_GK_NOCALLERUSER,
124 OO_REASON_GK_NORESOURCES,
125 OO_REASON_GK_UNREACHABLE,
126 OO_REASON_GK_CLEARED,
127 OO_REASON_NOCOMMON_CAPABILITIES,
128 OO_REASON_REMOTE_FWDED,
129 OO_REASON_LOCAL_FWDED,
130 OO_REASON_REMOTE_CLEARED,
131 OO_REASON_LOCAL_CLEARED,
132 OO_REASON_REMOTE_BUSY,
133 OO_REASON_LOCAL_BUSY,
134 OO_REASON_REMOTE_NOANSWER,
135 OO_REASON_LOCAL_NOTANSWERED,
136 OO_REASON_REMOTE_REJECTED,
137 OO_REASON_LOCAL_REJECTED,
138 OO_REASON_REMOTE_CONGESTED,
139 OO_REASON_LOCAL_CONGESTED
140 } OOCallClearReason;
141
142 /** Terminal type of the endpoint. Default is 60. */
143 #define OOTERMTYPE 60
144
145 /** Maximum length of an IP address (xxx.xxx.xxx.xxx). */
146 #define MAX_IP_LENGTH 2+8*4+7
147
148 /** Maximum length of a log file message */
149 #define MAXLOGMSGLEN 2048
150
151 /** Number of times to retry a failed operation. */
152 #define DEFAULT_MAX_RETRIES 3
153
154 /**
155 Various message types for H225 and H245 messages
156 */
157 #define OO_MSGTYPE_MIN 0x65
158 #define OOQ931MSG 0x65
159 #define OOH245MSG 0x66
160 #define OOSetup 0x67
161 #define OOCallProceeding 0x68
162 #define OOAlert 0x69
163 #define OOConnect 0x6a
164 #define OOReleaseComplete 0x6b
165 #define OOFacility 0x6c
166 #define OOInformationMessage 0x6d
167 #define OOMasterSlaveDetermination 0x6e
168 #define OOMasterSlaveAck 0x6f
169 #define OOMasterSlaveReject 0x70
170 #define OOMasterSlaveRelease 0x71
171 #define OOTerminalCapabilitySet 0x72
172 #define OOTerminalCapabilitySetAck 0x73
173 #define OOTerminalCapabilitySetReject 0x74
174 #define OOTerminalCapabilitySetRelease 0x75
175 #define OOOpenLogicalChannel 0x76
176 #define OOOpenLogicalChannelAck 0x77
177 #define OOOpenLogicalChannelReject 0x78
178 #define OOOpenLogicalChannelRelease 0x79
179 #define OOOpenLogicalChannelConfirm 0x7a
180 #define OOCloseLogicalChannel 0x7b
181 #define OOCloseLogicalChannelAck 0x7c
182 #define OORequestChannelClose 0x7d
183 #define OORequestChannelCloseAck 0x7e
184 #define OORequestChannelCloseReject 0x7f
185 #define OORequestChannelCloseRelease 0x80
186 #define OOEndSessionCommand 0x81
187 #define OOUserInputIndication 0x82
188 #define OORequestModeAck 0x83
189 #define OORequestModeReject 0x84
190 #define OORequestMode 0x85
191 #define OORequestDelayResponse 0x86
192 #define OORequestDelayRequest 0x87
193 #define OOStatus 0x88
194
195 #define OO_MSGTYPE_MAX 0x88
196
197 /* Timer types */
198 #define OO_CALLESTB_TIMER (1<<0)
199 #define OO_MSD_TIMER (1<<1)
200 #define OO_TCS_TIMER (1<<2)
201 #define OO_OLC_TIMER (1<<3)
202 #define OO_CLC_TIMER (1<<4)
203 #define OO_RCC_TIMER (1<<5)
204 #define OO_SESSION_TIMER (1<<6)
205 #define OO_H245CONNECT_TIMER (1<<7)
206 #define OO_RTD_TIMER (1<<8)
207
208 /** Maximum length for received messages */
209 #define MAXMSGLEN 4096
210
211 /** Maximum length of a filename */
212 #define MAXFILENAME 256
213
214 /**
215 * Endpoint call modes. The call mode of the endpoint dictates what type
216 * of channels are created for the calls placed by the endpoint or received
217 * by the endpoint.
218 */
219 typedef enum OOCallMode {
220 OO_CALLMODE_AUDIOCALL, /*!< Audio call */
221 OO_CALLMODE_AUDIORX, /*!< Audio call - receive only */
222 OO_CALLMODE_AUDIOTX, /*!< Audio call - transmit only */
223 OO_CALLMODE_VIDEOCALL, /*!< Video call */
224 OO_CALLMODE_FAX /*!< Fax transmission */
225 } OOCallMode;
226
227 /*
228 * Flag macros - these operate on bit mask flags using mask values
229 */
230 /** This macro sets a flag within a bit mask */
231 #define OO_SETFLAG(flags,mask) (flags |= (ASN1UINT)mask)
232
233 /** This macro clears a flag within a bit mask */
234 #define OO_CLRFLAG(flags,mask) (flags &= ~(ASN1UINT)mask)
235
236 /** This macro tests a flag with a bit mask */
237 #define OO_TESTFLAG(flags,mask) (((ASN1UINT)flags & (ASN1UINT)mask) != 0)
238
239
240
241 /*TODO: Should add caller-id, callername etc. So that they can be changed per
242 call basis*/
243 /**
244 * This structure defines options that can be set at the level of an
245 * individual call. They override options set in the H.323 endpoint
246 * structure.
247 */
248 typedef struct ooCallOptions {
249 OOBOOL fastStart; /*!< Use FastStart signaling */
250 OOBOOL tunneling; /*!< Use H.245 tunneling */
251 OOBOOL disableGk; /*!< Disable use of gatekeeper */
252 OOCallMode callMode; /*!< Type of channel to setup with FastStart */
253 int transfercap; /* q931 cap */
254 }ooCallOptions;
255
256
257 struct OOH323CallData;
258
259 typedef struct ooTimerCallback{
260 struct OOH323CallData* call;
261 ASN1UINT timerType;
262 ASN1UINT channelNumber;
263 } ooTimerCallback;
264
265 /**
266 * @}
267 */
268 #endif