Ring Daemon 16.0.0
Loading...
Searching...
No Matches
jami::Call Class Referenceabstract

#include <call.h>

Inheritance diagram for jami::Call:
Inheritance graph
Collaboration diagram for jami::Call:
Collaboration graph

Public Types

enum class  CallState : unsigned {
  INACTIVE , ACTIVE , HOLD , BUSY ,
  PEER_BUSY , MERROR , OVER , COUNT__
}
 The Call State. More...
 
enum class  CallType : unsigned { INCOMING , OUTGOING , MISSED }
 This determines if the call originated from the local user (OUTGOING) or from some remote peer (INCOMING, MISSED). More...
 
enum class  ConnectionState : unsigned {
  DISCONNECTED , TRYING , PROGRESSING , RINGING ,
  CONNECTED , COUNT__
}
 Tell where we're at with the call. More...
 
enum class  LinkType { GENERIC , SIP }
 
using OnReadyCb = std::function< void(bool)>
 
using StateListenerCb = std::function< bool(CallState, ConnectionState, int)>
 
using SubcallSet = std::set< std::shared_ptr< Call >, std::owner_less< std::shared_ptr< Call > > >
 

Public Member Functions

void addStateListener (StateListenerCb &&listener)
 
void addSubCall (Call &call)
 Attach subcall to this instance.
 
virtual void answer ()=0
 Answer the call.
 
virtual void answer (const std::vector< libjami::MediaMap > &mediaList)=0
 Answer a call with a list of media attributes.
 
virtual void answerMediaChangeRequest (const std::vector< libjami::MediaMap > &mediaList, bool isRemote=false)=0
 Answer to a media update request.
 
virtual bool attendedTransfer (const std::string &to)=0
 Attended transfer.
 
virtual void carryingDTMFdigits (char code)=0
 Send DTMF.
 
virtual bool checkMediaChangeRequest (const std::vector< libjami::MediaMap > &remoteMediaList)=0
 Check the media of an incoming media change request.
 
int conferenceProtocolVersion () const
 
virtual std::vector< libjami::MediaMapcurrentMediaList () const =0
 Retrieve current medias list.
 
virtual void enterConference (std::shared_ptr< Conference > conference)=0
 
virtual void exitConference ()=0
 
std::weak_ptr< AccountgetAccount () const
 
std::string getAccountId () const
 
virtual std::shared_ptr< SystemCodecInfogetAudioCodec () const
 
virtual std::map< std::string, boolgetAudioStreams () const =0
 
std::chrono::milliseconds getCallDuration () const
 
const std::string & getCallId () const
 Return a reference on the call id.
 
CallType getCallType () const
 
std::shared_ptr< ConferencegetConference () const
 Return a reference on the conference id.
 
std::vector< std::map< std::string, std::string > > getConferenceInfos () const
 
ConnectionState getConnectionState () const
 Get the connection state of the call (protected by mutex)
 
virtual std::map< std::string, std::string > getDetails () const
 
virtual LinkType getLinkType () const
 
virtual std::vector< MediaAttributegetMediaAttributeList () const =0
 
const std::string & getPeerDisplayName () const
 Get the peer display name (caller in ingoing) not protected by mutex (when created)
 
const std::string & getPeerNumber () const
 Get the peer number (destination on outgoing) not protected by mutex (when created)
 
CallState getState () const
 Get the call state of the call (protected by mutex)
 
std::string getStateStr () const
 
virtual std::shared_ptr< SystemCodecInfogetVideoCodec () const
 
virtual void handleMediaChangeRequest (const std::vector< libjami::MediaMap > &remoteMediaList)=0
 Process incoming media change request.
 
virtual void hangup (int reason)=0
 Hang up the call.
 
virtual bool hasVideo () const =0
 
virtual bool isCaptureDeviceMuted (const MediaType &mediaType) const =0
 
bool isConferenceParticipant () const
 
virtual bool isIceEnabled () const =0
 Check wether ICE is enabled for media.
 
bool isIncoming () const
 Tell if the call is incoming.
 
bool isSubcall () const
 Return true if this call instance is a subcall (internal call for multi-device handling)
 
virtual void monitor () const =0
 
virtual void muteMedia (const std::string &mediaType, bool isMuted)=0
 mute/unmute a media of a call
 
virtual bool offhold (OnReadyCb &&cb)=0
 Resume a call from hold state.
 
virtual bool onhold (OnReadyCb &&cb)=0
 Put a call on hold.
 
void onTextMessage (std::map< std::string, std::string > &&messages)
 
virtual void peerHungup ()
 Peer has hung up a call.
 
virtual void refuse ()=0
 Refuse incoming call.
 
virtual void removeCall ()
 
virtual bool requestMediaChange (const std::vector< libjami::MediaMap > &mediaList)=0
 Make a change request of the current media with the provided media.
 
void resetConfInfo ()
 
virtual void restartMediaSender ()=0
 
void sendConfInfo (const std::string &json)
 
void sendConfOrder (const Json::Value &root)
 
virtual void sendKeyframe (int streamIdx=-1)=0
 
virtual void sendTextMessage (const std::map< std::string, std::string > &messages, const std::string &from)=0
 Send a message to a call identified by its callid.
 
void setConferenceInfo (const std::string &msg)
 A Call can be in a conference.
 
void setIPToIP (bool IPToIP)
 
void setPeerDisplayName (const std::string &name)
 Set the display name (caller in ingoing) not protected by mutex (when created)
 
void setPeerNumber (const std::string &number)
 Set the peer number (destination on outgoing) not protected by mutex (when created)
 
bool setState (CallState call_state, ConnectionState cnx_state, signed code=0)
 
bool setState (CallState call_state, signed code=0)
 Set the state of the call (protected by mutex)
 
bool setState (ConnectionState cnx_state, signed code=0)
 
virtual void switchInput (const std::string &={})
 
virtual bool toggleRecording ()
 This method must be implemented for this interface as calls and conferences have different behavior.
 
const std::string & toUsername () const
 Get "To" from the invite.
 
void toUsername (const std::string &username)
 Updated by sipvoiplink, corresponds to the "To" in the invite.
 
virtual void transfer (const std::string &to)=0
 Transfer a call to specified URI.
 
virtual void updateRecState (bool state)=0
 Update recording state.
 
std::weak_ptr< Callweak ()
 
virtual ~Call ()
 
- Public Member Functions inherited from jami::Recordable
virtual std::string getPath () const
 Return the file path for this recording.
 
bool isAudioOnly () const
 
bool isRecording () const
 Return recording state (true/false)
 
 Recordable ()
 
virtual bool startRecording (const std::string &path)
 Start recording.
 
virtual void stopRecording ()
 Stop recording.
 
virtual ~Recordable ()
 
- Public Member Functions inherited from jami::PeerRecorder
virtual bool hasPeerVoice () const
 
virtual bool isPeerMuted () const
 
virtual bool isPeerRecording () const
 
virtual void peerMuted (bool muted, int streamIdx)=0
 
 PeerRecorder ()
 
virtual void peerRecording (bool state)=0
 
virtual void peerVoice (bool voice)=0
 
virtual ~PeerRecorder ()
 

Public Attributes

std::unique_ptr< AudioDeviceGuardaudioGuard
 

Protected Types

using clock = std::chrono::steady_clock
 
using MsgList = std::list< std::pair< std::map< std::string, std::string >, std::string > >
 MultiDevice: message waiting to be sent (need a valid subcall)
 
using time_point = clock::time_point
 

Protected Member Functions

 Call (const std::shared_ptr< Account > &account, const std::string &id, Call::CallType type, const std::map< std::string, std::string > &details={})
 Constructor of a call.
 
virtual void merge (Call &scall)
 Replace current call data with ones from the given subcall.
 

Protected Attributes

std::weak_ptr< Accountaccount_
 Associate account ID.
 
std::recursive_mutex callMutex_ {}
 Protect every attribute that can be changed by two threads.
 
CallState callState_ {CallState::INACTIVE}
 Inactive/Active/Hold/Busy/Error.
 
std::weak_ptr< Conferenceconf_ {}
 Unique conference ID, used exclusively in case of a conference.
 
ConfInfo confInfo_ {}
 
