CallsModel class
Calls list model (contains list of calls, methods for managing them, handlers of library events)
- Inheritance
-
- Object
- ChangeNotifier
- CallsModel
Constructors
- CallsModel.new(IAccountsModel _accountsModel, [ILogsModel? _logs, CdrsModel? _cdrs])
- Constructor (set event handler)
Properties
-
callItems
→ List<
CallModel> -
no setter
- confModeStarted → bool
-
Returns true if conference mode started
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- isEmpty → bool
-
Returns true when list of calls is empty
no setter
- length → int
-
Returns number of calls in list
no setter
- onNewIncomingCall ↔ NewIncomingCallCallback?
-
Callback function which is raised by model when new incomning 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
- runtimeType → Type
-
A representation of the runtime type of the object.
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
-
calcDuration(
) → void - Calculate duration of connected calls in list (invoke it by 1sec timer)
-
contains(
int callId) → bool - Returns true if exists call with specified id
-
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
-
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)
-
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)
-
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
-
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, 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
-
onTerminated(
int callId, int statusCode) → void - Handle teminated 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
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
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)
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
-
operator [](
int i) → CallModel - Returns call by its index in list
Static Methods
Constants
- kEmptyCallId → const int