diff --git a/lib/config/config.dart b/lib/config/config.dart index 60336685..6eaaab8b 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -20,8 +20,8 @@ var PACKAGES_ORDERS = '/api/orders'; var PACKAGES_ORDER_HISTORY = '/api/orders/items'; var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; // var BASE_URL = 'http://10.50.100.198:3334/'; -// var BASE_URL = 'https://uat.hmgwebservices.com/'; -var BASE_URL = 'https://hmgwebservices.com/'; + var BASE_URL = 'https://uat.hmgwebservices.com/'; +// var BASE_URL = 'https://hmgwebservices.com/'; // Pharmacy UAT URLs // var BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; diff --git a/lib/models/LiveCare/IncomingCallData.dart b/lib/models/LiveCare/IncomingCallData.dart index 1ee149a3..238cf4a8 100644 --- a/lib/models/LiveCare/IncomingCallData.dart +++ b/lib/models/LiveCare/IncomingCallData.dart @@ -81,7 +81,7 @@ class IncomingCallData { isCall = json['is_call']; sound = json['sound']; server = json['server']; - isWebRTC = json['isWebRTC'] ?? "false"; + isWebRTC = json['is_webrtc'] ?? "true"; } Map toJson() { @@ -111,7 +111,7 @@ class IncomingCallData { data['is_call'] = this.isCall; data['sound'] = this.sound; data['server'] = this.server; - data['isWebRTC'] = this.isWebRTC; + data['is_webrtc'] = this.isWebRTC; return data; } } diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index 51ed948c..f4da8487 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -123,7 +123,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { "DoctorImageURL": "https://image.shutterstock.com/image-vector/sample-stamp-square-grunge-sign-260nw-1474408826.jpg", "callerID": "9920", "PatientID": "1231755", - "is_call": "true" + "is_call": "true", }; void _requestIOSPermissions() { @@ -452,15 +452,15 @@ class _LandingPageState extends State with WidgetsBindingObserver { dummyCall() async { - final server = await SelectionDialog( - context, - title: "Select Server", - items: ["https://livecareturn.hmg.com:8086", "https://104.197.179.1:8086"] - ).show(); + // final server = await SelectionDialog( + // context, + // title: "Select Server", + // items: ["https://livecareturn.hmg.com:8086", "https://104.197.179.1:8086"] + // ).show(); final json = { - "callerID": "s1", - "PatientID": "s2", + "callerID": "9920", + "PatientID": "1231755", "msgID": "123", "notfID": "123", "notification_foreground": "true", @@ -484,7 +484,8 @@ class _LandingPageState extends State with WidgetsBindingObserver { "videoUrl": "video", "picture": "video", "is_call": "true", - "server": server, + "is_webrtc": "true", + "server": "https://livecareturn.hmg.com:8086", }; IncomingCallData incomingCallData = IncomingCallData.fromJson(json); diff --git a/lib/pages/videocall-webrtc-rnd/webrtc/signaling.dart b/lib/pages/videocall-webrtc-rnd/webrtc/signaling.dart index 4458604a..3eb88502 100644 --- a/lib/pages/videocall-webrtc-rnd/webrtc/signaling.dart +++ b/lib/pages/videocall-webrtc-rnd/webrtc/signaling.dart @@ -8,7 +8,7 @@ import '../utils/turn.dart' if (dart.library.js) '../utils/turn_web.dart'; enum SignalingState { Open, Closed, Error } -enum CallState { Calling, Ringing, Invite, Connected, Bye } +enum CallState {Bye} const JsonEncoder _encoder = JsonEncoder(); @@ -68,7 +68,7 @@ class Signaling { Function(SessionOneToOne session, MediaStream stream) onRemoveRemoteStream; Function(dynamic event) onPeersUpdate; Function(dynamic event) onConnected; - Function(dynamic event) onRemoteConnected; + Function(dynamic event) onCallAccepted; Function(SessionOneToOne session, RTCDataChannel dc, RTCDataChannelMessage data) onDataChannelMessage; Function(SessionOneToOne session, RTCDataChannel dc) onDataChannel; @@ -105,7 +105,7 @@ class Signaling { close() async { - await finishSessions(); + finishSessions(); _socket?.close(); } @@ -139,7 +139,6 @@ class Signaling { _createDataChannel(session); } _createOffer(session, media); - onCallStateChange?.call(session, CallState.Calling); } void bye(SessionOneToOne session) { @@ -157,7 +156,7 @@ class Signaling { switch (mapData['type']) { case 'call_accepted': { - onRemoteConnected?.call(data); + onCallAccepted?.call(data); } break; @@ -171,8 +170,6 @@ class Signaling { case 'offer': { - - var peerId = data['from']; var description = data['description']; var media = data['media']; @@ -186,12 +183,10 @@ class Signaling { }); session.remoteCandidates.clear(); } - onCallStateChange?.call(session, CallState.Calling); } break; case 'answer': { - var description = data['description']; var sessionId = data['session_id']; session.pc?.setRemoteDescription( @@ -200,8 +195,6 @@ class Signaling { break; case 'candidate': { - - var peerId = data['from']; var candidateMap = data['candidate']; var sessionId = data['session_id']; RTCIceCandidate candidate = RTCIceCandidate(candidateMap['candidate'], @@ -219,23 +212,14 @@ class Signaling { } } break; - case 'leave': - { - var peerId = data as String; - _closeSessionById(peerId); - } - break; + case 'bye': { - - var sessionId = data['session_id']; - print('bye: ' + sessionId); - if (session != null) { + if(session.local_user.id != data["from"]) onCallStateChange?.call(session, CallState.Bye); - _closeSession(session); - } } break; + case 'keepalive': { print('keepalive response!'); @@ -486,14 +470,7 @@ class Signaling { } Future finishSessions() async { - _closeSessionById(session.id); - } - - void _closeSessionById(String sessionId) { - if (session != null && session.id == sessionId) { - _closeSession(session); - onCallStateChange?.call(session, CallState.Bye); - } + _closeSession(session); } Future _closeSession(SessionOneToOne session) async { diff --git a/lib/pages/videocall-webrtc-rnd/webrtc/start_video_call.dart b/lib/pages/videocall-webrtc-rnd/webrtc/start_video_call.dart index b1d89f66..80cc6f10 100644 --- a/lib/pages/videocall-webrtc-rnd/webrtc/start_video_call.dart +++ b/lib/pages/videocall-webrtc-rnd/webrtc/start_video_call.dart @@ -76,19 +76,6 @@ class StartVideoCallState extends State { @override Widget build(BuildContext context) { return Scaffold( - // appBar: AppBar( - // title: Text('P2P Call Sample' + (_session?.local_user != null ? ' [Your ID (${_session?.local_user?.id})] ' : '')), - // actions: [ - // IconButton( - // icon: const Icon(Icons.settings), - // onPressed: (){ - // setState(() { - // }); - // }, - // tooltip: 'setup', - // ), - // ], - // ), body: videoCanvasWidgets(), ); } @@ -142,19 +129,9 @@ class StartVideoCallState extends State { _signaling?.onCallStateChange = (SessionOneToOne session, CallState state) { switch (state) { - case CallState.Calling: - setState(() {}); - break; case CallState.Bye: - setState(() { - _localRenderer.srcObject = null; - _remoteRenderer.srcObject = null; - _session = null; - }); + _onHangup(byRemote: true); break; - case CallState.Invite: - case CallState.Connected: - case CallState.Ringing: } }; @@ -162,7 +139,7 @@ class StartVideoCallState extends State { _signaling?.callAccepted(_session); }); - _signaling?.onRemoteConnected = ((event) { + _signaling?.onCallAccepted = ((event) { }); @@ -184,12 +161,6 @@ class StartVideoCallState extends State { }); } - _hangUp() async{ - if (_session != null) { - _signaling?.bye(_session); - } - } - _switchCamera() { _signaling?.switchCamera(); } @@ -198,11 +169,13 @@ class StartVideoCallState extends State { _signaling?.muteMic(); } - Function _onAudioEnable() { + Function _onAudioEnable(){ final audioTrack = localMediaStream.getAudioTracks()[0]; - final mute = audioTrack.muted; - Helper.setMicrophoneMute(!mute, audioTrack); - _audioButton.add(mute); + final micEnabled = audioTrack.enabled; + localMediaStream.getAudioTracks()[0].enabled = !micEnabled; + _audioButton.add(!micEnabled); + // _audioButton.add(!mute); + // Helper.setMicrophoneMute(!mute, audioTrack); } Function _onVideoEnabled() { @@ -233,9 +206,12 @@ class StartVideoCallState extends State { _onButtonBarVisibleStreamController.add(false); } - Future _onHangup() async { - _signaling?.finishSessions(); - print('onHangup'); - Navigator.of(context).pop(); + Future _onHangup({bool byRemote = false}) async { + if(byRemote){ + Navigator.of(context).pop(); + }else{ + _signaling.bye(_session); + Navigator.of(context).pop(); + } } } \ No newline at end of file diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index e5b2cc16..71e26c8e 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -35,13 +35,13 @@ class MyInAppBrowser extends InAppBrowser { // static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL LIVE static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT - // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT + static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT - static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE + // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE - // static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT + static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT - static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store + // static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store // static String PRESCRIPTION_PAYMENT_WITH_ORDERID = // 'https://uat.hmgwebservices.com/epharmacy/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID='; diff --git a/speech_to_text/android/.settings/org.eclipse.buildship.core.prefs b/speech_to_text/android/.settings/org.eclipse.buildship.core.prefs index 7a23d112..0c669305 100644 --- a/speech_to_text/android/.settings/org.eclipse.buildship.core.prefs +++ b/speech_to_text/android/.settings/org.eclipse.buildship.core.prefs @@ -1,11 +1,11 @@ arguments= auto.sync=false build.scans.enabled=false -connection.gradle.distribution=GRADLE_DISTRIBUTION(VERSION(5.6.1)) +connection.gradle.distribution=GRADLE_DISTRIBUTION(VERSION(7.4.2)) connection.project.dir= eclipse.preferences.version=1 gradle.user.home= -java.home= +java.home=/Library/Java/JavaVirtualMachines/jdk1.8.0_281.jdk/Contents/Home jvm.arguments= offline.mode=false override.workspace.settings=true