📄 sipxtapi.h
字号:
SIPXTAPI_API SIPX_RESULT sipxCallAccept(const SIPX_CALL hCall, SIPX_VIDEO_DISPLAY* const pDisplay = NULL);/** VIDEO: Insert SIPX_WINDOW_HANDLE here *//** * Reject an inbound call (prior to alerting the user). This method must * be invoked before the end user is alerted (before sipXcallAccept). * Whenever a new call is received, the application developer should ACCEPT * (proceed to ringing), REJECT (send back busy), or REDIRECT the call. * * @param hCall Handle to a call. Call handles are obtained either by * invoking sipxCallCreate or passed to your application through * a listener interface. * @param errorCode RFC specified error code. * @param szErrorText null terminated text string to explain the error code. */SIPXTAPI_API SIPX_RESULT sipxCallReject(const SIPX_CALL hCall, const int errorCode = 400, const char* szErrorText = "Bad Request") ;/** * Redirect an inbound call (prior to alerting the user). This method must * be invoked before the end user is alerted (before sipXcallAccept). * Whenever a new call is received, the application developer should ACCEPT * (proceed to ringing), REJECT (send back busy), or REDIRECT the call. * * @param hCall Handle to a call. Call handles are obtained either by * invoking sipxCallCreate or passed to your application through * a listener interface. * @param szForwardURL SIP url to forward/redirect the call to. */SIPXTAPI_API SIPX_RESULT sipxCallRedirect(const SIPX_CALL hCall, const char* szForwardURL) ;/** * Answer an alerting call. * * @param hCall Handle to a call. Call handles are obtained either by * invoking sipxCallCreate or passed to your application through * a listener interface. */SIPXTAPI_API SIPX_RESULT sipxCallAnswer(const SIPX_CALL hCall) ;/** * Create a new call for the purpose of creating an outbound connection/call. * As a side effect, a DIALTONE event is fired to simulate the PSTN world. * Generally an application would simulate dialtone in reaction to that * event. * * @param hInst Instance pointer obtained by sipxInitialize. * @param hLine Line Identity for the outbound call. The line identity * helps defines the "From" caller-id. * @param phCall Pointer to a call handle. Upon success, this value is * replaced with a valid call handle. Success is determined by * the SIPX_RESULT result code. */SIPXTAPI_API SIPX_RESULT sipxCallCreate(const SIPX_INST hInst, const SIPX_LINE hLine, SIPX_CALL* phCall) ;/** * Connects an idle call to the designated target address * * @param hCall Handle to a call. Call handles are obtained either by * invoking sipxCallCreate or passed to your application through * a listener interface. * @param szAddress SIP url of the target party * @param contactId Id of the desired contact record to use for this call. * The id refers to a Contact Record obtained by a call to * sipxConfigGetLocalContacts. The application can choose a * contact record of type LOCAL, NAT_MAPPED, CONFIG, or RELAY. * The Contact Type allows you to control whether the * user agent and media processing advertises the local address * (e.g. LOCAL contact of 10.1.1.x or * 192.168.x.x), the NAT-derived address to the target party, * or, local contact addresses of other types. * @param pDislay Pointer to an object describing the display object for * rendering remote video. */SIPXTAPI_API SIPX_RESULT sipxCallConnect(const SIPX_CALL hCall, const char* szAddress, SIPX_CONTACT_ID contactId = 0, SIPX_VIDEO_DISPLAY* const pDisplay = NULL) ;/** * Placed the specified call on hold. * * @param hCall Handle to a call. Call handles are obtained either by * invoking sipxCallCreate or passed to your application through * a listener interface. */ SIPXTAPI_API SIPX_RESULT sipxCallHold(const SIPX_CALL hCall) ;/** * Take the specified call off hold. * * @param hCall Handle to a call. Call handles are obtained either by * invoking sipxCallCreate or passed to your application through * a listener interface. */ SIPXTAPI_API SIPX_RESULT sipxCallUnhold(const SIPX_CALL hCall) ;/** * Drop/Destroy the specified call. * * @param hCall Handle to a call. Call handles are obtained either by * invoking sipxCallCreate or passed to your application through * a listener interface. */ SIPXTAPI_API SIPX_RESULT sipxCallDestroy(SIPX_CALL& hCall) ;/** * Get the SIP call ID of the call represented by the specified call handle. * * @param hCall Handle to a call. Call handles are obtained either by * invoking sipxCallCreate or passed to your application through * a listener interface. * @param szId Buffer to store the ID. A zero-terminated string will be * copied into this buffer on success. * @param iMaxLength Max length of the ID buffer */SIPXTAPI_API SIPX_RESULT sipxCallGetID(const SIPX_CALL hCall, char* szId, const size_t iMaxLength) ;/** * Get the SIP identity of the local connection. The identity represents * either 1) who was called in the case of a inbound call, or 2) the * line identity used in an outbound call. * * @param hCall Handle to a call. Call handles are obtained either by * invoking sipxCallCreate or passed to your application through * a listener interface. * @param szId Buffer to store the ID. A zero-terminated string will be * copied into this buffer on success. * @param iMaxLength Max length of the ID buffer. */SIPXTAPI_API SIPX_RESULT sipxCallGetLocalID(const SIPX_CALL hCall, char* szId, const size_t iMaxLength) ;/** * Get the SIP identity of the remote connection. * * @param hCall Handle to a call. Call handles are obtained either by * invoking sipxCallCreate or passed to your application through * a listener interface. * @param szId Buffer to store the ID. A zero-terminated string will be * copied into this buffer on success. * @param iMaxLength Max length of the ID buffer. */SIPXTAPI_API SIPX_RESULT sipxCallGetRemoteID(const SIPX_CALL hCall, char* szId, const size_t iMaxLength) ;/** * Set a new asserted identity for the local connection * * This function is used to change the identity of the local connection * used in the SIP signalling for the given call. This operation is * useful in applications like B2BUA where the local identity changes * (e.g. as a result of a local operation like bridging or transfer not * exposed to the signalling in this call. From a SIP signalling * perspective this sets the PAssertedIdentity header field (RFC 3325). * * @param hCall the call in which the local identity or caller id is to be * changed * @param szPAssertedId the new SIP identity to be user for the local * connection in the given call. * @param bSignalNow signal the identity change now. true causes a * SIP reINVITE now, false will signal the identity change with * the next on or off hold reINVITE */SIPXTAPI_API SIPX_RESULT sipxCallSetAssertedId(const SIPX_CALL hCall, const char* szPAssertedId, const bool bSignalNow);/** * Gets the media interface connectionid. * * @param hCall Handle to a call. Call handles are obtained either by * invoking sipxCallCreate or passed to your application through * a listener interface. * @param connectionId Reference to the returned connection identifier. */SIPXTAPI_API SIPX_RESULT sipxCallGetConnectionId(const SIPX_CALL hCall, int& connectionId); /** * Get the SIP request uri. * * @param hCall Handle to a call. Call handles are obtained either by * invoking sipxCallCreate or passed to your application through * a listener interface. * @param szUri Buffer to store the request uri. A zero-terminated string will be * copied into this buffer on success. * @param iMaxLength Max length of the request uri buffer. */SIPXTAPI_API SIPX_RESULT sipxCallGetRequestURI(const SIPX_CALL hCall, char* szUri, const size_t iMaxLength) ; /** * Get the SIP remote contact. * * @param hCall Handle to a call. Call handles are obtained either by * invoking sipxCallCreate or passed to your application through * a listener interface. * @param szContact Buffer to store the remote contact. A zero-terminated string will be * copied into this buffer on success. * @param iMaxLength Max length of the remote contact buffer. */SIPXTAPI_API SIPX_RESULT sipxCallGetRemoteContact(const SIPX_CALL hCall, char* szContact, const size_t iMaxLength) ; /** * Play a tone (DTMF, dialtone, ring back, etc) to the local and/or * remote party. See the DTMF_ constants for built-in tones. * * @param hCall Handle to a call. Call handles are obtained either by * invoking sipxCallCreate or passed to your application through * a listener interface. * @param toneId ID of the tone to play * @param bLocal Should the tone be played locally? * @param bRemote Should the tone be played to the remote party? */SIPXTAPI_API SIPX_RESULT sipxCallStartTone(const SIPX_CALL hCall, const TONE_ID toneId, const bool bLocal, const bool bRemote) ;/** * Stop playing a tone (DTMF, dialtone, ring back, etc). to local * and remote parties. * * @param hCall Handle to a call. Call handles are obtained either by * invoking sipxCallCreate or passed to your application through * a listener interface. */SIPXTAPI_API SIPX_RESULT sipxCallStopTone(const SIPX_CALL hCall) ;/** * Play the designed file. The file may be a raw 16 bit signed PCM at * 8000 samples/sec, mono, little endian or a .WAV file. * * @param hCall Handle to a call. Call handles are obtained either by * invoking sipxCallCreate or passed to your application through * a listener interface. Audio files can only be played in the * context of a call. * @param szFile Filename for the audio file to be played. * @param bLocal True if the audio file is to be rendered locally. * @param bRemote True if the audio file is to be rendered by the remote * endpoint. * For backward compatibility. * @deprecated Use sipxCallPlayFileStart instead */SIPXTAPI_API SIPX_RESULT sipxCallPlayFile(const SIPX_CALL hCall, const char* szFile, const bool bLocal, const bool bRemote) ;/** VIDEO: sipxCallPlay APIs MUST be renamed to sipxCallAudioPlay *//** * Play the designed file. The file may be a raw 16 bit signed PCM at * 8000 samples/sec, mono, little endian or a .WAV file. * * @param hCall Handle to a call. Call handles are obtained either by * invoking sipxCallCreate or passed to your application through * a listener interface. Audio files can only be played in the * context of a call. * @param szFile Filename for the audio file to be played. * @param bRepeat True if the file is supposed to be played repeatedly * @param bLocal True if the audio file is to be rendered locally. * @param bRemote True if the audio file is to be rendered by the remote * endpoint. */SIPXTAPI_API SIPX_RESULT sipxCallPlayFileStart(const SIPX_CALL hCall, const char* szFile, const bool bRepeat, const bool bLocal, const bool bRemote) ;/** * Stop playing a file started with sipxCallPlayFileStart * * @param hCall Handle to a call. Call handles are obtained either by * invoking sipxCallCreate or passed to your application through * a listener interface. Audio files can only be played and stopped * in the context of a call. */SIPXTAPI_API SIPX_RESULT sipxCallPlayFileStop(const SIPX_CALL hCall) ; /** * Play the specified audio data. Currently the only data format that * is supported is raw 16 bit signed PCM at 8000 samples/sec, mono,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -