CallModel class

Call model (contains call attributes, methods for managing them, handles library events)

Inheritance

Constructors

CallModel(int myCallId, String accUri, String remoteExt, bool isIncoming, bool hasSecureMedia, bool _hasVideo, [ILogsModel? _logs])

Properties

accUri → String
Account URI used to accept/make this call
final
displName ↔ String
Contact name (resolved by app)
getter/setter pair
duration → Duration
Duration of this call
no setter
durationStr → String
Duration of this call as string representation
no setter
hashCode → int
The hash code for this object.
no setterinherited
hasListeners → bool
Whether any listeners are currently registered.
no setterinherited
hasSecureMedia → bool
Has call encrypted audio/video
final
hasVideo → bool
no setter
hasVideoUpgradeRequest → bool
Returns true if app received request 'upgrade to video' from remote side (happens only if acc.upgradeToVideo=UpgradeToVideoMode.Manual)
no setter
holdState → HoldState
Hold state of this call
no setter
isCamMuted → bool
no setter
isConnected → bool
Returns true if call state is connected
no setter
isFilePlaying → bool
no setter
isIncoming → bool
Is call incoming
final
isLocalHold → bool
Returns true if call put on hold by local side
no setter
isMicMuted → bool
no setter
isRecStarted → bool
no setter
isRemoteHold → bool
Returns true if call put on hold by remote side
no setter
isUpgradingToVideo → bool
Returns true if app has invoked 'upgradeToVideo' (requested upgrade to video) and is waiting on response
no setter
myCallId → int
Unique call id assigned by library
final
nameAndExt → String
Name and extenstion of the remote side of this call
no setter
playerId → int
no setter
receivedDtmf → String
List of received DTMFs
no setter
remoteExt → String
Phone number(extension) of remote side of this call
final
response → String
Status line of the 1xx SIP response received from remote side when app makes outgoing call
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
startTime → DateTime
Timestamp when call has been connected (accepted by local or remeote side)
no setter
state → CallState
State of this call
no setter

Methods

accept([bool withVideo = true]) → Future<void>
Accept (answer) this call
acceptVideoUpgrade([bool withVideo = true]) → Future<void>
Accept request 'upgrade to video' received from remote side. 'withVideo=false' - means don't allow to start video
addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
bye() → Future<void>
End this call (send BYE request)
calcDuration() → void
Calculate duration of this call (invoke by 1sec timer)
dispose() → void
Discards any resources used by the object.
inherited
getSipHeader(String headerName) → Future<String?>
Get value of the SIP header from last received response (when input param empty returns whole SIP response)
getStats() → Future<String?>
Get statistics of this call
hold() → Future<void>
Toggle hold of this call (hold means stop send/receive audio/video RTP streams)
muteCam(bool mute) → Future<void>
Mute camera for this call
muteMic(bool mute) → Future<void>
Mute microphone for this call
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
onConnected(String hdrFrom, String hdrTo, bool withVideo) → void
Handles 2xx responses
onDtmfReceived(int tone) → void
Handle received DTMF tone
onHeld(HoldState holdState) → void
Handle hold state changes
onMuted(bool mute) → void
Handle mute state changes (iOS/CallKit only)
onPlayerStateChanged(int playerId, PlayerState state) → bool
Handle player state changes
onProceeding(String resp) → void
Event handlers------------- Handles 1xx responses received from remote side
onTerminated(int statusCode, String reason) → void
Handle terminated state, allows to display reason of call end during short time
onTransferred(int statusCode) → void
Handle response of the 'transfer' request
onVideoUpgraded(bool withVideo, bool isUpgradeModeRecvOnly) → void
Handle response of the upgrade to video request
onVideoUpgradeRequested() → void
Handle request 'upgrade to video' received from remote side ! In the event handler app HAS invoke 'acceptVideoUpgrade(true/false)'
playFile(String pathToMp3File, {bool loop = false}) → Future<void>
Play file to remote side of this call
recordFile(String pathToMp3File) → Future<void>
Record received sound to file (current implementation records to wav file)
reject() → Future<void>
Reject this call
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
sendDtmf(String tones, [int durationMs = 200, int intertoneGapMs = 50, int method = PjsipConnectFlutter.kDtmfMethodRtp]) → Future<void>
Send DTMF (single tone or sequence of tones) to remote side of this call
stopPlayFile() → Future<void>
Stop playing file
stopRecordFile() → Future<void>
Stop recording
toJson() → Map<String, dynamic>
toString() → String
A string representation of this object.
inherited
transferAttended(int toCallId) → Future<void>
Transfer this call to specified call
transferBlind(String toExt) → Future<void>
Transfer this call to specified extension
updateDisplName(String newDisplName) → void
Update display name
upgradeToVideo() → Future<void>
Send to remote side request 'Upgrade call from audio only to audio+video'

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

formatDuration(Duration duration) → String
Format call duration as 'hh:mm:ss' or 'mm:ss'
fromJson(Map jsonMap, ILogsModel? logs) → CallModel?
Creates instance of CallModel with values read from json