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

📄 sipxtapi.h

📁 基于sipfoundy 公司开发的sipx协议API
💻 H
📖 第 1 页 / 共 5 页
字号:
////// Copyright (C) 2005-2006 SIPez LLC.// Licensed to SIPfoundry under a Contributor Agreement.//// Copyright (C) 2004-2006 SIPfoundry Inc.// Licensed by SIPfoundry under the LGPL license.//// Copyright (C) 2004-2006 Pingtel Corp.// Licensed to SIPfoundry under a Contributor Agreement.// //// $$///////////////////////////////////////////////////////////////////////////////** * @mainpage sipXtapi SDK Overview *  * @htmlinclude sipXtapi-overview.html */ /**  * sipXtapi main API declarations **/  #ifndef _sipXtapi_h_#define _sipXtapi_h_#ifndef _VXWORKS#include <memory.h>#endif#include <string.h>#include <stddef.h>       // size_t// SYSTEM INCLUDES#ifdef VIDEO#ifdef _WIN32#if !defined __strmif_h__    #include <strmif.h>#endif#endif#endif#if !defined (_WIN32) || !defined (VIDEO)    typedef void* IBaseFilter;#endif// APPLICATION INCLUDES// DEFINES#define DEFAULT_UDP_PORT        5060    /**< Default UDP port */#define DEFAULT_TCP_PORT        5060    /**< Default TCP port */#define DEFAULT_TLS_PORT        5061    /**< Default TLS port */#define DEFAULT_RTP_START_PORT  9000    /**< Starting RTP port for RTP port range.                                             The user agent will use ports ranging                                              from the start port to the start port                                              + (default connections * 2). */#define DEFAULT_CONNECTIONS     32      /**< Default number of max sim. conns. */#define DEFAULT_IDENTITY        "sipx"  /**< sipx@<IP>:UDP_PORT used as identify if lines                                             are not defined.  This define only controls                                             the userid portion of the SIP url. */#define DEFAULT_BIND_ADDRESS    "0.0.0.0" /**< Bind to the first physical interface discovered */#define CODEC_G711_PCMU         "258"   /**< ID for PCMU vocodec */#define CODEC_G711_PCMA         "257"   /**< ID for PCMA vocodec*/#define CODEC_DTMF_RFC2833      "128"   /**< ID for RFC2833 DMTF (out of band DTMF codec) */#define GAIN_MIN                1       /**< Min acceptable gain value */#define GAIN_MAX                100      /**< Max acceptable gain value */#define GAIN_DEFAULT            70      /**< Nominal gain value */#define VOLUME_MIN              1       /**< Min acceptable volume value */#define VOLUME_MAX              100      /**< Max acceptable volume value */#define VOLUME_DEFAULT          70       /**< Nominal volume value */#define MAX_AUDIO_DEVICES       16      /**< Max number of input/output audio devices */#define CONF_MAX_CONNECTIONS    32      /**< Max number of conference participants */#define SIPX_MAX_IP_ADDRESSES   32      /**< Maximum number of IP addresses on the host */#define SIPX_STUN_NORMAL            0   /** Default STUN options: Do not request change port                                             or change address. */#define SIPX_STUN_CHANGE_PORT       1   /** When sending stun requests for public IP discovery                                             (not ICE), ask the STUN server to send the response                                            from a different port. */ #define SIPX_STUN_CHANGE_ADDRESS    2   /** When sending stun requests for for public IP                                             discovery (not ICE), ask the STUN server to send the                                            response from a different IP address. */#define SIPX_PORT_DISABLE       -1      /**< Special value that disables the transport                                              type (e.g. UDP, TCP, or TLS) when passed                                              to sipXinitialize */#define SIPX_PORT_AUTO          -2      /**< Special value that instructs sipXtapi to                                             automatically select an open port for                                              signaling or audio when passed to                                              sipXinitialize */#define SIPXTAPI_VERSION_STRING "SIPxua SDK %s.%s %s (built %s)" /**< Version string format string */#define SIPXTAPI_VERSION        "2.9.0"      /**< sipXtapi API version -- automatically filled in                                                   during release process */   #define SIPXTAPI_BUILDNUMBER    "0"          /**< Default build number -- automatically filled in                                                   during release process*/#define SIPXTAPI_BUILD_WORD     2,9,0,0      /**< Default build word -- automatically filled in                                                   during release process */#define SIPXTAPI_FULL_VERSION   "2.9.0.X"    /**< Default full version number -- automatically filled in                                                   during release process*/#define SIPXTAPI_BUILDDATE      "2005-03-23" /**< Default build date -- automatically filled in                                                   during release process*/#if defined(_WIN32)#  if defined(SIPXTAPI_EXPORTS)#    define SIPXTAPI_API extern "C" __declspec(dllexport)  /**< Used for Win32 imp lib creation */#  elif defined(SIPXTAPI_STATIC)#    define SIPXTAPI_API extern "C"  /**< Used for Win32 imp lib creation */#  else#    define SIPXTAPI_API extern "C" __declspec(dllimport)  /**< Used for Win32 imp lib creation */#  endif#else#  define SIPXTAPI_API extern "C"   /**< Assume extern "C" for non-win32 platforms */#endif// MACROS// EXTERNAL FUNCTIONS// EXTERNAL VARIABLES// CONSTANTS// FORWARD DECLARATIONSclass UtlString ;class Url ;// STRUCTSclass SipUserAgent ;class SdpCodecFactory ;class CallManager ;class SipLineMgr ;class SipRefreshMgr ;// TYPEDEFS/** * Speaker output types are used to differentiate between the logical ringer  * (used to alert user of in inbound call) and speaker (in call audio device). */typedef enum SPEAKER_TYPE{    SPEAKER,    /**< Speaker / in call device */    RINGER      /**< Ringer / alerting device */} SPEAKER_TYPE ;/** * Codec bandwidth ids are used to select a group of codecs with equal or lower * bandwidth requirements */typedef enum SIPX_AUDIO_BANDWIDTH_ID{    AUDIO_CODEC_BW_VARIABLE=0,   /**< ID for codecs with variable bandwidth requirements */    AUDIO_CODEC_BW_LOW,          /**< ID for codecs with low bandwidth requirements */    AUDIO_CODEC_BW_NORMAL,       /**< ID for codecs with normal bandwidth requirements */    AUDIO_CODEC_BW_HIGH,         /**< ID for codecs with high bandwidth requirements */    AUDIO_CODEC_BW_CUSTOM} SIPX_AUDIO_BANDWIDTH_ID;typedef enum SIPX_VIDEO_BANDWIDTH_ID{    VIDEO_CODEC_BW_VARIABLE=0,   /**< ID for codecs with variable bandwidth requirements */    VIDEO_CODEC_BW_LOW,          /**< ID for codecs with low bandwidth requirements */    VIDEO_CODEC_BW_NORMAL,       /**< ID for codecs with normal bandwidth requirements */    VIDEO_CODEC_BW_HIGH,         /**< ID for codecs with high bandwidth requirements */    VIDEO_CODEC_BW_CUSTOM} SIPX_VIDEO_BANDWIDTH_ID;typedef enum SIPX_VIDEO_QUALITY_ID{    VIDEO_QUALITY_LOW=1,         /**< Low quality video */    VIDEO_QUALITY_NORMAL=2,      /**< Normal quality video */    VIDEO_QUALITY_HIGH=3         /**< High quality video */} SIPX_VIDEO_QUALITY_ID;/** * Format definitions for memory resident audio data */typedef enum SIPX_AUDIO_DATA_FORMAT{    RAW_PCM_16=0                 /**< Signed 16 bit PCM data, mono, 8KHz, no header */} SIPX_AUDIO_DATA_FORMAT;/** * Signature for a log callback function that gets passed three strings, * first string is the priority level, second string is the source id of  * the subsystem that generated the message, and the third string is the  * message itself. */typedef void (*sipxLogCallback)(const char* szPriority,                                const char* szSource,                                const char* szMsg);/** * SIPX_RESULT is an enumeration with all the possible result/return codes. */ typedef enum SIPX_RESULT {    SIPX_RESULT_SUCCESS = 0,         /**< Success */    SIPX_RESULT_FAILURE,             /**< Generic Failure*/    SIPX_RESULT_NOT_IMPLEMENTED,     /**< Method/API not implemented */    SIPX_RESULT_OUT_OF_MEMORY,       /**< Unable to allocate enough memory to perform operation*/    SIPX_RESULT_INVALID_ARGS,        /**< Invalid arguments; bad handle, argument out of range,                                           etc.*/    SIPX_RESULT_BAD_ADDRESS,         /**< Invalid SIP address */    SIPX_RESULT_OUT_OF_RESOURCES,    /**< Out of resources (hit some max limit) */    SIPX_RESULT_INSUFFICIENT_BUFFER, /**< Buffer too short for this operation */    SIPX_RESULT_EVAL_TIMEOUT,        /**< The evaluation version of this product has expired */    SIPX_RESULT_BUSY,                /**< The operation failed because the system was busy */    SIPX_RESULT_INVALID_STATE,       /**< The operation failed because the object was in                                          the wrong state.  For example, attempting to split                                          a call from a conference before that call is                                           connected. */} SIPX_RESULT ;/** * DTMF/other tone ids used with sipxCallStartTone/sipxCallStopTone  */typedef enum TONE_ID{    ID_DTMF_0              = '0',   /**< DMTF 0 */    ID_DTMF_1              = '1',   /**< DMTF 1 */    ID_DTMF_2              = '2',   /**< DMTF 2 */    ID_DTMF_3              = '3',   /**< DMTF 3 */    ID_DTMF_4              = '4',   /**< DMTF 4 */    ID_DTMF_5              = '5',   /**< DMTF 5 */    ID_DTMF_6              = '6',   /**< DMTF 6 */    ID_DTMF_7              = '7',   /**< DMTF 7 */    ID_DTMF_8              = '8',   /**< DMTF 8 */    ID_DTMF_9              = '9',   /**< DMTF 9 */    ID_DTMF_STAR           = '*',   /**< DMTF * */    ID_DTMF_POUND          = '#',   /**< DMTF # */    ID_DTMF_FLASH          = '!',   /**< DTMF Flash */    ID_TONE_DIALTONE  = 512,        /**< Dialtone */    ID_TONE_BUSY,                   /**< Call-busy tone */    ID_TONE_RINGBACK,               /**< Remote party is ringing feedback tone */    ID_TONE_RINGTONE,               /**< Default ring/alert tone */    ID_TONE_CALLFAILED,             /**< Fasy Busy / call failed tone */    ID_TONE_SILENCE,                /**< Silence */    ID_TONE_BACKSPACE,              /**< Backspace tone */    ID_TONE_CALLWAITING,            /**< Call waiting alert tone*/    ID_TONE_CALLHELD,               /**< Call held feedback tone */    ID_TONE_LOUD_FAST_BUSY          /**< Off hook / fast busy tone */} TONE_ID ;                 /** * Various log levels available for the sipxConfigEnableLog method.   * Developers can choose the amount of detail available in the log. * Each level includes messages generated at lower levels.  For  * example, LOG_LEVEL_EMERG will limit the log to emergency messsages, * while LOG_LEVEL_ERR includes emergency messages, alert messages,  * critical messages, and errors.  LOG_LEVEL_ERR is probably best for * general runtime situations.  LOG_LEVEL_INFO or LOG_LEVEL_DEBUG is  * best for diagnosing problems. */typedef enum SIPX_LOG_LEVEL{    LOG_LEVEL_DEBUG,     /**< debug-level messages */    LOG_LEVEL_INFO,      /**< informational messages */    LOG_LEVEL_NOTICE,    /**< normal, but significant, conditions */    LOG_LEVEL_WARNING,   /**< warning conditions */    LOG_LEVEL_ERR,       /**< error conditions */    LOG_LEVEL_CRIT,      /**< critical conditions */    LOG_LEVEL_ALERT,     /**< action must be taken immediately */    LOG_LEVEL_EMERG,     /**< system is unusable */    LOG_LEVEL_NONE,      /**< disable logging */} SIPX_LOG_LEVEL ;class SIPX_SECURITY_ATTRIBUTES{public:    SIPX_SECURITY_ATTRIBUTES()    {    }        SIPX_SECURITY_ATTRIBUTES(const SIPX_SECURITY_ATTRIBUTES& ref)    {    }        SIPX_SECURITY_ATTRIBUTES& operator=(const SIPX_SECURITY_ATTRIBUTES& ref)    {        // Need to be implemented!!!        if (this == &ref)            return *this;           return *this;    }    private:};/** * SIPX_CONTACT_TYPE is an enumeration of possible address type for use with * SIP contacts and SDP connection information. */typedef enum{    CONTACT_LOCAL,      /**< Local address for a particular interface */    CONTACT_NAT_MAPPED, /**< NAT mapped address (e.g. STUN)           */    CONTACT_RELAY,      /**< Relay address (e.g. TURN)                */    CONTACT_CONFIG,     /**< Manually configured address              */    CONTACT_AUTO = -1,  /**< Automatic contact selection; used for API 

⌨️ 快捷键说明

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