opal.h

Go to the documentation of this file.
00001 /*
00002  * opal.h
00003  *
00004  * "C" language interface for OPAL
00005  *
00006  * Open Phone Abstraction Library (OPAL)
00007  *
00008  * Copyright (c) 2008 Vox Lucida
00009  *
00010  * The contents of this file are subject to the Mozilla Public License
00011  * Version 1.0 (the "License"); you may not use this file except in
00012  * compliance with the License. You may obtain a copy of the License at
00013  * http://www.mozilla.org/MPL/
00014  *
00015  * Software distributed under the License is distributed on an "AS IS"
00016  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
00017  * the License for the specific language governing rights and limitations
00018  * under the License.
00019  *
00020  * The Original Code is Open Phone Abstraction Library.
00021  *
00022  * The Initial Developer of the Original Code is Vox Lucida (Robert Jongbloed)
00023  *
00024  * This code was initially written with the assisance of funding from
00025  * Stonevoice. http://www.stonevoice.com.
00026  *
00027  * Contributor(s): ______________________________________.
00028  *
00029  * $Revision: 20394 $
00030  * $Author: rjongbloed $
00031  * $Date: 2008-06-05 03:25:42 +0000 (Thu, 05 Jun 2008) $
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 typedef struct OpalHandleStruct * OpalHandle;
00054 
00055 typedef struct OpalMessage OpalMessage;
00056 
00057 
00058 #define OPAL_C_API_VERSION 3
00059 
00060 
00062 
00089 OpalHandle OPAL_EXPORT OpalInitialise(unsigned * version, const char * options);
00090 
00094 #define OPAL_INITIALISE_FUNCTION   "OpalInitialise"
00095 
00099 typedef OpalHandle (OPAL_EXPORT *OpalInitialiseFunction)(unsigned * version, const char * options);
00100 
00101 
00103 
00107 void OPAL_EXPORT OpalShutDown(OpalHandle opal);
00108 
00112 #define OPAL_SHUTDOWN_FUNCTION     "OpalShutDown"
00113 
00117 typedef void (OPAL_EXPORT *OpalShutDownFunction)(OpalHandle opal);
00118 
00119 
00121 
00132 OpalMessage * OPAL_EXPORT OpalGetMessage(OpalHandle opal, unsigned timeout);
00133 
00137 #define OPAL_GET_MESSAGE_FUNCTION  "OpalGetMessage"
00138 
00142 typedef OpalMessage * (OPAL_EXPORT *OpalGetMessageFunction)(OpalHandle opal, unsigned timeout);
00143 
00144 
00146 
00169 OpalMessage * OPAL_EXPORT OpalSendMessage(OpalHandle opal, const OpalMessage * message);
00170 
00174 typedef OpalMessage * (OPAL_EXPORT *OpalSendMessageFunction)(OpalHandle opal, const OpalMessage * message);
00175 
00179 #define OPAL_SEND_MESSAGE_FUNCTION "OpalSendMessage"
00180 
00181 
00183 
00187 void OPAL_EXPORT OpalFreeMessage(OpalMessage * message);
00188 
00192 #define OPAL_FREE_MESSAGE_FUNCTION "OpalFreeMessage"
00193 
00197 typedef void (OPAL_EXPORT *OpalFreeMessageFunction)(OpalMessage * message);
00198 
00199 
00201 
00202 #define OPAL_PREFIX_PC   "pc"
00203 #define OPAL_PREFIX_H323 "h323"
00204 #define OPAL_PREFIX_SIP  "sip"
00205 #define OPAL_PREFIX_IAX2 "iax2"
00206 #define OPAL_PREFIX_POTS "pots"
00207 #define OPAL_PREFIX_PSTN "pstn"
00208 #define OPAL_PREFIX_IVR  "ivr"
00209 
00210 #define OPAL_PREFIX_ALL OPAL_PREFIX_PCSS " " \
00211                         OPAL_PREFIX_H323 " " \
00212                         OPAL_PREFIX_SIP  " " \
00213                         OPAL_PREFIX_IAX2 " " \
00214                         OPAL_PREFIX_POTS " " \
00215                         OPAL_PREFIX_PSTN " " \
00216                         OPAL_PREFIX_IVR
00217 
00218 
00221 typedef enum OpalMessageType {
00222   OpalIndCommandError,          
00225   OpalCmdSetGeneralParameters,  
00227   OpalCmdSetProtocolParameters, 
00230   OpalCmdRegistration,          
00234   OpalIndRegistration,          
00239   OpalCmdSetUpCall,             
00243   OpalIndIncomingCall,          
00246   OpalCmdAnswerCall,            
00250   OpalCmdClearCall,             
00256   OpalIndAlerting,              
00260   OpalIndEstablished,           
00264   OpalIndUserInput,             
00267   OpalIndCallCleared,           
00270   OpalCmdHoldCall,              
00272   OpalCmdRetrieveCall,          
00274   OpalCmdTransferCall,          
00277   OpalMessageTypeCount
00278 } OpalMessageType;
00279 
00280 
00284 typedef struct OpalParamGeneral {
00285   const char * m_audioRecordDevice;   
00286   const char * m_audioPlayerDevice;   
00287   const char * m_videoInputDevice;    
00288   const char * m_videoOutputDevice;   
00289   const char * m_videoPreviewDevice;  
00290   const char * m_mediaOrder;          
00293   const char * m_mediaMask;           
00296   const char * m_autoRxMedia;         
00298   const char * m_autoTxMedia;         
00300   const char * m_natRouter;           
00302   const char * m_stunServer;          
00304   unsigned     m_tcpPortBase;         
00306   unsigned     m_tcpPortMax;          
00308   unsigned     m_udpPortBase;         
00310   unsigned     m_udpPortMax;          
00312   unsigned     m_rtpPortBase;         
00314   unsigned     m_rtpPortMax;          
00316   unsigned     m_rtpTypeOfService;    
00318   unsigned     m_rtpMaxPayloadSize;   
00320   unsigned     m_minAudioJitter;      
00324   unsigned     m_maxAudioJitter;      
00328   unsigned     m_silenceDetectMode;   
00331   unsigned     m_silenceThreshold;    
00333   unsigned     m_signalDeadband;      
00335   unsigned     m_silenceDeadband;     
00337   unsigned     m_silenceAdaptPeriod;  
00340   unsigned     m_echoCancellation;    
00342   unsigned     m_audioBuffers;        
00344 } OpalParamGeneral;
00345 
00346 
00350 typedef struct OpalParamProtocol {
00351   const char * m_prefix;              
00354   const char * m_userName;            
00357   const char * m_displayName;         
00359   const char * m_vendor;              
00362   const char * m_name;                
00365   const char * m_version;             
00368   unsigned     m_t35CountryCode;      
00373   unsigned     m_t35Extension;        
00378   unsigned     m_manufacturerCode;    
00384   const char * m_interfaceAddresses;  
00389 } OpalParamProtocol;
00390 
00391 
00395 typedef struct OpalParamRegistration {
00396   const char * m_protocol;      
00398   const char * m_identifier;    
00404   const char * m_hostName;      
00407   const char * m_authUserName;  
00408   const char * m_password;      
00409   const char * m_adminEntity;   
00412   unsigned     m_timeToLive;    
00413 } OpalParamRegistration;
00414 
00415 
00419 typedef struct OpalStatusRegistration {
00420   const char * m_protocol;    
00422   const char * m_serverName;  
00425   const char * m_error;       
00429 } OpalStatusRegistration;
00430 
00431 
00444 typedef struct OpalParamSetUpCall {
00445   const char * m_partyA;      
00459   const char * m_partyB;      
00466   const char * m_callToken;   
00471 } OpalParamSetUpCall;
00472 
00473 
00477 typedef struct OpalStatusIncomingCall {
00478   const char * m_callToken;     
00479   const char * m_localAddress;  
00480   const char * m_remoteAddress; 
00481 } OpalStatusIncomingCall;
00482 
00483 
00487 typedef struct OpalStatusUserInput {
00488   const char * m_callToken;   
00489   const char * m_userInput;   
00490   unsigned     m_duration;    
00493 } OpalStatusUserInput;
00494 
00495 
00499 typedef struct OpalStatusCallCleared {
00500   const char * m_callToken;   
00501   const char * m_reason;      
00502 } OpalStatusCallCleared;
00503 
00504 
00508 struct OpalMessage {
00509   OpalMessageType m_type;   
00510   union {
00511     const char *           m_commandError;       
00512     OpalParamGeneral       m_general;            
00513     OpalParamProtocol      m_protocol;           
00514     OpalParamRegistration  m_registrationInfo;   
00515     OpalStatusRegistration m_registrationStatus; 
00516     OpalParamSetUpCall     m_callSetUp;          
00517     const char *           m_callToken;          
00518     OpalStatusIncomingCall m_incomingCall;       
00519     OpalStatusUserInput    m_userInput;          
00520     OpalStatusCallCleared  m_callCleared;        
00521   } m_param;
00522 };
00523 
00524 
00525 #ifdef __cplusplus
00526 };
00527 #endif
00528 
00529 #endif // __OPAL_H
00530 
00531 

Generated on Mon Sep 15 01:31:21 2008 for OPAL by  doxygen 1.5.1