⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 connection.h

📁 基于sipfoundy 公司开发的sipx协议API
💻 H
📖 第 1 页 / 共 2 页
字号:
// // // 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 _Connection_h_#define _Connection_h_// SYSTEM INCLUDES//#include <...>// APPLICATION INCLUDES#include <utl/UtlString.h>#include <os/OsMutex.h>#include <tapi/sipXtapiEvents.h>#include <tapi/sipXtapiInternal.h>#include <net/SipContactDb.h>// DEFINES#	define LOCAL_ONLY 0#	define LOCAL_AND_REMOTE 1// MACROS// EXTERNAL FUNCTIONS// EXTERNAL VARIABLES// CONSTANTS// STRUCTS// TYPEDEFS// FORWARD DECLARATIONSclass CpCallManager;class CpCall;class CpMediaInterface;class OsDatagramSocket;class SdpCodec;class SipSession;class OsMsg;class TaoObjectMap;class TaoReference;class OsServerTask;class Url;//:logical Connection within a call// The Connection encapsulates the call setup protocol and state// information for the leg of a call to a particular address.class Connection: public UtlString{/* //////////////////////////// PUBLIC //////////////////////////////////// */public:	enum connectionStates	{		CONNECTION_IDLE,		CONNECTION_QUEUED,		CONNECTION_OFFERING,		CONNECTION_ALERTING,		CONNECTION_ESTABLISHED,		CONNECTION_FAILED,		CONNECTION_DISCONNECTED,        CONNECTION_UNKNOWN,        CONNECTION_INITIATED,        CONNECTION_DIALING,        CONNECTION_NETWORK_REACHED,        CONNECTION_NETWORK_ALERTING	}; 	enum termConnectionStates 	{ 		TERMCONNECTION_NONE, 		TERMCONNECTION_HOLDING, 		TERMCONNECTION_HELD, 		TERMCONNECTION_TALKING 	};   	enum connectionType	{		CONNECTION_REMOTE	= 0,		CONNECTION_LOCAL	= 1	};	//	// WARNING: The order/values of these constants are used in java.  Please 	//          do not change these without updating the java world.	//    enum connectionStateCauses    {        // General causes:        CONNECTION_CAUSE_NORMAL,        CONNECTION_CAUSE_UNKNOWN,        // CONNECTION_IDLE causes:		// CONNECTION_QUEUED causes:		// CONNECTION_OFFERING causes:        CONNECTION_CAUSE_REDIRECTED,		// CONNECTION_ALERTING causes:        //CONNECTION_CAUSE_CALL_NOT_ANSWERED,        CONNECTION_CAUSE_CALL_PICKUP,        //CONNECTION_CAUSE_LOCAL_RINGBACK = CONNECTION_CAUSE_NONE,        //CONNECTION_CAUSE_REMOTE_RINGBACK = CONNECTION_CAUSE_UNKNOWN,		// CONNECTION_ESTABLISHED causes:		CONNECTION_CAUSE_UNHOLD,		// CONNECTION_FAILED causes:        CONNECTION_CAUSE_BUSY,        CONNECTION_CAUSE_NETWORK_CONGESTION,		CONNECTION_CAUSE_RESOURCES_NOT_AVAILABLE,        CONNECTION_CAUSE_NETWORK_NOT_OBTAINABLE,        CONNECTION_CAUSE_DEST_NOT_OBTAINABLE,        CONNECTION_CAUSE_INCOMPATIBLE_DESTINATION,		    CONNECTION_CAUSE_SERVICE_UNAVAILABLE,        CONNECTION_CAUSE_NOT_ALLOWED, // unauthorized by endpoint        CONNECTION_CAUSE_NETWORK_NOT_ALLOWED, // unauthorized by network/servers        CONNECTION_CAUSE_CANCELLED,		// CONNECTION_DISCONNECTED causes:        CONNECTION_CAUSE_TRANSFER    };    enum offeringModes 	{ 		IMMEDIATE = 0, 		NEVER = -1 	};    enum lineAvailableBehaviors    {        RING = 100,        FAKE_BUSY,        RING_SILENT,        AUTO_ANSWER,        FORWARD_UNCONDITIONAL,		FORWARD_ON_NO_ANSWER    };    //: Incoming call lineAvailableBehaviors    // The following define the different behaviors for an incoming call when the     // phone (and resources) is available to take a call.    //    //!enumcode: RING - make the phone ring to alert the user    //!enumcode: FAKE_BUSY - indicate to the caller that the phone is busy, do not alert the callee    //!enumcode: RING_SILENT - indicate to the caller that the phone is ringing, do not alert the callee    //!enumcode: AUTO_ANSWER - automatically answer the call, alert the callee and enable the speaker phone    //!enumcode: FORWARD_UNCONDITIONAL - forward the call even though the phone is available    enum lineBusyBehaviors    {        BUSY = 200,        FAKE_RING,        FORCED_ANSWER,        FORWARD_ON_BUSY,        QUEUE_SILENT,        QUEUE_ALERT    };    //: Incoming call lineBusyBehaviors    // The following define the different behaviors for an incoming call when the     // phone (and resources) is busy.    //    //!enumcode: BUSY - indicate to the caller that the phone is busy    //!enumcode: FAKE_RING - indicate to the caller that the phone is ringing, do not alert the callee    //!enumcode: FORCED_ANSWER - put the active call on hold, automatically answer the call, alert the callee and enable the speaker phone    //!enumcode: FORWARD_ON_BUSY - forward the call    //!enumcode: QUEUE_SILENT - indicate to the caller that the call is being queued, do not alert the callee    //!enumcode: QUEUE_ALERT - indicate to the caller that the call is being queued, alert the callee/* ============================ CREATORS ================================== */   Connection(CpCallManager* callMgr = NULL,              CpCall* call = NULL,              CpMediaInterface* mediaInterface = NULL,               int offeringDelayMilliSeconds = IMMEDIATE,              int availableBehavior = RING,               const char* forwardUnconditionalUrl = NULL,              int busyBehavior = BUSY,               const char* forwardOnBusyUrl = NULL,              int fowardOnNoAnswerSeconds = -1);     //:Default constructor   virtual   ~Connection();     //:Destructor/* ============================ MANIPULATORS ============================== */   virtual void prepareForSplit() ;   virtual void prepareForJoin(CpCall* pNewCall, CpMediaInterface* pNewMediaInterface) ;   virtual void forceHangUp(int connectionState = CONNECTION_DISCONNECTED)   {	   setState(connectionState, CONNECTION_REMOTE);      fireSipXEvent(CALLSTATE_CONNECTED, CALLSTATE_CONNECTED_ACTIVE) ;   }   virtual UtlBoolean dequeue(UtlBoolean callInFocus) = 0;   virtual UtlBoolean dial(const char* dialString,						  const char* callerId,						  const char* callId,                          const char* callController = NULL,                          const char* originalCallConnection = NULL,                          UtlBoolean requestQueuedCall = FALSE,                          const void* pDisplay = NULL) = 0;   //! param: requestQueuedCall - indicates that the caller wishes to have the callee queue the call if busy   virtual UtlBoolean originalCallTransfer(UtlString& transferTargetAddress,                                           const char* transferControllerAddress,                                           const char* targetCallId,                                           bool       remoteHoldBeforeTransfer = true                                           ) = 0;   // Initiate transfer on transfer controller connection in    // the original call.   // If fromAddress or toAddress are NULL it is assumed to   // be a blind transfer.   virtual UtlBoolean targetCallBlindTransfer(const char* transferTargetAddress,						           const char* transferControllerAddress) = 0;   // Communicate blind transfer on transfer controller connection in    // the target call.  This is signaled by the transfer controller in the   // original call.   virtual UtlBoolean transfereeStatus(int connectionState, int response) = 0;   // Method to communicate status to original call on transferee side

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -