oocalls.h
来自「一个非常美妙的proxy。功能强大。基于sip的协议。如果还要的话」· C头文件 代码 · 共 786 行 · 第 1/3 页
H
786 行
/* * Copyright (C) 2004-2005 by Objective Systems, Inc. * * This software is furnished under an open source license and may be * used and copied only in accordance with the terms of this license. * The text of the license may generally be found in the root * directory of this installation in the COPYING file. It * can also be viewed online at the following URL: * * http://www.obj-sys.com/open/license.html * * Any redistributions of this file including modified versions must * maintain this copyright notice. * *****************************************************************************//** * @file ooCalls.h * This file contains call management functions. */#ifndef _OOCALLS_H_#define _OOCALLS_H_#include "ooLogChan.h"#include "ooCapability.h"#ifdef __cplusplusextern "C" {#endif/** * @defgroup callmgmt Call Management * @{ *//* Flag mask values *//* DISABLEGK is used to selectively disable gatekeeper use. For incoming calls DISABLEGK can be set in onReceivedSetup callback by application. Very useful in pbx applications where gk is used only when call is to or from outside pbx domian. For outgoing calls, ooMakeCallNoGk disables use of gk for specific call.*/#define OO_M_ENDPOINTCREATED 0x00010000#define OO_M_ENDSESSION_BUILT 0x00800000#define OO_M_RELEASE_BUILT 0x00400000#define OO_M_GKROUTED 0x00200000#define OO_M_AUTOANSWER 0x00100000#define OO_M_TUNNELING 0x08000000#define OO_M_FASTSTARTANSWERED 0x04000000#define OO_M_FASTSTART 0x02000000 #define OO_M_DISABLEGK 0x01000000#define OO_M_MANUALRINGBACK 0x10000000/** * Call states. */typedef enum { OO_CALL_CREATED, /*!< Call created. */ OO_CALL_WAITING_ADMISSION, /*!< Call waiting for admission by GK */ OO_CALL_CONNECTING, /*!< Call in process of connecting */ OO_CALL_CONNECTED, /*!< Call currently connected. */ OO_CALL_CLEAR, /*!< Call marked for clearing */ OO_CALL_CLEAR_RELEASERECVD, /*!< Release command received. */ OO_CALL_CLEAR_RELEASESENT, /*!< Release sent */ OO_CALL_CLEARED /*!< Call cleared */} OOCallState;/** * H.245 session states. */typedef enum { OO_H245SESSION_IDLE, OO_H245SESSION_ACTIVE, OO_H245SESSION_ENDSENT, OO_H245SESSION_ENDRECVD, OO_H245SESSION_CLOSED} OOH245SessionState;/** * Structure to store local and remote media endpoint info for a * given media type. */typedef struct OOMediaInfo{ char dir[15]; /* transmit/receive*/ int cap; int lMediaPort; int lMediaCntrlPort; char lMediaIP[20]; struct OOMediaInfo *next;} OOMediaInfo;#define ooMediaInfo OOMediaInfostruct OOAliases;/** * Structure to hold information on a forwarded call. */typedef struct OOCallFwdData { char ip[20]; int port; struct OOAliases *aliases; OOBOOL fwdedByRemote; /*Set when we are being fwded by remote*/} OOCallFwdData; /** * Structure to store information on an H.323 channel (H.225 or H.245) for * a particular call. */typedef struct OOH323Channel { OOSOCKET sock; /*!< Socket connection for the channel */ int port; /*!< Port assigned to the channel */ DList outQueue; /*!< Output message queue */} OOH323Channel;/** * This structure is used to maintain all information on an active call. * A list of these structures is maintained within the global endpoint * structure. */typedef struct OOH323CallData { OOCTXT *pctxt; char callToken[20]; /* ex: ooh323c_call_1 */ char callType[10]; /* incoming/outgoing */ OOCallMode callMode; ASN1USINT callReference; char ourCallerId[256]; H225CallIdentifier callIdentifier;/* The call identifier for the active call. */ char *callingPartyNumber; char *calledPartyNumber; H225ConferenceIdentifier confIdentifier; ASN1UINT flags; OOCallState callState; OOCallClearReason callEndReason; unsigned h245ConnectionAttempts; OOH245SessionState h245SessionState; int dtmfmode; OOMediaInfo *mediaInfo; OOCallFwdData *pCallFwdData; char localIP[20];/* Local IP address */ OOH323Channel* pH225Channel; OOH323Channel* pH245Channel; OOSOCKET *h245listener; int *h245listenport; char remoteIP[20];/* Remote IP address */ int remotePort; int remoteH245Port; char *remoteDisplayName; struct OOAliases *remoteAliases; struct OOAliases *ourAliases; /*aliases used in the call for us */ OOMasterSlaveState masterSlaveState; /*!< Master-Slave state */ ASN1UINT statusDeterminationNumber; OOCapExchangeState localTermCapState; OOCapExchangeState remoteTermCapState; struct ooH323EpCapability* ourCaps; struct ooH323EpCapability* remoteCaps; /* TODO: once we start using jointCaps, get rid of remoteCaps*/ struct ooH323EpCapability* jointCaps; int jointDtmfMode; DList remoteFastStartOLCs; ASN1UINT8 remoteTermCapSeqNo; ASN1UINT8 localTermCapSeqNo; OOCapPrefs capPrefs; OOLogicalChannel* logicalChans; int noOfLogicalChannels; int logicalChanNoBase; int logicalChanNoMax; int logicalChanNoCur; unsigned nextSessionID; /* Note by default 1 is audio session, 2 is video and 3 is data, from 3 onwards master decides*/ DList timerList; ASN1UINT msdRetries; void *usrData; /*!<User can set this to user specific data*/ struct OOH323CallData* next; struct OOH323CallData* prev;} OOH323CallData;#define ooCallData OOH323CallData/** * This callback function is triggered when a new call structure is * created inside the stack for an incoming or outgoing call. * * @param call H.323 call data structure * @return 0 if callback was successful, non-zero error code if failure. */typedef int (*cb_OnNewCallCreated)(OOH323CallData* call);/** * This callback function is triggered when a Q.931 alerting message is * received for an outgoing call or when a Q.931 alerting message is sent * for an incoming call. * * @param call H.323 call data structure * @return 0 if callback was successful, non-zero error code if failure. */typedef int (*cb_OnAlerting)(OOH323CallData * call);/** * This callback function is triggered when there is an incoming call. * In the case where a gatekeeper is in use, the call must first be * admitted by the gatekeeper before this callback is triggered. * * @param call H.323 call data structure * @return 0 if callback was successful, non-zero error code if failure. */typedef int (*cb_OnIncomingCall)(OOH323CallData* call );/** * This callback function is triggered after a Q.931 setup message * is sent for an outgoing call. * * @param call H.323 call data structure * @return 0 if callback was successful, non-zero error code if failure. */typedef int (*cb_OnOutgoingCall)(OOH323CallData* call );/** * This callback function is triggered when a Q.931 connect message is * sent in case of incoming call. In case of outgoing call, this is invoked * when a Q.931 connect message is received. It is not invoked until after * fast start and H.245 tunneling messages within the connect message are * processed. * * @param call H.323 call data structure * @return 0 if callback was successful, non-zero error code if failure. */typedef int (*cb_OnCallEstablished)(struct OOH323CallData* call);/** * This callback function is triggered when a call is cleared. * * @param call H.323 call data structure * @return 0 if callback was successful, non-zero error code if failure. */typedef int (*cb_OnCallCleared)(struct OOH323CallData* call);/** * This callback function is triggered when master-slave determination * and capabilities negotiation procedures are successfully completed * for a call. * * @param call H.323 call data structure * @return 0 if callback was successful, non-zero error code if failure. */typedef int (*cb_OpenLogicalChannels)(struct OOH323CallData* call);/** * This callback function is triggered when a call is forwarded by * a remote endpoint to another remote destination. * @param call Associated H.323 call data structure * @return 0 if callback was successful, non-zero error code if failure */typedef int (*cb_OnCallForwarded)(struct OOH323CallData* call);/** * This callback function is triggered when dtmf is received over Q.931(keypad) * or H.245(alphanumeric) or H.245(signal). This is not triggered when rfc * 2833 based dtmf is received. */
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?