?? cppeercall.h
字號:
// // // Copyright (C) 2005, 2006 SIPez LLC// Licensed to SIPfoundry under a Contributor Agreement.//// Copyright (C) 2005, 2006 SIPfoundry Inc.// Licensed by SIPfoundry under the LGPL license.// // Copyright (C) 2004, 2005 Pingtel Corp.// Licensed to SIPfoundry under a Contributor Agreement.// // $$//////////////////////////////////////////////////////////////////////////////// Author: Dan Petrie (dpetrie AT SIPez DOT com)#ifndef _CpPeerCall_h_#define _CpPeerCall_h_// SYSTEM INCLUDES//#include <...>// APPLICATION INCLUDES//#include <cp/PhoneApplication.h>#include <cp/CpCall.h>#include <cp/Connection.h>#include <os/OsRWMutex.h>#include <cp/CallManager.h>#include "tapi/sipXtapiEvents.h"// DEFINES// MACROS// EXTERNAL FUNCTIONS// EXTERNAL VARIABLES// CONSTANTS// STRUCTS// TYPEDEFS// FORWARD DECLARATIONSclass Connection;class SipUserAgent;class CpIntMessage;class OsQueuedEvent;class OsTimer;//:Class short description which may consist of multiple lines (note the ':')// Class detailed description which may extend to multiple linesclass CpPeerCall : public CpCall{ /* //////////////////////////// PUBLIC //////////////////////////////////// */public: enum callDialingMode { UNKNOWN = 0, ADD_PARTY, BLIND_TRANSFER }; /* ============================ CREATORS ================================== */ CpPeerCall(UtlBoolean isEarlyMediaFor180Enabled = TRUE, CpCallManager* callManger = NULL, CpMediaInterface* callMediaInterface = NULL, int callIndex = -1, const char* callId = NULL, SipUserAgent* sipUA = NULL, int sipSessionReinviteTimer = 0, const char* defaultCallExtension = NULL, int holdType = CallManager::NEAR_END_HOLD, int offeringDelayMilliSeconds = Connection::IMMEDIATE, int availableBehavior = Connection::RING, const char* forwardUnconditionalUrl = NULL, int busyBehavior = Connection::BUSY, const char* forwardOnBusyUrl = NULL, int forwardOnNoAnswerMilliSeconds = -1, const char* forwardOnNoAnswerUrl = NULL, int ringingExpireSeconds = CP_MAXIMUM_RINGING_EXPIRE_SECONDS /* = 180 */); //:Default constructor //! param: callManager - the call processing task manager //! param: sipUA - SIP user agent task //! param: defaultCallExtension - the local user name/phone extension //! param: holdType - NEAR_SIDE_HOLD hold is handled in the media layer to mute the media in both directions, FAR_SIDE_HOLD hold is handled at the call control protocol layer //! param: offeringDelayMilliSeconds - the period of time that the call stays in offering before proceeding to the next state (i.e. ALERTING). A value of -1 indicates a delay of forever. Typically the user or an application acting on behalf of the user will take the call out of offering by accepting or regjecting the call. //! param: availableBehavior - defines the behavior of incoming calls after the offering delay times out and the phone (and resources) is available to take a call. This must be set to one of the lineAvailableBehaviors enumerations. //! param: forwardUnconditionalUrl - the URL to which the call is unconditionaly forwarded. This argument is ignored if availableBehavior is not set to FORWARD_UNCONDITIONAL //! param: busyBehavior - defines the behavior of incoming calls after the offering delay times out and the phone (and resources) are busy. This must be set to one of the lineBusyBehaviors enumerations. //! param: forwardOnBusyUrl - the URL to which the call is forwarded when the phone is busy. This argument is ignored if busyBehavior is not set to FORWARD_ON_BUSY //! param: forwardOnNoAnswerMilliSeconds - after a call rings (RING, RING_SILENT or FAKE_RING) for this period of time, forward the call to the URL in forwardOnNoAnswerUrl. A value of -1 indicates never. //! param: forwardOnNoAnswerUrl - the URL to which the call is fowarded on no answer after ringing. virtual ~CpPeerCall(); //:Destructor /* ============================ MANIPULATORS ============================== */ virtual void inFocus(int talking = 1); virtual void outOfFocus(); //virtual void blindTransfer(); //virtual void conferenceAddParty(); Connection* addParty(const char* partyAddress, const char* callController, const char* originalCallConnectionAddress, const char* pNewCallId, CONTACT_ID contactId = 0, const void* pDisplay = NULL); Connection* stringDial(OsMsg& eventMessage, UtlString& dialString); /* ============================ ACCESSORS ================================= */ virtual void printCall(); virtual void getLocalAddress(char* address, int len); virtual void getLocalTerminalId(char* terminal, int len); void hangUp(const char* callId, const char* toTag, const char* fromTag); UtlBoolean getConnectionState(const char* callId, const char* toTag, const char* fromTag, int& state, UtlBoolean strictCompare); //:Get the connection for the connection identified by the designated //:callId, toTag, and fromTag. If the connection cannot be found a //:UtlBoolean value of false is returned. /* ============================ INQUIRY =================================== */ static UtlBoolean shouldCreateCall(SipUserAgent& sipUa, OsMsg& message, SdpCodecFactory& codecFactory); virtual UtlBoolean hasCallId(const char* callId); virtual enum handleWillingness willHandleMessage(const OsMsg& eventMessage); virtual UtlBoolean isQueued(); virtual UtlBoolean isLocalTerminal(const char* terminalId); UtlBoolean isConnection(const char* callId, const char* toTag, const char* fromTag); virtual UtlBoolean canDisconnectConnection(Connection* pConnection); /* //////////////////////////// PROTECTED ///////////////////////////////// */protected: virtual UtlBoolean handleCallMessage(OsMsg& eventMessage); void addTaoListenerToConnection(Connection* connection); void addToneListenersToConnection(Connection* connection); UtlBoolean handleRenegotiateCodecsConnection(OsMsg* pEventMessage); //: Handles the processing of a CallManager::CP_RENEGOTIATE_CODECS_CONNECTION //: message UtlBoolean handleRenegotiateCodecsAllConnections(OsMsg* pEventMessage); //: Handles the processing of a CallManager::CP_RENEGOTIATE_CODECS_ALL_CONNECTIONS //: message UtlBoolean handleGetCodecCPULimit(OsMsg& eventMessage); //: Handles the processing of a CallManager::CP_GET_CODEC_CPU_LIMIT //: message UtlBoolean handleSetCodecCPULimit(OsMsg& eventMessage); //: Handles the processing of a CallManager::CP_SET_CODEC_CPU_LIMIT //: message UtlBoolean handleGetCodecCPUCost(OsMsg& eventMessage); //: Handles the processing of a CallManager::CP_GET_CODEC_CPU_COST //: message UtlBoolean handleDialString(OsMsg* pEventMessage); //: Handles the processing of a CallManager::CP_DIAL_STRING message UtlBoolean handleDequeueCall(OsMsg* pEventMessage); //: Handles the processing of a CallManager::CP_DEQUEUED_CALL message UtlBoolean handleTransfer(OsMsg* pEventMessage); //: Handles the processing of a CallManager::CP_BLIND_TRANSFER and //: CallManager::CP_CONSULT_TRANSFER messages UtlBoolean handleTransferAddress(OsMsg* pEventMessage); //: Handles the processing of a CallManager::CP_CONSULT_TRANSFER_ADDRESS //: message UtlBoolean handleTransferConnection(OsMsg* pEventMessage); //: Handles the processing of a CallManager::CP_TRANSFER_CONNECTION //: message UtlBoolean handleTransfereeConnection(OsMsg* pEventMessage); //: Handles the processing of a CallManager::CP_TRANSFEREE_CONNECTION //: message UtlBoolean handleSipMessage(OsMsg* pEventMessage); //: Handles the processing of a CallManager::CP_SIP_MESSAGE message
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -