From e9d15cbea7a98184521c851500176da7aa424012 Mon Sep 17 00:00:00 2001 From: russell Date: Tue, 30 Jun 2009 16:40:38 +0000 Subject: Move Asterisk-addons modules into the main Asterisk source tree. Someone asked yesterday, "is there a good reason why we can't just put these modules in Asterisk?". After a brief discussion, as long as the modules are clearly set aside in their own directory and not enabled by default, it is perfectly fine. For more information about why a module goes in addons, see README-addons.txt. chan_ooh323 does not currently compile as it is behind some trunk API updates. However, it will not build by default, so it should be okay for now. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@204413 f38db490-d61c-443f-a65b-d21fe96a405b --- addons/ooh323c/src/ooLogChan.h | 190 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 190 insertions(+) create mode 100644 addons/ooh323c/src/ooLogChan.h (limited to 'addons/ooh323c/src/ooLogChan.h') diff --git a/addons/ooh323c/src/ooLogChan.h b/addons/ooh323c/src/ooLogChan.h new file mode 100644 index 000000000..eeb0f772e --- /dev/null +++ b/addons/ooh323c/src/ooLogChan.h @@ -0,0 +1,190 @@ +/* + * 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 ooLogChan.h + * This file contains structures and functions for maintaining information + * on logical channels within the stack. + */ +#ifndef _OOLOGCHAN_H_ +#define _OOLOGCHAN_H_ + +#include "ootypes.h" +#include "ooCapability.h" +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @defgroup logchan H.245 logical channel management + * @{ + */ +struct ooH323EpCapability; +struct OOH323CallData; + +/** + * Logical channel states. + */ +typedef enum { + OO_LOGICAL_CHAN_UNKNOWN, + OO_LOGICALCHAN_IDLE, + OO_LOGICALCHAN_PROPOSED, + OO_LOGICALCHAN_ESTABLISHED +} OOLogicalChannelState; + +/** + * Structure to store information on logical channels for a call. + */ +typedef struct OOLogicalChannel { + int channelNo; + int sessionID; + enum OOCapType type; + char dir[10]; /* receive/transmit */ + char remoteIP[20]; + int remoteMediaPort; + int remoteMediaControlPort; + int localRtpPort; + int localRtcpPort; + char localIP[20]; + OOLogicalChannelState state; + struct ooH323EpCapability *chanCap; + struct OOLogicalChannel *next; +} OOLogicalChannel; + +#define ooLogicalChannel OOLogicalChannel + +/** + * This function is used to add a new logical channel entry into the list + * of currently active logical channels. + * @param call Pointer to the call for which new logical channel + * entry has to be created. + * @param channelNo Channel number for the new channel entry. + * @param sessionID Session identifier for the new channel. + * @param dir Direction of the channel(transmit/receive) + * @param epCap Capability to be used for the new channel. + * + * @return Pointer to logical channel, on success. NULL, on failure + */ +EXTERN ooLogicalChannel* ooAddNewLogicalChannel + (struct OOH323CallData *call, int channelNo, int sessionID, + char *dir, ooH323EpCapability *epCap); + +/** + * This function is used to find a logical channel using the logical + * channel number as a key. + * @param call Pointer to the call for which logical channel is + * required. + * @param channelNo Forward Logical Channel number for the logical channel + * + * @return Pointer to the logical channel if found, NULL + * otherwise. + */ +EXTERN ooLogicalChannel* ooFindLogicalChannelByLogicalChannelNo +(struct OOH323CallData *call, int channelNo); + +/** + * This function is called when a new logical channel is established. It is + * particularly useful in case of faststart. When the remote endpoint selects + * one of the proposed alternatives, other channels for the same session type + * need to be closed. This function is used for that. + * + * @param call Handle to the call which owns the logical channel. + * @param pChannel Handle to the newly established logical channel. + * @return OO_OK, on success. OO_FAILED, on failure. + */ +EXTERN int ooOnLogicalChannelEstablished +(struct OOH323CallData *call, OOLogicalChannel * pChannel); + +/** + * This function is used to retrieve a logical channel with a particular + * sessionID. Note that there can be two entries of logical channel, one in + * each direction. This function will return the first channel which has the + * same session ID. + * @param call Handle to the call which owns the channels to be searched. + * @param sessionID Session id of the session which is to be searched for. + * @param dir Direction of the channel.(transmit/receive) + * + * @return Returns a pointer to the logical channel if found, NULL + * otherwise. + */ +EXTERN ooLogicalChannel* ooGetLogicalChannel +(struct OOH323CallData *call, int sessionID, char *dir); + +/** + * This function is used to remove a logical channel from the list of + * channels within the call structure. + * @param call Pointer to the call from which logical channel has + * to be removed. + * @param ChannelNo Forward logical channel number of the channel to be + * removed. + * @return OO_OK, on success. OO_FAILED, on failure. + */ +EXTERN int ooRemoveLogicalChannel (struct OOH323CallData *call, int ChannelNo); + +/** + * This function is used to cleanup a logical channel. It first stops media if + * it is still active and then removes the channel from the list, freeing up + * all the associated memory. + * @param call Handle to the call which owns the logical channel. + * @param channelNo Channel number identifying the channel. + * + * @return OO_OK, on success. OO_FAILED, on failure. + */ +EXTERN int ooClearLogicalChannel (struct OOH323CallData *call, int channelNo); + +/** + * This function is used to cleanup all the logical channels associated with + * the call. + * @param call Handle to the call which owns the channels. + * + * @return OO_OK, on success. OO_FAILED, on failure. + */ +EXTERN int ooClearAllLogicalChannels (struct OOH323CallData *call); + +/** + * This function is used to find a logical channel from a received + * H.245 Open Logical Channel (OLC) message. + * @param call Handle to the related call. + * @param olc Handle to the received OLC. + * + * @return Returns the corresponding logical channel if found, + * else returns NULL. + */ +EXTERN OOLogicalChannel * ooFindLogicalChannelByOLC +(struct OOH323CallData *call, H245OpenLogicalChannel *olc); + +/** + * This function is used to find a logical channel based on session Id, + * direction of channel and datatype. + * @param call Handle to the call + * @param sessionID Session ID for the channel to be searched. + * @param dir Direction of the channel wrt local endpoint. + * (transmit/receive) + * @param dataType Handle to the data type for the channel. + * + * @return Logical channel, if found, NULL otherwise. + */ +EXTERN OOLogicalChannel * ooFindLogicalChannel +(struct OOH323CallData* call, int sessionID, char *dir, H245DataType* dataType); + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif -- cgit v1.2.3