@@ -221,6 +221,17 @@ class CallVideoUpgradedArg {
221221 }
222222}
223223
224+ /// Helper class for handling 'onCallVideoUpgradeRequested' event raised by library
225+ class CallVideoUpgradeRequestedArg {
226+ int callId= 0 ;
227+ bool fromMap (Map <dynamic , dynamic > argsMap) {
228+ int argsCounter= 0 ;
229+ argsMap.forEach ((key, value) {
230+ if ((key == SiprixVoipSdkPlatform .kArgCallId)&& (value is int )) { callId = value; argsCounter+= 1 ; }
231+ });
232+ return (argsCounter== 1 );
233+ }
234+ }
224235
225236/// Helper class for handling 'onCallRedirected' event raised by library
226237class CallRedirectedArg {
@@ -388,8 +399,8 @@ class NetStateListener {
388399class CallStateListener {
389400 CallStateListener ({this .proceeding, this .incoming, this .incomingPush, this .acceptNotif,
390401 this .connected, this .terminated, this .dtmfReceived,
391- this .transferred, this .redirected, this .videoUpgraded, this .held, this .switched,
392- this .playerStateChanged});
402+ this .transferred, this .redirected, this .videoUpgraded, this .videoUpgradeRequested,
403+ this .held, this .switched, this . playerStateChanged});
393404
394405 ///Triggered by library when changed player state in specific call
395406 void Function (int playerId, PlayerState s)? playerStateChanged;
@@ -411,6 +422,8 @@ class CallStateListener {
411422 void Function (int origCallId, int relatedCallId, String referTo)? redirected;
412423 ///Triggered by library when remote side requested to start send/receive video and request accepted.
413424 void Function (int callId, bool withVideo)? videoUpgraded;
425+ ///Triggered by library when remote side requested to start send/receive video
426+ void Function (int callId)? videoUpgradeRequested;
414427 ///Triggered by library when received DTMF tone from remote side.
415428 void Function (int callId, int tone)? dtmfReceived;
416429 ///Triggered by library when local or remote side has put call on hold
@@ -545,6 +558,7 @@ class SiprixVoipSdk {
545558 static const int kUpgradeToVideoSendRecv = 0 ;
546559 static const int kUpgradeToVideoRecvOnly = 1 ;
547560 static const int kUpgradeToVideoInactive = 2 ;
561+ static const int kUpgradeToVideoManual = 3 ;
548562
549563 ///Error codes constants
550564 static const int eOK = 0 ;
@@ -749,6 +763,11 @@ class SiprixVoipSdk {
749763 return _platform.upgradeToVideo (callId);
750764 }
751765
766+ /// Accept requested upgrade of the call's media and specify is allowed to use video
767+ Future <void > acceptVideoUpgrade (int callId, bool withVideo) async {
768+ return _platform.acceptVideoUpgrade (callId, withVideo);
769+ }
770+
752771 /// Stop playing (mute) ringtone.
753772 Future <void > stopRingtone () async {
754773 return _platform.stopRingtone ();
@@ -900,6 +919,12 @@ class SiprixVoipSdk {
900919 return _platform.getCallKitCallUUID (sip_callId);
901920 }
902921
922+ ///End CallKit call specified by its UUID (Allowed to use only when missed SIP signalling for that call)
923+ Future <void >? endCallKitCall (String callkit_CallUUID) {
924+ return _platform.endCallKitCall (callkit_CallUUID);
925+ }
926+
927+
903928 //-//////////////////////////////////////////////////////////////////////////////////////
904929 //-Android specific implementation
905930
@@ -944,6 +969,7 @@ class SiprixVoipSdk {
944969 case SiprixVoipSdkPlatform .kOnCallTransferred : _onCallTransferred (argsMap); break ;
945970 case SiprixVoipSdkPlatform .kOnCallRedirected : _onCallRedirected (argsMap); break ;
946971 case SiprixVoipSdkPlatform .kOnCallVideoUpgraded: _onCallVideoUpgraded (argsMap); break ;
972+ case SiprixVoipSdkPlatform .kOnCallVideoUpgradeRequested: _onCallVideoUpgradeRequested (argsMap); break ;
947973 case SiprixVoipSdkPlatform .kOnCallSwitched : _onCallSwitched (argsMap); break ;
948974 case SiprixVoipSdkPlatform .kOnCallHeld : _onCallHeld (argsMap); break ;
949975
@@ -1039,6 +1065,13 @@ class SiprixVoipSdk {
10391065 }
10401066 }
10411067
1068+ void _onCallVideoUpgradeRequested (Map <dynamic , dynamic > argsMap) {
1069+ CallVideoUpgradeRequestedArg arg = CallVideoUpgradeRequestedArg ();
1070+ if (arg.fromMap (argsMap)) {
1071+ callListener? .videoUpgradeRequested? .call (arg.callId);
1072+ }
1073+ }
1074+
10421075 void _onCallRedirected (Map <dynamic , dynamic > argsMap) {
10431076 CallRedirectedArg arg = CallRedirectedArg ();
10441077 if (arg.fromMap (argsMap)) {
0 commit comments