00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 #ifndef __OPAL_H
00035 #define __OPAL_H
00036
00037 #ifdef __cplusplus
00038 extern "C" {
00039 #endif
00040
00047 #ifdef _WIN32
00048 #define OPAL_EXPORT __stdcall
00049 #else
00050 #define OPAL_EXPORT
00051 #endif
00052
00053 struct OpalHandleStruct;
00054 typedef OpalHandleStruct * OpalHandle;
00055
00056 struct OpalMessage;
00057
00058
00059 #define OPAL_C_API_VERSION "1"
00060
00061
00063
00085 OpalHandle OPAL_EXPORT OpalInitialise(const char * options);
00086
00090 #define OPAL_INITIALISE_FUNCTION "OpalInitialise"
00091
00095 typedef OpalHandle (OPAL_EXPORT *OpalInitialiseFunction)(const char * prefixes);
00096
00097
00099
00103 void OPAL_EXPORT OpalShutDown(OpalHandle opal);
00104
00108 #define OPAL_SHUTDOWN_FUNCTION "OpalShutDown"
00109
00113 typedef void (OPAL_EXPORT *OpalShutDownFunction)(OpalHandle opal);
00114
00115
00117
00128 OpalMessage * OPAL_EXPORT OpalGetMessage(OpalHandle opal, unsigned timeout);
00129
00133 #define OPAL_GET_MESSAGE_FUNCTION "OpalGetMessage"
00134
00138 typedef OpalMessage * (OPAL_EXPORT *OpalGetMessageFunction)(OpalHandle opal, unsigned timeout);
00139
00140
00142
00165 OpalMessage * OPAL_EXPORT OpalSendMessage(OpalHandle opal, const OpalMessage * message);
00166
00170 typedef OpalMessage * (OPAL_EXPORT *OpalSendMessageFunction)(OpalHandle opal, const OpalMessage * message);
00171
00175 #define OPAL_SEND_MESSAGE_FUNCTION "OpalSendMessage"
00176
00177
00179
00183 void OPAL_EXPORT OpalFreeMessage(OpalMessage * message);
00184
00188 #define OPAL_FREE_MESSAGE_FUNCTION "OpalFreeMessage"
00189
00193 typedef void (OPAL_EXPORT *OpalFreeMessageFunction)(OpalMessage * message);
00194
00195
00197
00198 #define OPAL_PREFIX_PC "pc"
00199 #define OPAL_PREFIX_H323 "h323"
00200 #define OPAL_PREFIX_SIP "sip"
00201 #define OPAL_PREFIX_IAX2 "iax2"
00202 #define OPAL_PREFIX_POTS "pots"
00203 #define OPAL_PREFIX_PSTN "pstn"
00204 #define OPAL_PREFIX_IVR "ivr"
00205
00206 #define OPAL_PREFIX_ALL OPAL_PREFIX_PCSS " " \
00207 OPAL_PREFIX_H323 " " \
00208 OPAL_PREFIX_SIP " " \
00209 OPAL_PREFIX_IAX2 " " \
00210 OPAL_PREFIX_POTS " " \
00211 OPAL_PREFIX_PSTN " " \
00212 OPAL_PREFIX_IVR
00213
00214
00217 typedef enum OpalMessageType {
00218 OpalIndCommandError,
00221 OpalCmdSetGeneralParameters,
00223 OpalCmdSetProtocolParameters,
00226 OpalCmdRegistration,
00230 OpalIndRegistration,
00235 OpalCmdSetUpCall,
00239 OpalIndIncomingCall,
00242 OpalCmdAnswerCall,
00246 OpalCmdClearCall,
00252 OpalIndAlerting,
00256 OpalIndEstablished,
00260 OpalIndUserInput,
00263 OpalIndCallCleared,
00266 OpalCmdHoldCall,
00268 OpalCmdRetrieveCall,
00270 OpalCmdTransferCall,
00273 OpalMessageTypeCount
00274 } OpalMessageType;
00275
00276
00280 typedef struct OpalParamGeneral {
00281 const char * m_audioRecordDevice;
00282 const char * m_audioPlayerDevice;
00283 const char * m_videoInputDevice;
00284 const char * m_videoOutputDevice;
00285 const char * m_videoPreviewDevice;
00286 const char * m_mediaOrder;
00289 const char * m_mediaMask;
00292 const char * m_autoRxMedia;
00294 const char * m_autoTxMedia;
00296 const char * m_natRouter;
00298 const char * m_stunServer;
00300 WORD m_tcpPortBase;
00302 WORD m_tcpPortMax;
00304 WORD m_udpPortBase;
00306 WORD m_udpPortMax;
00308 WORD m_rtpPortBase;
00310 WORD m_rtpPortMax;
00312 unsigned m_rtpTypeOfService;
00314 unsigned m_rtpMaxPayloadSize;
00316 unsigned m_minAudioJitter;
00320 unsigned m_maxAudioJitter;
00324 } OpalParamGeneral;
00325
00326
00330 typedef struct OpalParamProtocol {
00331 const char * m_prefix;
00334 const char * m_userName;
00337 const char * m_displayName;
00339 const char * m_vendor;
00342 const char * m_name;
00345 const char * m_version;
00348 BYTE m_t35CountryCode;
00353 BYTE m_t35Extension;
00358 WORD m_manufacturerCode;
00364 const char * m_interfaceAddresses;
00369 } OpalParamProtocol;
00370
00371
00375 typedef struct OpalParamRegistration {
00376 const char * m_protocol;
00378 const char * m_identifier;
00384 const char * m_hostName;
00387 const char * m_authUserName;
00388 const char * m_password;
00389 const char * m_adminEntity;
00392 unsigned m_timeToLive;
00393 } OpalParamRegistration;
00394
00395
00399 typedef struct OpalStatusRegistration {
00400 const char * m_protocol;
00402 const char * m_serverName;
00405 const char * m_error;
00409 } OpalStatusRegistration;
00410
00411
00424 typedef struct OpalParamSetUpCall {
00425 const char * m_partyA;
00439 const char * m_partyB;
00446 const char * m_callToken;
00451 } OpalParamSetUpCall;
00452
00453
00457 typedef struct OpalStatusIncomingCall {
00458 const char * m_callToken;
00459 const char * m_localAddress;
00460 const char * m_remoteAddress;
00461 } OpalStatusIncomingCall;
00462
00463
00467 typedef struct OpalStatusUserInput {
00468 const char * m_callToken;
00469 const char * m_userInput;
00470 unsigned m_duration;
00473 } OpalStatusUserInput;
00474
00475
00479 typedef struct OpalStatusCallCleared {
00480 const char * m_callToken;
00481 const char * m_reason;
00482 } OpalStatusCallCleared;
00483
00484
00488 typedef struct OpalMessage {
00489 OpalMessageType m_type;
00490 union {
00491 const char * m_commandError;
00492 OpalParamGeneral m_general;
00493 OpalParamProtocol m_protocol;
00494 OpalParamRegistration m_registrationInfo;
00495 OpalStatusRegistration m_registrationStatus;
00496 OpalParamSetUpCall m_callSetUp;
00497 const char * m_callToken;
00498 OpalStatusIncomingCall m_incomingCall;
00499 OpalStatusUserInput m_userInput;
00500 OpalStatusCallCleared m_callCleared;
00501 } m_param;
00502 } OpalMessage;
00503
00504
00505 #ifdef __cplusplus
00506 };
00507 #endif
00508
00509 #endif // __OPAL_H
00510
00511