std::mutex confInfoMutex_ {}
 
ConnectionState connectionState_ {ConnectionState::DISCONNECTED}
 Disconnected/Progressing/Trying/Ringing/Connected.
 
time_point duration_start_ {time_point::min()}
 
const std::string id_ {}
 MultiDevice: parent call, nullptr otherwise. Access protected by callMutex_.
 
bool isIPToIP_ {false}
 Direct IP-to-IP or classic call.
 
std::shared_ptr< Callparent_
 MultiDevice: list of attached subcall.
 
int peerConfProtocol_ {0}
 Supported conference protocol version.
 
std::string peerDisplayName_ {}
 Peer Display Name.
 
std::string peerNumber_ {}
 Number of the peer.
 
MsgList pendingInMessages_
 
MsgList pendingOutMessages_
 
std::string reason_ {}
 
SubcallSet subcalls_
 
time_t timestamp_start_ {0}
 MultiDevice: message received by subcall to merged yet.
 
std::string toUsername_ {}
 
CallType type_
 Type of the call.
 
- Protected Attributes inherited from jami::Recordable
std::mutex apiMutex_
 
bool isAudioOnly_ {false}
 
std::shared_ptr< MediaRecorderrecorder_
 
bool recording_ {false}
 
- Protected Attributes inherited from jami::PeerRecorder
bool peerMuted_ {false}
 
bool peerRecording_ {false}
 
bool peerVoice_ {false}
 

Detailed Description

Definition at line 72 of file call.h.

Member Typedef Documentation

◆ clock

using jami::Call::clock = std::chrono::steady_clock
protected

Definition at line 456 of file call.h.

◆ MsgList

using jami::Call::MsgList = std::list<std::pair<std::map<std::string, std::string>, std::string> >
protected

MultiDevice: message waiting to be sent (need a valid subcall)

Definition at line 481 of file call.h.

◆ OnReadyCb

using jami::Call::OnReadyCb = std::function<void(bool)>

Definition at line 113 of file call.h.

◆ StateListenerCb

Definition at line 114 of file call.h.

◆ SubcallSet

using jami::Call::SubcallSet = std::set<std::shared_ptr<Call>, std::owner_less<std::shared_ptr<Call> >>

Definition at line 112 of file call.h.

◆ time_point

using jami::Call::time_point = clock::time_point
protected

Definition at line 457 of file call.h.

Member Enumeration Documentation

◆ CallState

The Call State.

Note
modify validStateTransition/getStateStr if this enum changes
Enumerator
INACTIVE 
ACTIVE 
HOLD 
BUSY 
PEER_BUSY 
MERROR 
OVER 
COUNT__ 

Definition at line 99 of file call.h.

◆ CallType

This determines if the call originated from the local user (OUTGOING) or from some remote peer (INCOMING, MISSED).

Enumerator
INCOMING 
OUTGOING 
MISSED 

Definition at line 120 of file call.h.

◆ ConnectionState

Tell where we're at with the call.

The call gets Connected when we know from the other end what happened with out call. A call can be 'Connected' even if the call state is Busy, or Error.

Audio should be transmitted when ConnectionState = Connected AND CallState = Active.

Note
modify validStateTransition/getStateStr if this enum changes
Enumerator
DISCONNECTED 
TRYING 
PROGRESSING 
RINGING 
CONNECTED 
COUNT__ 

Definition at line 85 of file call.h.

◆ LinkType

Enumerator
GENERIC 
SIP 

Definition at line 110 of file call.h.

Constructor & Destructor Documentation

◆ ~Call()

jami::Call::~Call ( )
virtual

Definition at line 141 of file call.cpp.

◆ Call()

jami::Call::Call ( const std::shared_ptr< Account > &  account,
const std::string &  id,
Call::CallType  type,
const std::map< std::string, std::string > &  details = {} 
)
protected

Constructor of a call.

Parameters
idUnique identifier of the call
typeset definitely this call as incoming/outgoing
detailsvolatile details to customize the call creation

Definition at line 77 of file call.cpp.

References addStateListener(), CONNECTED, DISCONNECTED, duration_start_, jami::emitSignal(), getAccount(), getCallDuration(), getCallType(), getPeerNumber(), jami::Manager::getRingingTimeout(), jami::hangupCalls(), INCOMING, jami::Manager::instance(), isSubcall(), JAMI_DBG, monitor(), OUTGOING, OVER, reason_, RINGING, jami::runOnMainThread(), jami::ScheduledExecutor::scheduleIn(), jami::Manager::scheduler(), toUsername(), type_, and weak().

Here is the call graph for this function:

Member Function Documentation

◆ addStateListener()

void jami::Call::addStateListener ( StateListenerCb &&  listener)
inline

Definition at line 330 of file call.h.

References callMutex_, and jami::emitSignal().

Referenced by addSubCall(), and Call().

Here is the call graph for this function:

◆ addSubCall()

void jami::Call::addSubCall ( Call call)

Attach subcall to this instance.

If this subcall is answered, this subcall and this instance will be merged using merge().

Definition at line 430 of file call.cpp.

References addStateListener(), getCallId(), jami::getPtr(), JAMI_DBG, JAMI_ERR, parent_, removeCall(), sendTextMessage(), and weak().

Here is the call graph for this function:

◆ answer() [1/2]

virtual void jami::Call::answer ( )
pure virtual

Answer the call.

Implemented in jami::SIPCall.

Referenced by jami::Manager::answerCall().

◆ answer() [2/2]

virtual void jami::Call::answer ( const std::vector< libjami::MediaMap > &  mediaList)
pure virtual

Answer a call with a list of media attributes.

Parameters
mediaListThe list of the media attributes. The media attributes set by the caller of this method will determine the response sent to the peer and the configuration of the local media. If the media list is empty, the current media set when the call was created will be used.

Implemented in jami::SIPCall.

◆ answerMediaChangeRequest()

virtual void jami::Call::answerMediaChangeRequest ( const std::vector< libjami::MediaMap > &  mediaList,
bool  isRemote = false 
)
pure virtual

Answer to a media update request.

The media attributes set by the caller of this method will determine the response to send to the peer and the configuration of the local media.

Parameters
mediaListThe list of media attributes. An empty media list means the media update request was not accepted, meaning the call continue with the current media. It's up to the implementation to determine wether an answer will be sent to the peer.
isRemoteTrue if the media list is from the remote peer

Implemented in jami::SIPCall.

◆ attendedTransfer()

virtual bool jami::Call::attendedTransfer ( const std::string &  to)
pure virtual

Attended transfer.

Parameters
Thetarget call id
Returns
True on success

Implemented in jami::SIPCall.

◆ carryingDTMFdigits()

virtual void jami::Call::carryingDTMFdigits ( char  code)
pure virtual

Send DTMF.

Parameters
codeThe char code

Implemented in jami::SIPCall.

◆ checkMediaChangeRequest()

virtual bool jami::Call::checkMediaChangeRequest ( const std::vector< libjami::MediaMap > &  remoteMediaList)
pure virtual

Check the media of an incoming media change request.

This method checks the new media against the current media. It determines if the differences are significant enough to require more processing. For instance, this can be used to check if the a change request must be reported to the client for confirmation or can be handled by the daemon. The conditions that cause this method to return true are implementation specific.

Parameters
thenew media list from the remote
Returns
true if the new media differs from the current media

Implemented in jami::SIPCall.

◆ conferenceProtocolVersion()

int jami::Call::conferenceProtocolVersion ( ) const
inline

Definition at line 450 of file call.h.

References peerConfProtocol_.

◆ currentMediaList()

virtual std::vector< libjami::MediaMap > jami::Call::currentMediaList ( ) const
pure virtual

Retrieve current medias list.

Returns
current medias

Implemented in jami::SIPCall.

◆ enterConference()

virtual void jami::Call::enterConference ( std::shared_ptr< Conference conference)
pure virtual

Implemented in jami::SIPCall.

◆ exitConference()

virtual void jami::Call::exitConference ( )
pure virtual

Implemented in jami::SIPCall.

◆ getAccount()

std::weak_ptr< Account > jami::Call::getAccount ( ) const
inline

Definition at line 141 of file call.h.

References account_.

Referenced by Call(), and jami::Manager::ManagerPimpl::processRemainingParticipants().

◆ getAccountId()

◆ getAudioCodec()

virtual std::shared_ptr< SystemCodecInfo > jami::Call::getAudioCodec ( ) const
inlinevirtual

Reimplemented in jami::SIPCall.

Definition at line 413 of file call.h.

◆ getAudioStreams()

◆ getCallDuration()

std::chrono::milliseconds jami::Call::getCallDuration ( ) const
inline
Returns
Call duration in milliseconds

Definition at line 354 of file call.h.

References duration_start_.

Referenced by Call().

◆ getCallId()

◆ getCallType()

CallType jami::Call::getCallType ( ) const
inline

Definition at line 144 of file call.h.

References type_.

Referenced by Call().

◆ getConference()

std::shared_ptr< Conference > jami::Call::getConference ( ) const
inline

Return a reference on the conference id.

Returns
call id

Definition at line 138 of file call.h.

References conf_.

Referenced by jami::Manager::addSubCall(), jami::Manager::answerCall(), jami::Manager::incomingMessage(), jami::Manager::removeParticipant(), and jami::Manager::sendCallTextMessage().

◆ getConferenceInfos()

std::vector< std::map< std::string, std::string > > jami::Call::getConferenceInfos ( ) const
inline

Definition at line 438 of file call.h.

References confInfo_, and jami::ConfInfo::toVectorMapStringString().

Here is the call graph for this function:

◆ getConnectionState()

Call::ConnectionState jami::Call::getConnectionState ( ) const

Get the connection state of the call (protected by mutex)

Returns
ConnectionState The connection state

Definition at line 167 of file call.cpp.

Referenced by jami::Manager::answerCall(), and merge().

◆ getDetails()

◆ getLinkType()

virtual LinkType jami::Call::getLinkType ( ) const
inlinevirtual

Reimplemented in jami::SIPCall.

Definition at line 126 of file call.h.

References GENERIC.

Referenced by jami::CallFactory::removeCall().

◆ getMediaAttributeList()

virtual std::vector< MediaAttribute > jami::Call::getMediaAttributeList ( ) const
pure virtual

Implemented in jami::SIPCall.

◆ getPeerDisplayName()

const std::string & jami::Call::getPeerDisplayName ( ) const
inline

Get the peer display name (caller in ingoing) not protected by mutex (when created)

Returns
std::string The peer name

Definition at line 183 of file call.h.

References peerDisplayName_.

◆ getPeerNumber()

const std::string & jami::Call::getPeerNumber ( ) const
inline

Get the peer number (destination on outgoing) not protected by mutex (when created)

Returns
std::string The peer number

Definition at line 158 of file call.h.

References peerNumber_.

Referenced by Call().

◆ getState()

Call::CallState jami::Call::getState ( ) const

Get the call state of the call (protected by mutex)

Returns
CallState The call state

Definition at line 174 of file call.cpp.

Referenced by merge(), and jami::SIPCall::SIPCall().

◆ getStateStr()

std::string jami::Call::getStateStr ( ) const

◆ getVideoCodec()

virtual std::shared_ptr< SystemCodecInfo > jami::Call::getVideoCodec ( ) const
inlinevirtual

Reimplemented in jami::SIPCall.

Definition at line 417 of file call.h.

◆ handleMediaChangeRequest()

virtual void jami::Call::handleMediaChangeRequest ( const std::vector< libjami::MediaMap > &  remoteMediaList)
pure virtual

Process incoming media change request.

Parameters
thenew media list from the remote

Implemented in jami::SIPCall.

◆ hangup()

virtual void jami::Call::hangup ( int  reason)
pure virtual

Hang up the call.

Parameters
reason

Implemented in jami::SIPCall.

◆ hasVideo()

virtual bool jami::Call::hasVideo ( ) const
pure virtual

Implemented in jami::SIPCall.

◆ isCaptureDeviceMuted()

virtual bool jami::Call::isCaptureDeviceMuted ( const MediaType mediaType) const
pure virtual

Implemented in jami::SIPCall.

◆ isConferenceParticipant()

◆ isIceEnabled()

virtual bool jami::Call::isIceEnabled ( ) const
pure virtual

Check wether ICE is enabled for media.

Implemented in jami::SIPCall.

◆ isIncoming()

bool jami::Call::isIncoming ( ) const
inline

Tell if the call is incoming.

Returns
true if yes false otherwise

Definition at line 188 of file call.h.

References INCOMING, and type_.

◆ isSubcall()

bool jami::Call::isSubcall ( ) const
inline

Return true if this call instance is a subcall (internal call for multi-device handling)

Definition at line 345 of file call.h.

References callMutex_, jami::emitSignal(), and parent_.

Referenced by Call(), jami::Manager::callFailure(), jami::Manager::getCallList(), and jami::Manager::hasCurrentCall().

Here is the call graph for this function:

◆ merge()

void jami::Call::merge ( Call subcall)
protectedvirtual

Replace current call data with ones from the given subcall.

Must be called while locked by subclass

Definition at line 562 of file call.cpp.

References getCallId(), getConnectionState(), getState(), JAMI_DBG, peerDisplayName_, peerNumber_, pendingInMessages_, and removeCall().

Here is the call graph for this function:

◆ monitor()

virtual void jami::Call::monitor ( ) const
pure virtual

Implemented in jami::SIPCall.

Referenced by Call(), and jami::Manager::monitor().

◆ muteMedia()

virtual void jami::Call::muteMedia ( const std::string &  mediaType,
bool  isMuted 
)
pure virtual

mute/unmute a media of a call

Parameters
mediaTypetype of media
isMutedtrue for muting, false for unmuting

Implemented in jami::SIPCall.

◆ offhold()

virtual bool jami::Call::offhold ( OnReadyCb &&  cb)
pure virtual

Resume a call from hold state.

Parameters
cbOn hold can be queued if waiting for ICE. This callback will be called when ready
Returns
bool True on success, False if failed or pending

Implemented in jami::SIPCall.

◆ onhold()

virtual bool jami::Call::onhold ( OnReadyCb &&  cb)
pure virtual

Put a call on hold.

Parameters
cbOn hold can be queued if waiting for ICE. This callback will be called when ready
Returns
bool True on success, False if failed or pending

Implemented in jami::SIPCall.

Referenced by jami::Manager::onHoldCall().

◆ onTextMessage()

void jami::Call::onTextMessage ( std::map< std::string, std::string > &&  messages)

Definition at line 389 of file call.cpp.

◆ peerHungup()

void jami::Call::peerHungup ( )
virtual

Peer has hung up a call.

Reimplemented in jami::SIPCall.

Definition at line 422 of file call.cpp.

Referenced by jami::Manager::peerHungupCall().

◆ refuse()

virtual void jami::Call::refuse ( )
pure virtual

Refuse incoming call.

Implemented in jami::SIPCall.

Referenced by jami::Manager::refuseCall().

◆ removeCall()

void jami::Call::removeCall ( )
virtual

Reimplemented in jami::SIPCall.

Definition at line 144 of file call.cpp.

Referenced by addSubCall(), and merge().

◆ requestMediaChange()

virtual bool jami::Call::requestMediaChange ( const std::vector< libjami::MediaMap > &  mediaList)
pure virtual

Make a change request of the current media with the provided media.

Parameters
mediaListthe new media list
Returns
true on success

Implemented in jami::SIPCall.

◆ resetConfInfo()

void jami::Call::resetConfInfo ( )

Definition at line 716 of file call.cpp.

◆ restartMediaSender()

virtual void jami::Call::restartMediaSender ( )
pure virtual

Implemented in jami::SIPCall.

◆ sendConfInfo()

void jami::Call::sendConfInfo ( const std::string &  json)

Definition at line 704 of file call.cpp.

◆ sendConfOrder()

void jami::Call::sendConfOrder ( const Json::Value &  root)

Definition at line 692 of file call.cpp.

◆ sendKeyframe()

virtual void jami::Call::sendKeyframe ( int  streamIdx = -1)
pure virtual

Implemented in jami::SIPCall.

◆ sendTextMessage()

virtual void jami::Call::sendTextMessage ( const std::map< std::string, std::string > &  messages,
const std::string &  from 
)
pure virtual

Send a message to a call identified by its callid.

Parameters
Alist of mimetype/payload pairs
Thesender of this message (could be another participant of a conference)

Implemented in jami::SIPCall.

Referenced by addSubCall(), and jami::Manager::sendCallTextMessage().

◆ setConferenceInfo()

void jami::Call::setConferenceInfo ( const std::string &  msg)

A Call can be in a conference.

If this is the case, the other side will send conference information describing the rendered image @msg A JSON object describing the conference

Definition at line 636 of file call.cpp.

References jami::emitSignal(), jami::ParticipantInfo::fromJson(), jami::ConfInfo::h, jami::ConfInfo::v, and jami::ConfInfo::w.

Here is the call graph for this function:

◆ setIPToIP()

void jami::Call::setIPToIP ( bool  IPToIP)
inline

Definition at line 215 of file call.h.

References jami::emitSignal(), and isIPToIP_.

Here is the call graph for this function:

◆ setPeerDisplayName()

void jami::Call::setPeerDisplayName ( const std::string &  name)
inline

Set the display name (caller in ingoing) not protected by mutex (when created)

Returns
std::string The peer display name

Definition at line 164 of file call.h.

References peerDisplayName_.

◆ setPeerNumber()

void jami::Call::setPeerNumber ( const std::string &  number)
inline

Set the peer number (destination on outgoing) not protected by mutex (when created)

Parameters
numberpeer number

Definition at line 151 of file call.h.

References jami::emitSignal(), and peerNumber_.

Here is the call graph for this function:

◆ setState() [1/3]

bool jami::Call::setState ( CallState  call_state,
ConnectionState  cnx_state,
signed  code = 0 
)

Definition at line 237 of file call.cpp.

References JAMI_DBG, and JAMI_ERR.

◆ setState() [2/3]

bool jami::Call::setState ( CallState  call_state,
signed  code = 0 
)

Set the state of the call (protected by mutex)

Parameters
call_stateThe call state
cnx_stateThe call connection state
codeOptional error-dependent code (used to report more information)
Returns
true if the requested state change was valid, false otherwise

Definition at line 290 of file call.cpp.

◆ setState() [3/3]

bool jami::Call::setState ( ConnectionState  cnx_state,
signed  code = 0 
)

Definition at line 297 of file call.cpp.

◆ switchInput()

virtual void jami::Call::switchInput ( const std::string &  = {})
inlinevirtual

Reimplemented in jami::SIPCall.

Definition at line 373 of file call.h.

◆ toggleRecording()

bool jami::Call::toggleRecording ( )
virtual

This method must be implemented for this interface as calls and conferences have different behavior.

Implementations must call the super method.

Reimplemented from jami::Recordable.

Reimplemented in jami::SIPCall.

Definition at line 361 of file call.cpp.

Referenced by jami::Manager::answerCall(), and jami::Manager::peerAnsweredCall().

◆ toUsername() [1/2]

const std::string & jami::Call::toUsername ( ) const
inline

Get "To" from the invite.

Note
Used to make the difference between incoming calls for accounts and for conversations
Returns
the "To" that was present in the invite

Definition at line 171 of file call.h.

References toUsername_.

Referenced by Call().

◆ toUsername() [2/2]

void jami::Call::toUsername ( const std::string &  username)
inline

Updated by sipvoiplink, corresponds to the "To" in the invite.

Parameters
username"To"

Definition at line 176 of file call.h.

References toUsername_.

◆ transfer()

virtual void jami::Call::transfer ( const std::string &  to)
pure virtual

Transfer a call to specified URI.

Parameters
toThe recipient of the call

Implemented in jami::SIPCall.

Referenced by jami::Manager::transferCall().

◆ updateRecState()

virtual void jami::Call::updateRecState ( bool  state)
pure virtual

Update recording state.

Typically used to send notifications to peers about the local recording session state

Implemented in jami::SIPCall.

◆ weak()

std::weak_ptr< Call > jami::Call::weak ( )
inline

Definition at line 124 of file call.h.

References jami::emitSignal().

Referenced by addSubCall(), and Call().

