<commit_before>//
// Copyright (C) 2005-2007 SIPez LLC.
// Licensed to SIPfoundry under a Contributor Agreement.
// 
// Copyright (C) 2004-2007 SIPfoundry Inc.
// Licensed by SIPfoundry under the LGPL license.
//
// Copyright (C) 2004-2006 Pingtel Corp.  All rights reserved.
// Licensed to SIPfoundry under a Contributor Agreement.
//
// $$
///////////////////////////////////////////////////////////////////////////////

// Author: <NAME> <EMAIL> AT SIPez DOT com

#ifndef _CpCallManager_h_
#define _CpCallManager_h_

// SYSTEM INCLUDES
// APPLICATION INCLUDES
#include <os/OsServerTask.h>
#include <os/OsRWMutex.h>
#include "os/OsProtectEvent.h"
#include "os/OsQueuedEvent.h"

#include "ptapi/PtEvent.h"
#include "net/SipMessage.h"
#include "net/SipContactDb.h"
#include "net/SipDialog.h"
#include "cp/Connection.h"

// DEFINES
// MACROS
// EXTERNAL FUNCTIONS
// EXTERNAL VARIABLES
// CONSTANTS
// STRUCTS
// TYPEDEFS
// FORWARD DECLARATIONS
class CpCall;
class CpMediaInterface;
class SipSession;
class SipDialog;
class MpStreamPlayer;
class MpStreamPlaylistPlayer;
class OsEvent;

//! Abstract call manager
/*! There are three major components to the call management system:
 *\par
 * Call management methods
 *\par
 * Call model events
 *\par
 * Abstract media control interface.
 * \par
 * The call management methods provide the means to perform call
 * control operations and poll call state. The call model events
 * provide the means to listen for call model state changes. The
 * abstract media control interface provides the means to override
 * the media subsystem.
 * \par
 * Due to the transient nature of the objects in the call model,
 * handles or names are used to represent the actual objects.
 * Operations are performed on these objects via the Call Manager
 * by naming the object(s) when invoking a method.
 * /par
 * The INFINITY.0 APIs above use the same call model used in JTAPI
 *(as defined by the Enterprise Computer Telephony Forum). The
 * primary objects defined in this model are:
 *\par
 * call
 *\par
 * connection
 *\par
 * address
 *\par
 * terminal
 *\par
 * terminal connection.
 * \par
 * A call contains zero or more connections. A connection is
 * associated with an address (that is, a SIP URL). A terminal
 * connection is the relationship between a connection and a
 * terminal.
 * \par
 * Call Model state changes are notified through an event handler.
 *  The event handler is a sub-class of TaoAdaptor that implements
 * the handleMessage method.  This method must implement actions or
 * state caching of events of interest to the application.  The
 * events that are notified from the call manager subsystem are
 * enumerated in PtEvent.
 */
class CpCallManager : public OsServerTask
{
/* //////////////////////////// PUBLIC //////////////////////////////////// */
public:

#ifndef DOXYGEN_SHOULD_SKIP_THIS

