CallsModel class

Calls list model (contains list of calls, methods for managing them, handlers of library events)

Inheritance
Mixed-in types

Constructors

CallsModel(IAccountsModel _accountsModel, [ILogsModel? _logs, CdrsModel? _cdrs])
Constructor (set event handler)

Properties

accountsModel IAccountsModel
no setter
callItems List<CallModel>
no setter
confModeStarted bool
Returns true if conference mode started
no setter
first CallModel
The first element.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
isEmpty bool
Whether this collection has no elements.
no setterinherited
isNotEmpty bool
Whether this collection has at least one element.
no setterinherited
iterator Iterator<CallModel>
A new Iterator that allows iterating the elements of this Iterable.
no setteroverride
last CallModel
The last element.
no setterinherited
length int
The number of elements in this Iterable.
no setterinherited
onNewIncomingCall NewIncomingCallCallback?
Callback function which is raised by model when new incoming call received
getter/setter pair
onResolveContactName ResolveContactNameCallback?
Callback function which is raised by model when it need to resolve contact name of the new call
getter/setter pair
onSwitchedCall CallSwitchedCallCallback?
Callback function which is raised by model when call switched
getter/setter pair
onVideoUpgradeRequestReceived CallVideoUpgradeRequestedCallback?
Callback function which is raised by model when video upgrade request received
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
single CallModel
Checks that this iterable has only one element, and returns that element.
no setterinherited
switchedCallId int
Returns id of the switched call (or kEmptyCallId when there are no calls)
no setter

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
any(bool test(CallModel element)) bool
Checks whether any element of this iterable satisfies test.
inherited
calcDuration() → void
Calculate duration of connected calls in list (invoke it by 1sec timer)
cast<R>() Iterable<R>
A view of this iterable as an iterable of R instances.
inherited
contains(Object? element) bool
Whether the collection contains an element equal to element.
inherited
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
elementAt(int index) CallModel
Returns the indexth element.
inherited
every(bool test(CallModel element)) bool
Checks whether every element of this iterable satisfies test.
inherited
expand<T>(Iterable<T> toElements(CallModel element)) Iterable<T>
Expands each element of this Iterable into zero or more elements.
inherited
firstWhere(bool test(CallModel element), {CallModel orElse()?}) CallModel
The first element that satisfies the given predicate test.
inherited
fold<T>(T initialValue, T combine(T previousValue, CallModel element)) → T
Reduces a collection to a single value by iteratively combining each element of the collection with an existing value
inherited
followedBy(Iterable<CallModel> other) Iterable<CallModel>
Creates the lazy concatenation of this iterable and other.
inherited
forEach(void action(CallModel element)) → void
Invokes action on each element of this iterable in iteration order.
inherited
hasConnectedFewCalls() bool
Returns true if present at least 2 calls in connected/held state
invite(CallDestination dest) Future<void>
Initiate new outgoing call via sending INVITE request (creates new call instance, adds it to list, notifies UI)
join([String separator = ""]) String
Converts each element to a String and concatenates the strings.
inherited
lastWhere(bool test(CallModel element), {CallModel orElse()?}) CallModel
The last element that satisfies the given predicate test.
inherited
makeConference() Future<void>
Join all calls to conference (configures mixer to send sound from mic to all calls and play received sound from all calls to speaker)
map<T>(T toElement(CallModel e)) Iterable<T>
The current elements of this iterable modified by toElement.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
onAcceptNotif(int callId, bool withVideo) → void
Handle case when call answered by tapping notification button (Android only)
onConnected(int callId, String from, String to, bool withVideo) → void
Handles 2xx responses raised by library and route it to matched call instance
onDtmfReceived(int callId, int tone) → void
Handle receive DTMF event raised by library and route it to matched call instance
onHeld(int callId, HoldState s) → void
Handle hold event raised by library and route it to matched call instance
onIncomingPush(String callkit_CallUUID, Map<String, dynamic> pushPayload) → void
Handle pushkit notification received by library (parse payload, update CallKit window, wait on SIP call)
onIncomingSip(int callId, int accId, bool withVideo, String hdrFrom, String hdrTo) → void
Handle incoming call event raised by library when received INVITE request
onMuted(int callId, bool mute) → void
Handle muted event raised by CallKit (iOS/CallKit only)
onPlayerStateChanged(int playerId, PlayerState state) → void
Handle call switched event raised by library
onProceeding(int callId, String response) → void
Handle 1xx response event raised by library and route it to matched call instance
onRedirected(int origCallId, int relatedCallId, String referTo) → void
Handle redirect response event raised by library and route it to matched call instance
onSwitched(int callId) → void
Handle call switched event raised by library
onSyncCallsState(Map<String, dynamic> argsMap) → void
Restore saved calls when Activity re-created while service has been running (Android only)
onTerminated(int callId, int statusCode) → void
Handle terminated call event raised by library (removes call instance from list and notifies UI)
onTransferred(int callId, int statusCode) → void
Handle transfer response event raised by library and route it to matched call instance
onVideoUpgraded(int callId, bool withVideo) → void
Handle case when remote side requested to start send/receive video and request accepted.
onVideoUpgradeRequested(int callId) → void
Handle request 'upgrade to video' received from remote side
reduce(CallModel combine(CallModel value, CallModel element)) CallModel
Reduces a collection to a single value by iteratively combining elements of the collection using the provided function.
inherited
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
singleWhere(bool test(CallModel element), {CallModel orElse()?}) CallModel
The single element that satisfies test.
inherited
skip(int count) Iterable<CallModel>
Creates an Iterable that provides all but the first count elements.
inherited
skipWhile(bool test(CallModel value)) Iterable<CallModel>
Creates an Iterable that skips leading elements while test is satisfied.
inherited
switchedCall() CallModel?
Returns switched call instance (or null when there are no calls)
switchToCall(int callId) Future<void>
Switch to call with specified id (configure mixer to send sound from mic to this call and play received sound of this call to speaker)
take(int count) Iterable<CallModel>
Creates a lazy iterable of the count first elements of this iterable.
inherited
takeWhile(bool test(CallModel value)) Iterable<CallModel>
Creates a lazy iterable of the leading elements satisfying test.
inherited
toJson() Map<String, dynamic>
Serialize list of accounts+calls to json
override
toList({bool growable = true}) List<CallModel>
Creates a List containing the elements of this Iterable.
inherited
toSet() Set<CallModel>
Creates a Set containing the same elements as this iterable.
inherited
toString() String
Returns a string representation of (some of) the elements of this.
inherited
where(bool test(CallModel element)) Iterable<CallModel>
Creates a new lazy Iterable with all elements that satisfy the predicate test.
inherited
whereType<T>() Iterable<T>
Creates a new lazy Iterable with all elements that have type T.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited
operator [](int i) CallModel
Returns call by its index in list

Static Methods

parseDisplayName(String uri) String
Parse SIP uri and return display name
parseExt(String uri) String
Parse SIP uri and return extension

Constants

kEmptyCallId → const int