Here is the call graph for this function:

Member Data Documentation

◆ account_

std::weak_ptr<Account> jami::Call::account_
protected

Associate account ID.

Definition at line 514 of file call.h.

Referenced by getAccount().

◆ audioGuard

std::unique_ptr<AudioDeviceGuard> jami::Call::audioGuard

Definition at line 443 of file call.h.

Referenced by jami::Manager::addAudio().

◆ callMutex_

std::recursive_mutex jami::Call::callMutex_ {}
mutableprotected

Protect every attribute that can be changed by two threads.

Definition at line 487 of file call.h.

Referenced by addStateListener(), isSubcall(), and jami::SIPCall::~SIPCall().

◆ callState_

CallState jami::Call::callState_ {CallState::INACTIVE}
protected

Inactive/Active/Hold/Busy/Error.

Definition at line 520 of file call.h.

◆ conf_

std::weak_ptr<Conference> jami::Call::conf_ {}
protected

Unique conference ID, used exclusively in case of a conference.

Definition at line 508 of file call.h.

Referenced by getConference(), and isConferenceParticipant().

◆ confInfo_

ConfInfo jami::Call::confInfo_ {}
mutableprotected

Definition at line 490 of file call.h.

Referenced by getConferenceInfos().

◆ confInfoMutex_

std::mutex jami::Call::confInfoMutex_ {}
mutableprotected

Definition at line 489 of file call.h.

◆ connectionState_

ConnectionState jami::Call::connectionState_ {ConnectionState::DISCONNECTED}
protected

Disconnected/Progressing/Trying/Ringing/Connected.

Definition at line 517 of file call.h.

◆ duration_start_

time_point jami::Call::duration_start_ {time_point::min()}
protected

Definition at line 491 of file call.h.

Referenced by Call(), and getCallDuration().

◆ id_

const std::string jami::Call::id_ {}
protected

MultiDevice: parent call, nullptr otherwise. Access protected by callMutex_.

Definition at line 473 of file call.h.

Referenced by getCallId().

◆ isIPToIP_

bool jami::Call::isIPToIP_ {false}
protected

Direct IP-to-IP or classic call.

Definition at line 525 of file call.h.

Referenced by setIPToIP().

◆ parent_

std::shared_ptr<Call> jami::Call::parent_
mutableprotected

MultiDevice: list of attached subcall.

Definition at line 476 of file call.h.

Referenced by addSubCall(), and isSubcall().

◆ peerConfProtocol_

int jami::Call::peerConfProtocol_ {0}
protected

Supported conference protocol version.

Definition at line 539 of file call.h.

Referenced by conferenceProtocolVersion().

◆ peerDisplayName_

std::string jami::Call::peerDisplayName_ {}
protected

Peer Display Name.

Definition at line 531 of file call.h.

Referenced by getPeerDisplayName(), merge(), and setPeerDisplayName().

◆ peerNumber_

std::string jami::Call::peerNumber_ {}
protected

Number of the peer.

Definition at line 528 of file call.h.

Referenced by getPeerNumber(), merge(), and setPeerNumber().

◆ pendingInMessages_

MsgList jami::Call::pendingInMessages_
protected

Definition at line 536 of file call.h.

Referenced by merge().

◆ pendingOutMessages_

MsgList jami::Call::pendingOutMessages_
protected

Definition at line 484 of file call.h.

◆ reason_

std::string jami::Call::reason_ {}
protected

Definition at line 522 of file call.h.

Referenced by Call().

◆ subcalls_

SubcallSet jami::Call::subcalls_
protected

Definition at line 479 of file call.h.

◆ timestamp_start_

time_t jami::Call::timestamp_start_ {0}
protected

MultiDevice: message received by subcall to merged yet.

Definition at line 533 of file call.h.

◆ toUsername_

std::string jami::Call::toUsername_ {}
protected

Definition at line 540 of file call.h.

Referenced by toUsername(), and toUsername().

◆ type_

CallType jami::Call::type_
protected

Type of the call.

Definition at line 511 of file call.h.

Referenced by Call(), getCallType(), isIncoming(), and jami::SIPCall::SIPCall().


The documentation for this class was generated from the following files: