CallModel class
Call model (contains call attributes, methods for managing them, handles library events)
- Inheritance
-
- Object
- ChangeNotifier
- CallModel
Constructors
- CallModel.new(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
- holdState → HoldState
-
Hold state of this call
no setter
- isCamMuted → bool
-
no setter
- isConnected → bool
-
Returns true if call state is
connected
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
- 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
-
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. After this is called, the
object is not in a usable state and should be discarded (calls to
addListener will throw after the object is disposed).
inherited
-
getSipHeader(
String headerName) → Future< String?> - Get value of the SIP header from last received response (when input param empty returns whole SIP response)
-
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
-
onProceeding(
String resp) → void - Event handlers------------- Handles 1xx responses received from remote side
-
onTransferred(
int statusCode) → void - Handle response of the 'transfer' request
-
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 = SiprixVoipSdk.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
-
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
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'