Class Call
This object represents a call issued or received by the Core.
You may have multiple calls at the same time, but only one will be in StreamsRunning at any time unless they are merged into a Conference, others will be paused. You can get the CallState of the call using State, it's current CallParams with CurrentParams and the latest statistics by calling AudioStats or VideoStats.
Inherited Members
Namespace: Linphone
Assembly: cs.temp.dll.dll
Syntax
public class Call : LinphoneObject
Properties
AudioStats
Returns a copy of the call statistics for the audio stream.
Declaration
public CallStats AudioStats { get; }
Property Value
Type | Description |
---|---|
CallStats | a CallStats object for the audio stream or null if it isn't available. |
AuthenticationToken
Returns the ZRTP authentication token to verify.
Declaration
public string AuthenticationToken { get; }
Property Value
Type | Description |
---|---|
System.String | the authentication token to verify or null if ZRTP isn't enabled. |
AuthenticationTokenVerified
Returns whether ZRTP authentication token is verified.
If not, it must be verified by users as described in ZRTP procedure. Once done, the application must inform of the results with AuthenticationTokenVerified.
Declaration
public bool AuthenticationTokenVerified { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if authentication token is verifed, false otherwise. |
AverageQuality
Returns call quality averaged over all the duration of the call.
See CurrentQuality for more details about quality measurement.
Declaration
public float AverageQuality { get; }
Property Value
Type | Description |
---|---|
System.Single | the call average quality since tbe beginning of the call. |
CallLog
Gets the call log associated to this call.
Declaration
public CallLog CallLog { get; }
Property Value
Type | Description |
---|---|
CallLog |
CameraEnabled
Returns if camera pictures are allowed to be sent to the remote party.
Declaration
public bool CameraEnabled { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if local video stream is being sent, false otherwise. |
ChatRoom
Create a new chat room for real time messaging from a call if not already existing, else return existing one.
No reference is given to the caller: the chat room will be deleted when the call is ended.
Declaration
public ChatRoom ChatRoom { get; }
Property Value
Type | Description |
---|---|
ChatRoom | ChatRoom where real time messaging can take place or null if chat room couldn't be created. |
Conference
Return the associated conference object.
Declaration
public Conference Conference { get; }
Property Value
Type | Description |
---|---|
Conference | A pointer on Conference or null if the call is not part of any conference. |
Core
Get the core that has created the specified call.
Declaration
public Core Core { get; }
Property Value
Type | Description |
---|---|
Core | The Core object that has created the specified call. |
CurrentCallbacks
Gets the current LinphoneCallCbs.
This is meant only to be called from a callback to be able to get the user_data associated with the LinphoneCallCbs that is calling the callback.
Declaration
public CallListener CurrentCallbacks { get; }
Property Value
Type | Description |
---|---|
CallListener | The LinphoneCallCbs that has called the last callback |
CurrentParams
Returns current parameters associated to the call.
Declaration
public CallParams CurrentParams { get; }
Property Value
Type | Description |
---|---|
CallParams | the current CallParams of this call. |
CurrentQuality
Obtain real-time quality rating of the call.
Based on local RTP statistics and RTCP feedback, a quality rating is computed and updated during all the duration of the call. This function returns its value at the time of the function call. It is expected that the rating is updated at least every 5 seconds or so. The rating is a floating point number comprised between 0 and 5. 4-5 = good quality 3-4 = average quality 2-3 = poor quality 1-2 = very poor quality 0-1 = can't be worse, mostly unusable
Declaration
public float CurrentQuality { get; }
Property Value
Type | Description |
---|---|
System.Single | The function returns -1 if no quality measurement is available, for example if no active audio stream exist. Otherwise it returns the quality rating. |
Dir
Returns direction of the call (incoming or outgoing).
Declaration
public CallDir Dir { get; }
Property Value
Type | Description |
---|---|
CallDir | the CallDir |
DiversionAddress
Returns the diversion address associated to this call.
Declaration
public Address DiversionAddress { get; }
Property Value
Type | Description |
---|---|
Address | the diversion address as Address or null. |
Duration
Returns call's duration in seconds.
Declaration
public int Duration { get; }
Property Value
Type | Description |
---|---|
System.Int32 | the call's duration in seconds. |
EchoCancellationEnabled
Returns if echo cancellation is enabled.
Declaration
public bool EchoCancellationEnabled { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if echo cancellation is enabled, false otherwise. |
EchoLimiterEnabled
Returns if echo limiter is enabled.
Declaration
public bool EchoLimiterEnabled { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if echo limiter is enabled, false otherwise. |
ErrorInfo
Returns full details about call errors or termination reasons.
Declaration
public ErrorInfo ErrorInfo { get; }
Property Value
Type | Description |
---|---|
ErrorInfo | ErrorInfo object holding the reason error. |
InputAudioDevice
Gets the current input device for this call.
Declaration
public AudioDevice InputAudioDevice { get; set; }
Property Value
Type | Description |
---|---|
AudioDevice | the AudioDevice used by this call as input or null if there is currently no soundcard configured (depending on the state of the call) |
IsRecording
Returns whether or not the call is currently being recorded.
Declaration
public bool IsRecording { get; }
Property Value
Type | Description |
---|---|
System.Boolean | true if recording is in progress, false otherwise |
Listener
Declaration
public CallListener Listener { get; }
Property Value
Type | Description |
---|---|
CallListener |
MicrophoneMuted
Get microphone muted state.
Declaration
public bool MicrophoneMuted { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The microphone muted state. |
MicrophoneVolumeGain
Get microphone volume gain.
If the sound backend supports it, the returned gain is equal to the gain set with the system mixer.
Declaration
public float MicrophoneVolumeGain { get; set; }
Property Value
Type | Description |
---|---|
System.Single | double Percentage of the max supported volume gain. Valid values are in [ 0.0 : 1.0 ]. In case of failure, a negative value is returned |
NativeVideoWindowId
Get the native window handle of the video window, casted as an unsigned long.
Declaration
public IntPtr NativeVideoWindowId { get; set; }
Property Value
Type | Description |
---|---|
System.IntPtr | the native video window id (type may vary depending on platform). |
NativeVideoWindowIdString
Declaration
public string NativeVideoWindowIdString { get; set; }
Property Value
Type | Description |
---|---|
System.String |
OutputAudioDevice
Gets the current output device for this call.
Declaration
public AudioDevice OutputAudioDevice { get; set; }
Property Value
Type | Description |
---|---|
AudioDevice | the AudioDevice used by this call as output or null if there is currently no soundcard configured (depending on the state of the call) |
Params
Returns local parameters associated with the call.
This is typically the parameters passed at call initiation to
Declaration
public CallParams Params { get; set; }
Property Value
Type | Description |
---|---|
CallParams | the call's local parameters. |
Player
Gets a player associated with the call to play a local file and stream it to the remote peer.
Declaration
public Player Player { get; }
Property Value
Type | Description |
---|---|
Player | A Player object |
PlayVolume
Get the mesured playback volume level (received from remote) in dbm0.
Declaration
public float PlayVolume { get; }
Property Value
Type | Description |
---|---|
System.Single | float Volume level in percentage. |
Reason
Returns the reason for a call termination (either error or normal termination)
Declaration
public Reason Reason { get; }
Property Value
Type | Description |
---|---|
Reason | the Reason of the call termination. |
RecordVolume
Get the mesured record volume level (sent to remote) in dbm0.
Declaration
public float RecordVolume { get; }
Property Value
Type | Description |
---|---|
System.Single | float Volume level in percentage. |
ReferTo
Gets the refer-to uri (if the call was transfered).
Declaration
public string ReferTo { get; }
Property Value
Type | Description |
---|---|
System.String | The refer-to uri of the call (if it was transfered). |
RemoteAddress
Returns the remote address associated to this call.
Declaration
public Address RemoteAddress { get; }
Property Value
Type | Description |
---|---|
Address | The Address of the remote end of the call. |
RemoteAddressAsString
Returns the remote address associated to this call as a string.
The result string must be freed by user using ms_free().
Declaration
public string RemoteAddressAsString { get; }
Property Value
Type | Description |
---|---|
System.String | the remote address as a string. |
RemoteContact
Returns the far end's sip contact as a string, if available.
Declaration
public string RemoteContact { get; }
Property Value
Type | Description |
---|---|
System.String | the remote contact or null. |
RemoteParams
Returns call parameters proposed by remote.
This is useful when receiving an incoming call, to know whether the remote party supports video, encryption or whatever.
Declaration
public CallParams RemoteParams { get; }
Property Value
Type | Description |
---|---|
CallParams | the CallParams suggested by the remote or null. |
RemoteUserAgent
Returns the far end's user agent description string, if available.
Declaration
public string RemoteUserAgent { get; }
Property Value
Type | Description |
---|---|
System.String | the remote user agent or null. |
ReplacedCall
Returns the call object this call is replacing, if any.
Call replacement can occur during call transfers. By default, the core automatically terminates the replaced call and accept the new one. This function allows the application to know whether a new incoming call is a one that replaces another one.
Declaration
public Call ReplacedCall { get; }
Property Value
Type | Description |
---|---|
Call | the Call object this call is replacing or null. |
SpeakerMuted
Get speaker muted state.
Declaration
public bool SpeakerMuted { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The speaker muted state. |
SpeakerVolumeGain
Get speaker volume gain.
If the sound backend supports it, the returned gain is equal to the gain set with the system mixer.
Declaration
public float SpeakerVolumeGain { get; set; }
Property Value
Type | Description |
---|---|
System.Single | Percentage of the max supported volume gain. Valid values are in [ 0.0 : 1.0 ]. In case of failure, a negative value is returned |
State
Retrieves the call's current state.
Declaration
public CallState State { get; }
Property Value
Type | Description |
---|---|
CallState | the current CallState of this call. |
StreamCount
Returns the number of stream for the given call.
Declaration
public int StreamCount { get; }
Property Value
Type | Description |
---|---|
System.Int32 | the amount of streams for this call. |
TextStats
Returns a copy of the call statistics for the text stream.
Declaration
public CallStats TextStats { get; }
Property Value
Type | Description |
---|---|
CallStats | a CallStats object for the text stream or null if it isn't available. |
ToAddress
Returns the to address with its headers associated to this call.
Declaration
public Address ToAddress { get; }
Property Value
Type | Description |
---|---|
Address | the #LinphoneAdress matching the TO of the call. |
TransfererCall
Gets the transferer if this call was started automatically as a result of an incoming transfer request.
The call in which the transfer request was received is returned in this case.
Declaration
public Call TransfererCall { get; }
Property Value
Type | Description |
---|---|
Call | The transferer Call if the specified call was started automatically as a result of an incoming transfer request, null otherwise. |
TransferState
Returns the current transfer state, if a transfer has been initiated from this call.
Declaration
public CallState TransferState { get; }
Property Value
Type | Description |
---|---|
CallState | the CallState. |
Remarks
See : linphone_core_transfer_call , linphone_core_transfer_call_to_another
TransferTargetCall
When this call has received a transfer request, returns the new call that was automatically created as a result of the transfer.
Declaration
public Call TransferTargetCall { get; }
Property Value
Type | Description |
---|---|
Call | the transfer Call created. |
VideoStats
Returns a copy of the call statistics for the video stream.
Declaration
public CallStats VideoStats { get; }
Property Value
Type | Description |
---|---|
CallStats | a CallStats object for the video stream or null if it isn't available. |
Methods
Accept()
Accept an incoming call.
Basically the application is notified of incoming calls within the call_state_changed callback of the LinphoneCoreVTable structure, where it will receive a Incoming event with the associated Call object. The application can later accept the call using this method.
Declaration
public void Accept()
AcceptEarlyMedia()
Accept an early media session for an incoming call.
This is identical as calling
Declaration
public void AcceptEarlyMedia()
Remarks
See :
AcceptEarlyMediaWithParams(CallParams)
When receiving an incoming, accept to start a media session as early-media.
This means the call is not accepted but audio & video streams can be
established if the remote party supports early media. However, unlike after
call acceptance, mic and camera input are not sent during early-media, though
received audio & video are played normally. The call can then later be
fully accepted using Accept() or
Declaration
public void AcceptEarlyMediaWithParams(CallParams parameters)
Parameters
Type | Name | Description |
---|---|---|
CallParams | parameters | The call parameters to use (can be null). |
AcceptUpdate(CallParams)
Accept call modifications initiated by other end.
This call may be performed in response to a #LinphoneCallUpdatedByRemote state
notification. When such notification arrives, the application can decide to
call DeferUpdate()
so that it can have the time to prompt the user. RemoteParams can be used to get information about the call
parameters requested by the other party, such as whether a video stream is
requested.
When the user accepts or refuse the change,
Declaration
public void AcceptUpdate(CallParams parameters)
Parameters
Type | Name | Description |
---|---|---|
CallParams | parameters | A CallParams object describing the call parameters to accept. |
AcceptWithParams(CallParams)
Accept an incoming call, with parameters.
Basically the application is notified of incoming calls within the call_state_changed callback of the LinphoneCoreVTable structure, where it will receive a Incoming event with the associated Call object. The application can later accept the call using this method.
Declaration
public void AcceptWithParams(CallParams parameters)
Parameters
Type | Name | Description |
---|---|---|
CallParams | parameters | The specific parameters for this call, for example whether video is accepted or not. Use null to use default parameters. |
AskedToAutoanswer()
Tell whether a call has been asked to autoanswer.
Declaration
public bool AskedToAutoanswer()
Returns
Type | Description |
---|---|
System.Boolean | A boolean value telling whether the call has been asked to autoanswer |
CancelDtmfs()
Stop current DTMF sequence sending.
Please note that some DTMF could be already sent, depending on when this
function call is delayed from
Declaration
public void CancelDtmfs()
Decline(Reason)
Decline a pending incoming call, with a reason.
Declaration
public void Decline(Reason reason)
Parameters
Type | Name | Description |
---|---|---|
Reason | reason |
DeclineWithErrorInfo(ErrorInfo)
Decline a pending incoming call, with a ErrorInfo object.
Declaration
public int DeclineWithErrorInfo(ErrorInfo ei)
Parameters
Type | Name | Description |
---|---|---|
ErrorInfo | ei | ErrorInfo containing more information on the call rejection. |
Returns
Type | Description |
---|---|
System.Int32 | 0 on success, -1 on failure |
DeferUpdate()
When receiving a #LinphoneCallUpdatedByRemote state notification, prevent Core from performing an automatic answer.
When receiving a #LinphoneCallUpdatedByRemote state notification (ie an
incoming reINVITE), the default behaviour of Core is defined by the "defer_update_default" option
of the "sip" section of the config. If this option is 0 (the default)
then the Core automatically answers
the reINIVTE with call parameters unchanged. However when for example when the
remote party updated the call to propose a video stream, it can be useful to
prompt the user before answering. This can be achieved by calling
linphone_core_defer_call_update during the call state notification, to
deactivate the automatic answer that would just confirm the audio but reject
the video. Then, when the user responds to dialog prompt, it becomes possible
to call
Declaration
public void DeferUpdate()
Finalize()
Declaration
protected void Finalize()
GetStats(StreamType)
Returns a copy of the call statistics for a particular stream type.
Declaration
public CallStats GetStats(StreamType type)
Parameters
Type | Name | Description |
---|---|---|
StreamType | type | the StreamType |
Returns
Type | Description |
---|---|
CallStats | a CallStats object for the given stream or null if stream isn't available. |
GetToHeader(String)
Returns the value of the header name.
Declaration
public string GetToHeader(string headerName)
Parameters
Type | Name | Description |
---|---|---|
System.String | headerName | the name of the header to check. |
Returns
Type | Description |
---|---|
System.String | the value of the header if exists. |
HasTransferPending()
Returns if this calls has received a transfer that has not been executed yet.
Pending transfers are executed when this call is being paused or closed, locally or by remote endpoint. If the call is already paused while receiving the transfer request, the transfer immediately occurs.
Declaration
public bool HasTransferPending()
Returns
Type | Description |
---|---|
System.Boolean | true if transfer is pending, false otherwise. |
MediaInProgress()
Indicates whether an operation is in progress at the media side.
It can be a bad idea to initiate signaling operations (adding video, pausing the call, removing video, changing video parameters) while the media is busy in establishing the connection (typically ICE connectivity checks). It can result in failures generating loss of time in future operations in the call. Applications are invited to check this function after each call state change to decide whether certain operations are permitted or not.
Declaration
public bool MediaInProgress()
Returns
Type | Description |
---|---|
System.Boolean | true if media is busy in establishing the connection, false otherwise. |
OglRender()
Calls generic OpenGL render for a given call.
Declaration
public void OglRender()
Pause()
Pauses the call.
If a music file has been setup using PlayFile, this file will be played to the remote user. The only way to resume a paused call is to call Resume().
Declaration
public void Pause()
Remarks
See : Resume()
Redirect(String)
Redirect the specified call to the given redirect URI.
Declaration
public void Redirect(string redirectUri)
Parameters
Type | Name | Description |
---|---|---|
System.String | redirectUri | The URI to redirect the call to |
RedirectTo(Address)
Redirect the specified call to the given redirect Address.
Declaration
public void RedirectTo(Address redirectAddress)
Parameters
Type | Name | Description |
---|---|---|
Address | redirectAddress | The Address to redirect the call to |
RequestNotifyNextVideoFrameDecoded()
Request the callback passed to linphone_call_cbs_set_next_video_frame_decoded to be called the next time the video decoder properly decodes a video frame.
Declaration
public void RequestNotifyNextVideoFrameDecoded()
Resume()
Resumes a call.
The call needs to have been paused previously with Pause().
Declaration
public void Resume()
Remarks
See : Pause()
SendDtmf(SByte)
Send the specified dtmf.
The dtmf is automatically played to the user.
Declaration
public void SendDtmf(sbyte dtmf)
Parameters
Type | Name | Description |
---|---|---|
System.SByte | dtmf | The dtmf name specified as a char, such as '0', '#' etc... |
SendDtmfs(String)
Send a list of dtmf.
The dtmfs are automatically sent to remote, separated by some needed customizable delay. Sending is canceled if the call state changes to something not LinphoneCallStreamsRunning.
Declaration
public void SendDtmfs(string dtmfs)
Parameters
Type | Name | Description |
---|---|---|
System.String | dtmfs | A dtmf sequence such as '123#123123' |
SendInfoMessage(InfoMessage)
Sends an info message through an established call.
Declaration
public void SendInfoMessage(InfoMessage info)
Parameters
Type | Name | Description |
---|---|---|
InfoMessage | info | the InfoMessage to send |
SendVfuRequest()
Request remote side to send us a Video Fast Update.
Declaration
public void SendVfuRequest()
StartRecording()
Starts call recording.
Video record is only available if this function is called in state StreamRunning. The output file where audio is recorded must be previously specified with RecordFile.
Declaration
public void StartRecording()
StopRecording()
Stops call recording.
Declaration
public void StopRecording()
TakePreviewSnapshot(String)
Take a photo of currently captured video and write it into a jpeg file.
Note that the snapshot is asynchronous, an application shall not assume that the file is created when the function returns.
Declaration
public void TakePreviewSnapshot(string filePath)
Parameters
Type | Name | Description |
---|---|---|
System.String | filePath | a path where to write the jpeg content. |
TakeVideoSnapshot(String)
Take a photo of currently received video and write it into a jpeg file.
Note that the snapshot is asynchronous, an application shall not assume that the file is created when the function returns.
Declaration
public void TakeVideoSnapshot(string filePath)
Parameters
Type | Name | Description |
---|---|---|
System.String | filePath | a path where to write the jpeg content. |
Terminate()
Terminates a call.
Declaration
public void Terminate()
TerminateWithErrorInfo(ErrorInfo)
Terminates a call.
Declaration
public void TerminateWithErrorInfo(ErrorInfo ei)
Parameters
Type | Name | Description |
---|---|---|
ErrorInfo | ei |
Transfer(String)
Performs a simple call transfer to the specified destination.
The remote endpoint is expected to issue a new call to the specified destination. The current call remains active and thus can be later paused or terminated. It is possible to follow the progress of the transfer provided that transferee sends notification about it. In this case, the transfer_state_changed callback of the LinphoneCoreVTable is invoked to notify of the state of the new call at the other party. The notified states are #LinphoneCallOutgoingInit , #LinphoneCallOutgoingProgress, #LinphoneCallOutgoingRinging and #LinphoneCallConnected.
Declaration
public void Transfer(string referTo)
Parameters
Type | Name | Description |
---|---|---|
System.String | referTo | The destination the call is to be refered to. |
TransferTo(Address)
Performs a simple call transfer to the specified destination.
The remote endpoint is expected to issue a new call to the specified destination. The current call remains active and thus can be later paused or terminated. It is possible to follow the progress of the transfer provided that transferee sends notification about it. In this case, the transfer_state_changed callback of the LinphoneCoreVTable is invoked to notify of the state of the new call at the other party. The notified states are #LinphoneCallOutgoingInit , #LinphoneCallOutgoingProgress, #LinphoneCallOutgoingRinging and #LinphoneCallConnected.
Declaration
public void TransferTo(Address referTo)
Parameters
Type | Name | Description |
---|---|---|
Address | referTo | The Address the call is to be refered to. |
TransferToAnother(Call)
Transfers a call to destination of another running call.
This is used for "attended transfer" scenarios. The transfered call is supposed to be in paused state, so that it is able to accept the transfer immediately. The destination call is a call previously established to introduce the transfered person. This method will send a transfer request to the transfered person. The phone of the transfered is then expected to automatically call to the destination of the transfer. The receiver of the transfer will then automatically close the call with us (the 'dest' call). It is possible to follow the progress of the transfer provided that transferee sends notification about it. In this case, the transfer_state_changed callback of the LinphoneCoreVTable is invoked to notify of the state of the new call at the other party. The notified states are #LinphoneCallOutgoingInit , #LinphoneCallOutgoingProgress, #LinphoneCallOutgoingRinging and #LinphoneCallConnected.
Declaration
public void TransferToAnother(Call dest)
Parameters
Type | Name | Description |
---|---|---|
Call | dest | A running call whose remote person will receive the transfer |
Update(CallParams)
Updates a running call according to supplied call parameters or parameters changed in the LinphoneCore.
It triggers a SIP reINVITE in order to perform a new offer/answer of media capabilities. Changing the size of the transmitted video after calling linphone_core_set_preferred_video_size can be used by passing null as params argument. In case no changes are requested through the CallParams argument, then this argument can be omitted and set to null. WARNING: Updating a call in the #LinphoneCallPaused state will still result in a paused call even if the media directions set in the params are sendrecv. To resume a paused call, you need to call Resume().
Declaration
public void Update(CallParams parameters)
Parameters
Type | Name | Description |
---|---|---|
CallParams | parameters | The new call parameters to use (may be null). |
Zoom(Single, Single, Single)
Perform a zoom of the video displayed during a call.
The zoom ensures that all the screen is fullfilled with the video.
Declaration
public void Zoom(float zoomFactor, float cx, float cy)
Parameters
Type | Name | Description |
---|---|---|
System.Single | zoomFactor | a floating point number describing the zoom factor. A value 1.0 corresponds to no zoom applied. |
System.Single | cx | a floating point number pointing the horizontal center of the zoom to be applied. This value should be between 0.0 and 1.0. |
System.Single | cy | a floating point number pointing the vertical center of the zoom to be applied. This value should be between 0.0 and 1.0. |