michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef _CCAPI_CALL_H_ michael@0: #define _CCAPI_CALL_H_ michael@0: michael@0: #if defined(__cplusplus) && __cplusplus >= 201103L michael@0: typedef struct Timecard Timecard; michael@0: #else michael@0: #include "timecard.h" michael@0: #endif michael@0: michael@0: #include "ccapi_types.h" michael@0: michael@0: /** michael@0: * Get reference to call info michael@0: * @param [in] handle - call handle michael@0: * @return cc_call_info_snap_t michael@0: * NOTE: The info returned by this method must be released using CCAPI_Call_releaseCallInfo() michael@0: */ michael@0: cc_callinfo_ref_t CCAPI_Call_getCallInfo(cc_call_handle_t handle); michael@0: michael@0: /** michael@0: * Release the resources held by this call info snapshot michael@0: * @param [in] ref - refrence to the call info to be freed michael@0: * @return void michael@0: */ michael@0: void CCAPI_Call_releaseCallInfo(cc_callinfo_ref_t ref); michael@0: michael@0: /** michael@0: * Retain the call info reference michael@0: * @param [in] ref - reference to the call info to be retained michael@0: * @return void michael@0: * NOTE: Application that has retained callInfo must call CCAPI_Call_releaseCallInfo() michael@0: * to free memory associated with this Info. michael@0: */ michael@0: void CCAPI_Call_retainCallInfo(cc_callinfo_ref_t ref); michael@0: michael@0: /** michael@0: * get the line associated with this call michael@0: * @param [in] handle - call handle michael@0: * @return cc_lineid_t michael@0: */ michael@0: cc_lineid_t CCAPI_Call_getLine(cc_call_handle_t call_handle); michael@0: michael@0: /** michael@0: * Originate call - API to go offhook and dial specified digits on a given call michael@0: * @param [in] handle - call handle michael@0: * @param [in] video_pref - video direction desired on call michael@0: * @param [in] digits - digits to be dialed. can be empty then this API simply goes offhook michael@0: * @return SUCCESS or FAILURE michael@0: */ michael@0: cc_return_t CCAPI_Call_originateCall(cc_call_handle_t handle, cc_sdp_direction_t video_pref, cc_string_t digits); michael@0: michael@0: michael@0: cc_return_t CCAPI_CreateOffer(cc_call_handle_t handle, michael@0: cc_media_constraints_t *constraints, michael@0: Timecard *tc); michael@0: michael@0: cc_return_t CCAPI_CreateAnswer(cc_call_handle_t handle, michael@0: cc_media_constraints_t *constraints, michael@0: Timecard *tc); michael@0: michael@0: cc_return_t CCAPI_SetLocalDescription(cc_call_handle_t handle, michael@0: cc_jsep_action_t action, michael@0: cc_string_t sdp, michael@0: Timecard *tc); michael@0: michael@0: cc_return_t CCAPI_SetRemoteDescription(cc_call_handle_t handle, michael@0: cc_jsep_action_t action, michael@0: cc_string_t sdp, michael@0: Timecard *tc); michael@0: michael@0: cc_return_t CCAPI_SetPeerConnection(cc_call_handle_t handle, cc_peerconnection_t pc); michael@0: michael@0: cc_return_t CCAPI_AddStream(cc_call_handle_t handle, michael@0: cc_media_stream_id_t stream_id, michael@0: cc_media_track_id_t track_id, michael@0: cc_media_type_t media_type, michael@0: cc_media_constraints_t *constraints); michael@0: michael@0: cc_return_t CCAPI_RemoveStream(cc_call_handle_t handle, cc_media_stream_id_t stream_id, cc_media_track_id_t track_id, cc_media_type_t media_type); michael@0: michael@0: cc_return_t CCAPI_AddICECandidate(cc_call_handle_t handle, michael@0: cc_string_t candidate, michael@0: cc_string_t mid, michael@0: cc_level_t level, michael@0: Timecard *tc); michael@0: michael@0: /** michael@0: * Send digits on the call - can be invoked either to dial additional digits or send DTMF michael@0: * @param [in] handle - call handle michael@0: * @param [in] digit - digit to be dialed michael@0: * @return SUCCESS or FAILURE michael@0: */ michael@0: cc_return_t CCAPI_Call_sendDigit(cc_call_handle_t handle, cc_digit_t digit); michael@0: michael@0: /** michael@0: * Send Backspace - Delete last digit dialed. michael@0: * @param [in] handle - call handle michael@0: * @return SUCCESS or FAILURE michael@0: */ michael@0: cc_return_t CCAPI_Call_backspace(cc_call_handle_t handle); michael@0: michael@0: /** michael@0: * Answer Call michael@0: * @param [in] handle - call handle michael@0: * @param [in] video_pref - video direction desired on call michael@0: * @return SUCCESS or FAILURE michael@0: */ michael@0: cc_return_t CCAPI_Call_answerCall(cc_call_handle_t handle, cc_sdp_direction_t video_pref); michael@0: michael@0: /** michael@0: * Redial michael@0: * @param [in] handle - call handle michael@0: * @param [in] video_pref - video direction desired on call michael@0: * @return SUCCESS or FAILURE michael@0: */ michael@0: cc_return_t CCAPI_Call_redial(cc_call_handle_t handle, cc_sdp_direction_t video_pref); michael@0: michael@0: /** michael@0: * Initiate Call Forward All michael@0: * @param [in] handle - call handle michael@0: * @return SUCCESS or FAILURE michael@0: */ michael@0: cc_return_t CCAPI_Call_initiateCallForwardAll(cc_call_handle_t handle); michael@0: /** michael@0: * Hold michael@0: * @param [in] handle - call handle michael@0: * @param [in] reason - hold reason michael@0: * @return SUCCESS or FAILURE michael@0: */ michael@0: cc_return_t CCAPI_Call_hold(cc_call_handle_t handle, cc_hold_reason_t reason); michael@0: michael@0: /** michael@0: * Resume michael@0: * @param [in] handle - call handle michael@0: * @param [in] video_pref - video direction desired on call michael@0: * @return SUCCESS or FAILURE michael@0: */ michael@0: cc_return_t CCAPI_Call_resume(cc_call_handle_t handle, cc_sdp_direction_t video_pref) ; michael@0: michael@0: /** michael@0: * end Consult leg - used to end consult leg when the user picks active calls list for xfer/conf michael@0: * @param [in] handle - call handle michael@0: * @return SUCCESS or FAILURE michael@0: */ michael@0: cc_return_t CCAPI_Call_endConsultativeCall(cc_call_handle_t handle); michael@0: michael@0: /** michael@0: * end Call michael@0: * @param [in] handle - call handle michael@0: * @return SUCCESS or FAILURE michael@0: */ michael@0: cc_return_t CCAPI_Call_endCall(cc_call_handle_t handle); michael@0: michael@0: /** michael@0: * Initiate a conference michael@0: * @param [in] handle - call handle michael@0: * @param [in] video_pref - video direction desired on consult call michael@0: * @return SUCCESS or FAILURE michael@0: */ michael@0: cc_return_t CCAPI_Call_conferenceStart(cc_call_handle_t handle, cc_sdp_direction_t video_pref); michael@0: michael@0: /** michael@0: * complete conference michael@0: * @param [in] handle - call handle michael@0: * @param [in] phandle - call handle of the other leg michael@0: * @param [in] video_pref - video direction desired on consult call michael@0: * @return SUCCESS or FAILURE michael@0: */ michael@0: cc_return_t CCAPI_Call_conferenceComplete(cc_call_handle_t handle, cc_call_handle_t phandle, michael@0: cc_sdp_direction_t video_pref); michael@0: michael@0: /** michael@0: * start transfer michael@0: * @param [in] handle - call handle michael@0: * @param [in] video_pref - video direction desired on consult call michael@0: * @return SUCCESS or FAILURE michael@0: */ michael@0: cc_return_t CCAPI_Call_transferStart(cc_call_handle_t handle, cc_sdp_direction_t video_pref); michael@0: michael@0: /** michael@0: * complete transfer michael@0: * @param [in] handle - call handle michael@0: * @param [in] phandle - call handle of the other leg michael@0: * @param [in] video_pref - video direction desired on consult call michael@0: * @return SUCCESS or FAILURE michael@0: */ michael@0: cc_return_t CCAPI_Call_transferComplete(cc_call_handle_t handle, cc_call_handle_t phandle, michael@0: cc_sdp_direction_t video_pref); michael@0: michael@0: /** michael@0: * cancel conference or transfer michael@0: * @param [in] handle - call handle michael@0: * @return SUCCESS or FAILURE michael@0: */ michael@0: cc_return_t CCAPI_Call_cancelTransferOrConferenceFeature(cc_call_handle_t handle); michael@0: michael@0: /** michael@0: * direct Transfer michael@0: * @param [in] handle - call handle michael@0: * @param [in] target - call handle for transfer target call michael@0: * @return SUCCESS or FAILURE michael@0: */ michael@0: cc_return_t CCAPI_Call_directTransfer(cc_call_handle_t handle, cc_call_handle_t target); michael@0: michael@0: /** michael@0: * Join Across line michael@0: * @param [in] handle - call handle michael@0: * @param [in] target - join target michael@0: * @return SUCCESS or FAILURE michael@0: */ michael@0: cc_return_t CCAPI_Call_joinAcrossLine(cc_call_handle_t handle, cc_call_handle_t target); michael@0: michael@0: /** michael@0: * BLF Call Pickup michael@0: * @param [in] handle - call handle michael@0: * @param [in] video_pref - video direction preference michael@0: * @param [in] speed - speedDial Number michael@0: * @return SUCCESS or FAILURE michael@0: */ michael@0: cc_return_t CCAPI_Call_blfCallPickup(cc_call_handle_t handle, cc_sdp_direction_t video_pref, cc_string_t speed); michael@0: michael@0: /** michael@0: * Select a call michael@0: * @param [in] handle - call handle michael@0: * @return SUCCESS or FAILURE michael@0: */ michael@0: cc_return_t CCAPI_Call_select(cc_call_handle_t handle); michael@0: michael@0: /** michael@0: * Update Video Media Cap for the call michael@0: * @param [in] handle - call handle michael@0: * @param [in] video_pref - video direction desired on call michael@0: * @return SUCCESS or FAILURE michael@0: */ michael@0: cc_return_t CCAPI_Call_updateVideoMediaCap(cc_call_handle_t handle, cc_sdp_direction_t video_pref); michael@0: michael@0: /** michael@0: * send INFO method for the call michael@0: * @param [in] handle - call handle michael@0: * @param [in] infopackage - Info-Package header value michael@0: * @param [in] infotype - Content-Type header val michael@0: * @param [in] infobody - Body of the INFO message michael@0: * @return SUCCESS or FAILURE michael@0: */ michael@0: cc_return_t CCAPI_Call_sendInfo(cc_call_handle_t handle, cc_string_t infopackage, cc_string_t infotype, cc_string_t infobody); michael@0: michael@0: /** michael@0: * API to mute/unmute audio michael@0: * @param [in] val - TRUE=> mute FALSE => unmute michael@0: * @return SUCCESS or FAILURE michael@0: * NOTE: The mute state is persisted within the stack and shall be remembered across hold/resume. michael@0: * This API doesn't perform the mute operation but simply caches the mute state of the session. michael@0: */ michael@0: cc_return_t CCAPI_Call_setAudioMute(cc_call_handle_t handle, cc_boolean val); michael@0: michael@0: /** michael@0: * API to mute/unmute Video michael@0: * @param [in] val - TRUE=> mute FALSE => unmute michael@0: * @return SUCCESS or FAILURE michael@0: * NOTE: The mute state is persisted within the stack and shall be remembered across hold/resume michael@0: * This API doesn't perform the mute operation but simply caches the mute state of the session. michael@0: */ michael@0: cc_return_t CCAPI_Call_setVideoMute(cc_call_handle_t handle, cc_boolean val); michael@0: michael@0: michael@0: #endif // _CCAPI_CALL_H_