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

📄 ptconnection.h

📁 基于sipfoundy 公司开发的sipx协议API
💻 H
📖 第 1 页 / 共 2 页
字号:
   /*    * WARNING: These values are used by java.  Please also change these values    *          in PtConnection.java    */   enum ConnectionState   {      IDLE                                              = 0x50,      OFFERED                                   = 0x51,      QUEUED                                    = 0x52,      ALERTING                                  = 0x53,      INITIATED                             = 0x54,      DIALING                                   = 0x55,      NETWORK_REACHED               = 0x56,      NETWORK_ALERTING              = 0x57,      ESTABLISHED                               = 0x58,      DISCONNECTED                          = 0x59,      FAILED                                    = 0x5A,      UNKNOWN                                   = 0x5B   };/* ============================ CREATORS ================================== */        PtConnection();         //:Default constructor        PtConnection(TaoClientTask *pClient, const char *address, const char *callId);        PtConnection(const PtConnection& rPtConnection);         //:Copy constructor        PtConnection& operator=(const PtConnection& rhs);         //:Assignment operator        PtConnection(const char* address, const char* callId);        virtual        ~PtConnection();         //:Destructor/* ============================ MANIPULATORS ============================== */   virtual PtStatus accept(void);     //:Accepts a telephone call incoming to a PtAddress.     //!retcode: PT_SUCCESS - Success     //!retcode: PT_INVALID_STATE - Connection was not in either the OFFERED or ALERTING states.     //!retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available   virtual PtStatus disconnect(void);     //:Drops this connection from an active telephone call.     //!retcode: PT_SUCCESS - Success     //!retcode: PT_INVALID_STATE - Connection was not in an appropriate state for this call.     //!retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available   virtual PtStatus park(char* destinationURL, PtConnection& rNewConnection);     //:Parks a PtConnection at the indicated destination telephone address.     // Parking a PtConnection at a destination address drops this     // PtConnection from the PtCall and sets <i>rpNewConnection</i> to point     // to a new PtConnection at the specified destination address.  The new     // PtConnection will be in the PtConnection::QUEUED state.     //!param: (in) destinationURL - The destination URL where the call should be parked.     //!param: (out) rpNewConnection - Set to point to the PtConnection representing the destination where the call was parked.     //!retcode: PT_SUCCESS - Success     //!retcode: PT_INVALID_STATE - Connection was not in an appropriate state for this call.     //!retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available   virtual PtStatus redirect(char* destinationURL, PtConnection& rNewConnection);     //:Redirects an incoming telephone call to another telephone address.     // This method is very similar to the transfer feature, however,     // applications may invoke this method before first answering the     // telephone call. This method redirects the telephone call to another     // destination address provided as the argument to this method.  Redirecting     // a PtConnection to a destination address drops this PtConnection from the     // PtCall and sets <i>rpNewConnection</i> to point to a new PtConnection at     // the specified destination address.     //!param: (in) destinationURL - The destination URL where the call should be redirected.     //!param: (out) rpNewConnection - Set to point to the PtConnection representing the redirect destination.     //!retcode: PT_SUCCESS - Success     //!retcode: PT_INVALID_STATE - Connection was not in either the OFFERED or ALERTING states.     //!retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available   virtual PtStatus reject(void);     //:Rejects a telephone call incoming to a PtAddress.     //!retcode: PT_SUCCESS - Success     //!retcode: PT_INVALID_STATE - Connection was not in either the OFFERED or ALERTING states.     //!retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available/* ============================ ACCESSORS ================================= */   virtual PtStatus getAddress(PtAddress& rAddress);     //:Sets <i>rpAddress</i> to point to the PtAddress corresponding to this     //:connection.     //!param: (out) rpAddress - Pointer to the address object corresponding to this connection     //!retcode: PT_SUCCESS - Success     //!retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available   virtual PtStatus getCall(PtCall& rCall);     //:Sets <i>rpCall</i> to point to the PtCall corresponding to this     //:connection.     //!param: (out) rpCall - Pointer to the call object corresponding to this connection     //!retcode: PT_SUCCESS - Success     //!retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available   virtual PtStatus getSessionInfo(PtSessionDesc& rSession);     //:Sets <i>rSession</i> to the current session of the connection.     //!param: (out) rSession - Set to the current session of the connection     //!retcode: PT_SUCCESS - Success     //!retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available   virtual PtStatus getState(int& rState);     //:Sets <i>rState</i> to the current state of the connection, either     //:ALERTING, DIALING, DISCONNECTED, ESTABLISHED, FAILED, IDLE,     //:INITIATED, NETWORK_REACHED, NETWORK_ALERTING, OFFERED, QUEUED, or     //:UNKNOWN.     //!param: (out) rState - Set to the current state of the connection     //!retcode: PT_SUCCESS - Success     //!retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available   virtual PtStatus getTerminalConnections(PtTerminalConnection termConnections[],                                   int size, int& nItems);     //:Returns an array of pointers to PtTerminalConnection objects currently     //:associated with this connection.     // The caller provides an array that can hold up to <i>size</i>     // PtTerminalConnection pointers.  This method will fill in the     // <i>termConnections</i> array with up to <i>size</i> pointers.  The     // actual number of pointers filled in is passed back via the     // <i>nItems</i> argument.     //!param: (out) termConnections - The array of PtTerminalConnection pointers     //!param: (in) size - The number of elements in the <i>termConnections</i> array     //!param: (out) nItems - The number of items assigned     //!retcode: PT_SUCCESS - Success     //!retcode: PT_MORE_DATA - There are more than <i>size</i> terminal connections     //!retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available   virtual PtStatus numTerminalConnections(int& count);     //:Returns the number of terminal connections associated with this     //:connection.     //!param: (out) count - The number of terminal connections associated with this connection     //!retcode: PT_SUCCESS - Success     //!retcode: PT_PROVIDER_UNAVAILABLE - The provider is not available  virtual PtStatus getToField(char* pName, int len);        //:Returns the SIP To field, upto len bytes    //!param: (in) len - length of the string to store the To field  virtual PtStatus getFromField(char* pName, int len);        //:Returns the SIP From field, upto len bytes    //!param: (in) len - length of the string to store the From field/* ============================ INQUIRY =================================== */friend class PtConnectionEvent;/* //////////////////////////// PROTECTED ///////////////////////////////// */protected:        UtlString mAddress;        UtlString mCallId;        int        mState;    static OsBSem           semInit ;      //: Binary Semaphore used to guard initialiation and tear down        static TaoReference             *mpTransactionCnt;        static unsigned int              mRef;        PtConnection            *mpConnection;        TaoClientTask           *mpClient;        OsTime                          mTimeOut;        void initialize();/* //////////////////////////// PRIVATE /////////////////////////////////// */private:        OsProtectEventMgr *mpEventMgr;};/* ============================ INLINE METHODS ============================ */#endif  // _PtConnection_h_

⌨️ 快捷键说明

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