    enum EventSubTypes
        {
        CP_UNSPECIFIED = SipMessage::NET_UNSPECIFIED,
        CP_SIP_MESSAGE = SipMessage::NET_SIP_MESSAGE,
        CP_CALL_EXITED,
        CP_DIAL_STRING,
        CP_YIELD_FOCUS,  //10
        CP_GET_FOCUS,
        CP_CREATE_CALL,
        CP_CONNECT,
        CP_BLIND_TRANSFER,
        CP_CONSULT_TRANSFER,
        CP_TRANSFER_CONNECTION,
        CP_TRANSFER_CONNECTION_STATUS,
        CP_TRANSFEREE_CONNECTION,
        CP_TRANSFEREE_CONNECTION_STATUS, //20
        CP_DROP,
        CP_DROP_CONNECTION,
        CP_FORCE_DROP_CONNECTION,
        CP_ANSWER_CONNECTION,
        CP_ACCEPT_CONNECTION,
        CP_REJECT_CONNECTION,
        CP_REDIRECT_CONNECTION,
        CP_GET_NUM_CONNECTIONS,
        CP_GET_CONNECTIONS, 
        CP_GET_CALLED_ADDRESSES, //30
        CP_GET_CALLING_ADDRESSES,
        CP_PLAY_AUDIO_TERM_CONNECTION,
        CP_STOP_AUDIO_TERM_CONNECTION,
        CP_PAUSE_AUDIO_PLAYBACK_CONNECTION,
        CP_RESUME_AUDIO_PLAYBACK_CONNECTION,
        CP_IS_LOCAL_TERM_CONNECTION,
        CP_HOLD_TERM_CONNECTION, 
        CP_UNHOLD_TERM_CONNECTION, //40
        CP_UNHOLD_LOCAL_TERM_CONNECTION,
        CP_HOLD_LOCAL_TERM_CONNECTION,
        CP_OFFERING_EXPIRED,
        CP_RINGING_EXPIRED,
        CP_GET_SESSION,
        CP_HOLD_ALL_TERM_CONNECTIONS,  
        CP_UNHOLD_ALL_TERM_CONNECTIONS,//50
        CP_CANCEL_TIMER,
        CP_PLAY_BUFFER_TERM_CONNECTION,
        CP_RENEGOTIATE_CODECS_CONNECTION,
        CP_RENEGOTIATE_CODECS_ALL_CONNECTIONS,
        CP_SET_OUTBOUND_LINE,
        CP_OUTGOING_INFO,
        CP_GET_MEDIA_CONNECTION_ID,
        CP_ENABLE_STUN,
        CP_ENABLE_TURN,         
        CP_GET_CAN_ADD_PARTY,
        CP_SPLIT_CONNECTION,
        CP_JOIN_CONNECTION, //80
        CP_CONSULT_TRANSFER_ADDRESS,
        CP_START_TONE_CONNECTION,
        CP_STOP_TONE_CONNECTION,
        CP_PLAY_AUDIO_CONNECTION,
        CP_STOP_AUDIO_CONNECTION,
        CP_TRANSFER_OTHER_PARTY_HOLD,
        CP_TRANSFER_OTHER_PARTY_JOIN,
        CP_TRANSFER_OTHER_PARTY_UNHOLD,
        CP_GET_MEDIA_ENERGY_LEVELS,
        CP_GET_CALL_MEDIA_ENERGY_LEVELS,
        CP_RECORD_AUDIO_CONNECTION_START,
        CP_RECORD_AUDIO_CONNECTION_STOP,
        CP_REFIRE_MEDIA_EVENT,
        CP_LIMIT_CODEC_PREFERENCES,
        CP_SILENT_REMOTE_HOLD,
        CP_GET_USERAGENT
    };

/*
        enum metaEventType
    {
        META_EVENT_NONE = 0,
                META_EVENT_TRANSFER,
        META_EVENT_CONFERENCE,
        META_EVENT_MERGE,
                META_EVENT_CALL_START,
                META_EVENT_CALL_END,
                META_EVENT_CALL_PROGRESS,
                META_EVENT_CALL_ADDITIONAL_PARTY,
                META_EVENT_CALL_REMOVING_PARTY,
                META_EVENT_SNAPSHOT,
                META_EVENT_UNKNOWN
    };
*/
#endif // DOXYGEN_SHOULD_SKIP_THIS

    enum CallTypes
    {
        SIP_CALL = 0,
        MGCP_CALL
    };

    enum CallHoldType
    {
        NEAR_END_HOLD = 0,
        FAR_END_HOLD
    };

    enum CpStatus
    {
        CP_SUCCESS = 0,
        CP_FAILED,
        CP_INVALID_IP_ADDRESS,
        CP_INVALID_SIP_DIRECTORY_SERVER,
        CP_INVALID_SIP_URL
    };

/* ============================ CREATORS ================================== */
<commit_msg>Removed unused enum.<commit_after>//
// Copyright (C) 2005-2007 SIPez LLC.
// Licensed to SIPfoundry under a Contributor Agreement.
// 
// Copyright (C) 2004-2007 SIPfoundry Inc.
// Licensed by SIPfoundry under the LGPL license.
//
// Copyright (C) 2004-2006 Pingtel Corp.  All rights reserved.
// Licensed to SIPfoundry under a Contributor Agreement.
//
// $$
///////////////////////////////////////////////////////////////////////////////

// Author: <NAME> dpetrie AT SIPez DOT com

#ifndef _CpCallManager_h_
#define _CpCallManager_h_

// SYSTEM INCLUDES
// APPLICATION INCLUDES
#include <os/OsServerTask.h>
#include <os/OsRWMutex.h>
#include "os/OsProtectEvent.h"
#include "os/OsQueuedEvent.h"

#include "ptapi/PtEvent.h"
#include "net/SipMessage.h"
#include "net/SipContactDb.h"
#include "net/SipDialog.h"
#include "cp/Connection.h"

// DEFINES
// MACROS
// EXTERNAL FUNCTIONS
// EXTERNAL VARIABLES
// CONSTANTS
// STRUCTS
// TYPEDEFS
// FORWARD DECLARATIONS
class CpCall;
class CpMediaInterface;
class SipSession;
class SipDialog;
class MpStreamPlayer;
class MpStreamPlaylistPlayer;
class OsEvent;

//! Abstract call manager
/*! There are three major components to the call management system:
 *\par
 * Call management methods
 *\par
 * Call model events
 *\par
 * Abstract media control interface.
 * \par
 * The call management methods provide the means to perform call
 * control operations and poll call state. The call model events
 * provide the means to listen for call model state changes. The
 * abstract media control interface provides the means to override
 * the media subsystem.
 * \par
 * Due to the transient nature of the objects in the call model,
 * handles or names are used to represent the actual objects.
 * Operations are performed on these objects via the Call Manager
 * by naming the object(s) when invoking a method.
 * /par
 * The INFINITY.0 APIs above use the same call model used in JTAPI
 *(as defined by the Enterprise Computer Telephony Forum). The
 * primary objects defined in this model are:
 *\par
 * call
 *\par
 * connection
 *\par
 * address
 *\par
 * terminal
 *\par
 * terminal connection.
 * \par
 * A call contains zero or more connections. A connection is
 * associated with an address (that is, a SIP URL). A terminal
 * connection is the relationship between a connection and a
 * terminal.
 * \par
 * Call Model state changes are notified through an event handler.
 *  The event handler is a sub-class of TaoAdaptor that implements
 * the handleMessage method.  This method must implement actions or
 * state caching of events of interest to the application.  The
 * events that are notified from the call manager subsystem are
 * enumerated in PtEvent.
 */
class CpCallManager : public OsServerTask
{
/* //////////////////////////// PUBLIC //////////////////////////////////// */
public:

#ifndef DOXYGEN_SHOULD_SKIP_THIS

    enum EventSubTypes
        {
        CP_UNSPECIFIED = SipMessage::NET_UNSPECIFIED,
        CP_SIP_MESSAGE = SipMessage::NET_SIP_MESSAGE,
        CP_CALL_EXITED,
        CP_DIAL_STRING,
        CP_YIELD_FOCUS,  //10
        CP_GET_FOCUS,
        CP_CREATE_CALL,
        CP_CONNECT,
        CP_BLIND_TRANSFER,
        CP_CONSULT_TRANSFER,
        CP_TRANSFER_CONNECTION,
        CP_TRANSFER_CONNECTION_STATUS,
        CP_TRANSFEREE_CONNECTION,
        CP_TRANSFEREE_CONNECTION_STATUS, //20
        CP_DROP,
        CP_DROP_CONNECTION,
        CP_FORCE_DROP_CONNECTION,
        CP_ANSWER_CONNECTION,
        CP_ACCEPT_CONNECTION,
        CP_REJECT_CONNECTION,
        CP_REDIRECT_CONNECTION,
        CP_GET_NUM_CONNECTIONS,
        CP_GET_CONNECTIONS, 
        CP_GET_CALLED_ADDRESSES, //30
        CP_GET_CALLING_ADDRESSES,
        CP_PLAY_AUDIO_TERM_CONNECTION,
        CP_STOP_AUDIO_TERM_CONNECTION,
        CP_PAUSE_AUDIO_PLAYBACK_CONNECTION,
        CP_RESUME_AUDIO_PLAYBACK_CONNECTION,
        CP_IS_LOCAL_TERM_CONNECTION,
        CP_HOLD_TERM_CONNECTION, 
        CP_UNHOLD_TERM_CONNECTION, //40
        CP_UNHOLD_LOCAL_TERM_CONNECTION,
        CP_HOLD_LOCAL_TERM_CONNECTION,
        CP_OFFERING_EXPIRED,
        CP_RINGING_EXPIRED,
        CP_GET_SESSION,
        CP_HOLD_ALL_TERM_CONNECTIONS,  
        CP_UNHOLD_ALL_TERM_CONNECTIONS,//50
        CP_CANCEL_TIMER,
        CP_PLAY_BUFFER_TERM_CONNECTION,
        CP_RENEGOTIATE_CODECS_CONNECTION,
        CP_RENEGOTIATE_CODECS_ALL_CONNECTIONS,
        CP_SET_OUTBOUND_LINE,
        CP_OUTGOING_INFO,
        CP_GET_MEDIA_CONNECTION_ID,
        CP_ENABLE_STUN,
        CP_ENABLE_TURN,         
        CP_GET_CAN_ADD_PARTY,
        CP_SPLIT_CONNECTION,
        CP_JOIN_CONNECTION, //80
        CP_CONSULT_TRANSFER_ADDRESS,
        CP_START_TONE_CONNECTION,
        CP_STOP_TONE_CONNECTION,
        CP_PLAY_AUDIO_CONNECTION,
        CP_STOP_AUDIO_CONNECTION,
        CP_TRANSFER_OTHER_PARTY_HOLD,
        CP_TRANSFER_OTHER_PARTY_JOIN,
        CP_TRANSFER_OTHER_PARTY_UNHOLD,
        CP_GET_MEDIA_ENERGY_LEVELS,
        CP_GET_CALL_MEDIA_ENERGY_LEVELS,
        CP_RECORD_AUDIO_CONNECTION_START,
        CP_RECORD_AUDIO_CONNECTION_STOP,
        CP_REFIRE_MEDIA_EVENT,
        CP_LIMIT_CODEC_PREFERENCES,
        CP_SILENT_REMOTE_HOLD,
        CP_GET_USERAGENT
    };

#endif // DOXYGEN_SHOULD_SKIP_THIS

    enum CallTypes
    {
        SIP_CALL = 0,
        MGCP_CALL
    };

    enum CallHoldType
    {
        NEAR_END_HOLD = 0,
        FAR_END_HOLD
    };

    enum CpStatus
    {
        CP_SUCCESS = 0,
        CP_FAILED,
        CP_INVALID_IP_ADDRESS,
        CP_INVALID_SIP_DIRECTORY_SERVER,
        CP_INVALID_SIP_URL
    };

/* ============================ CREATORS ================================== */

{'fraction_non_alphanumeric': 0.09339349565809638, 'fraction_numerical': 0.006895964583688064, 'mean_word_length': 2.6200308166409862, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4877304', 'n_tokens_mistral': 3978, 'n_tokens_neox': 3794, 'n_words': 894}