omikit-plugin 3.2.65 → 3.2.66
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +99 -26
- package/android/build.gradle +1 -1
- package/android/gradle.properties +1 -1
- package/ios/CallProcess/CallManager.swift +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -694,18 +694,27 @@ We need you request permission about call before make call:
|
|
|
694
694
|
// Result is the same with startCall
|
|
695
695
|
```
|
|
696
696
|
|
|
697
|
-
-
|
|
697
|
+
- __Accept a call__:
|
|
698
698
|
|
|
699
699
|
```javascript
|
|
700
700
|
import {joinCall} from 'omikit-plugin';
|
|
701
701
|
|
|
702
702
|
await joinCall();
|
|
703
703
|
```
|
|
704
|
+
__Note__: When calling `joinCall`, sdk will check permission of microphone and camera. If have any permission denied, sdk will send a event `onRequestPermissionAndroid` with list permission you need to request. You need to request permission before calling `joinCall` again.
|
|
704
705
|
|
|
705
|
-
Note: When calling `joinCall`, sdk will check permission of microphone and camera. If have any permission denied, sdk will send a event `onRequestPermissionAndroid` with list permission you need to request. You need to request permission before calling `joinCall` again.
|
|
706
706
|
|
|
707
|
-
|
|
707
|
+
- __Call forwarding__: used to transfer the current call to any employee's sip number
|
|
708
|
+
```javascript
|
|
709
|
+
import {transferCall} from 'omikit-plugin';
|
|
710
|
+
|
|
711
|
+
transferCall({
|
|
712
|
+
phoneNumber: 102 // employee's internal number
|
|
713
|
+
})
|
|
714
|
+
```
|
|
715
|
+
|
|
708
716
|
|
|
717
|
+
- __End a call__ : We will push a event `endCall` for you.
|
|
709
718
|
```javascript
|
|
710
719
|
import {endCall} from 'omikit-plugin';
|
|
711
720
|
|
|
@@ -750,6 +759,7 @@ We need you request permission about call before make call:
|
|
|
750
759
|
- Send character: We only support `1 to 9` and `* #`.
|
|
751
760
|
|
|
752
761
|
```javascript
|
|
762
|
+
// FUNC IS USED when the user wants key interaction during a call. For example, press key 1, 2, 3.. to move to group
|
|
753
763
|
import {sendDTMF} from 'omikit-plugin';
|
|
754
764
|
|
|
755
765
|
sendDTMF({
|
|
@@ -791,14 +801,14 @@ We need you request permission about call before make call:
|
|
|
791
801
|
"uuid": "122aaa"
|
|
792
802
|
}
|
|
793
803
|
```
|
|
794
|
-
-
|
|
804
|
+
- __endCall__: End a completed call (including rejecting a call).
|
|
795
805
|
|
|
796
806
|
```javascript
|
|
797
807
|
import {endCall} from 'omikit-plugin';
|
|
798
808
|
|
|
799
809
|
endCall();
|
|
800
810
|
```
|
|
801
|
-
-
|
|
811
|
+
- __rejectCall__: Used to reject an incoming call when the user has not accepted it yet.
|
|
802
812
|
Note: Do not use this function to end an ongoing call.
|
|
803
813
|
|
|
804
814
|
```javascript
|
|
@@ -806,7 +816,7 @@ We need you request permission about call before make call:
|
|
|
806
816
|
|
|
807
817
|
rejectCall();
|
|
808
818
|
```
|
|
809
|
-
-
|
|
819
|
+
- __Logout__: logout and remove all information.
|
|
810
820
|
|
|
811
821
|
```javascript
|
|
812
822
|
import {logout} from 'omikit-plugin';
|
|
@@ -814,7 +824,7 @@ We need you request permission about call before make call:
|
|
|
814
824
|
logout();
|
|
815
825
|
```
|
|
816
826
|
|
|
817
|
-
-
|
|
827
|
+
- __Permission__: Check system alert window permission (only Android).
|
|
818
828
|
|
|
819
829
|
```javascript
|
|
820
830
|
import {systemAlertWindow} from 'omikit-plugin';
|
|
@@ -826,7 +836,7 @@ We need you request permission about call before make call:
|
|
|
826
836
|
}
|
|
827
837
|
```
|
|
828
838
|
|
|
829
|
-
-
|
|
839
|
+
- __Setting__: Open to enable system alert window (only Android).
|
|
830
840
|
|
|
831
841
|
```javascript
|
|
832
842
|
import {openSystemAlertSetting} from 'omikit-plugin';
|
|
@@ -835,16 +845,31 @@ We need you request permission about call before make call:
|
|
|
835
845
|
openSystemAlertSetting();
|
|
836
846
|
}
|
|
837
847
|
```
|
|
838
|
-
-
|
|
839
|
-
- func *getCurrentAudio*:
|
|
840
|
-
|
|
848
|
+
- __Audio__:
|
|
849
|
+
- func *getCurrentAudio*: Get current information of audio devices
|
|
850
|
+
```javascript
|
|
841
851
|
import {getCurrentAudio} from 'omikit-plugin';
|
|
842
852
|
|
|
843
853
|
getCurrentAudio().then((data: any) => {
|
|
844
854
|
console.log(data); // [{"name": "Speaker", "type": "Speaker"}]
|
|
845
|
-
//
|
|
846
|
-
// - name:
|
|
847
|
-
// - type:
|
|
855
|
+
// Note: Data is an array containing information about audio devices, with parameters:
|
|
856
|
+
// - name: Name of the audio device
|
|
857
|
+
// - type: Audio device type (e.g. "Speaker", "Receiver", etc.)
|
|
858
|
+
});
|
|
859
|
+
```
|
|
860
|
+
- func setAudio: set Audio calls the current device
|
|
861
|
+
```javascript
|
|
862
|
+
import { getAudio, setAudio} from 'omikit-plugin';
|
|
863
|
+
|
|
864
|
+
const audioList = await getAudio(); // Get a list of supported audio device types
|
|
865
|
+
console.log("audioList --> ", audioList) // audioList --> [{"name": "Receiver", "type": "Receiver"}, {"name": "Speaker", "type": "Speaker"}]
|
|
866
|
+
|
|
867
|
+
const receiver = audioList.find((element: any) => {
|
|
868
|
+
return element.type === 'Receiver'; // type: "Speaker" is the external speaker, Receiver is the internal speaker
|
|
869
|
+
});
|
|
870
|
+
|
|
871
|
+
setAudio({
|
|
872
|
+
portType: receiver.type,
|
|
848
873
|
});
|
|
849
874
|
```
|
|
850
875
|
|
|
@@ -899,7 +924,7 @@ We need you request permission about call before make call:
|
|
|
899
924
|
registerVideoEvent();
|
|
900
925
|
```
|
|
901
926
|
|
|
902
|
-
- Event listener
|
|
927
|
+
- *Event listener*:
|
|
903
928
|
|
|
904
929
|
```javascript
|
|
905
930
|
useEffect(() => {
|
|
@@ -959,21 +984,75 @@ useEffect(() => {
|
|
|
959
984
|
- hold(7);
|
|
960
985
|
|
|
961
986
|
* onCallStateChanged is call state tracking event. We will return status of state. Please refer `OmiCallState`.
|
|
962
|
-
|
|
987
|
+
|
|
988
|
+
```javascript
|
|
989
|
+
// The event is updated every time the call status changes
|
|
990
|
+
const onCallStateChanged = (data: any) => {
|
|
991
|
+
/*
|
|
992
|
+
Call state change event data (Object) includes:
|
|
993
|
+
|
|
994
|
+
- _id: string (UUID of the call)
|
|
995
|
+
- callInfo: object (Detailed call information)
|
|
996
|
+
- callerNumber: string (Phone number of the caller)
|
|
997
|
+
- code_end_call: number (Status code when the call ends)
|
|
998
|
+
- destination_number?: string (Destination phone number, optional)
|
|
999
|
+
- direction: string ("inbound" or "outbound", call direction)
|
|
1000
|
+
- disposition: string (Call answer status)
|
|
1001
|
+
- incoming: boolean (true if it is an incoming call)
|
|
1002
|
+
- isVideo: boolean (true if it is a video call)
|
|
1003
|
+
- sip_user: string (Current SIP user)
|
|
1004
|
+
- source_number: string (SIP number of the user)
|
|
1005
|
+
- status: string (value matching with List status call)
|
|
1006
|
+
- time_end: number (Timestamp when the call ended)
|
|
1007
|
+
- time_start_to_answer: number (Time taken to answer the call)
|
|
1008
|
+
- transaction_id: string (OMI Call unique ID)
|
|
1009
|
+
*/
|
|
1010
|
+
};
|
|
1011
|
+
|
|
1012
|
+
// Event returned when the user mutes the call
|
|
1013
|
+
const onMuted = (isMuted: boolean) => {
|
|
1014
|
+
// isMuted: true when muted call
|
|
1015
|
+
}
|
|
1016
|
+
|
|
1017
|
+
// Event returns value when user holds call
|
|
1018
|
+
const onHold = (isHold: boolean) => {
|
|
1019
|
+
// isHold: true when hold call
|
|
1020
|
+
}
|
|
1021
|
+
|
|
1022
|
+
// The event updates the quality of an ongoing call
|
|
1023
|
+
const onCallQuality = (data: any) => {
|
|
1024
|
+
const { quality } = data;
|
|
1025
|
+
// quality: int is mean quality off calling
|
|
1026
|
+
// 1 is good, 2 is medium, 3 is low
|
|
1027
|
+
}
|
|
1028
|
+
|
|
1029
|
+
// Even when user turn on speakerphone
|
|
1030
|
+
const onSpeaker = (isSpeaker: boolean) => {
|
|
1031
|
+
// isSpeaker: true, false
|
|
1032
|
+
// True mean speaker devices is open
|
|
1033
|
+
}
|
|
1034
|
+
|
|
1035
|
+
// * onSwitchboardAnswer have callback when employee answered script call.
|
|
1036
|
+
const onSwitchboardAnswer = (data: any) => {
|
|
1037
|
+
const { sip } = data
|
|
1038
|
+
// sip: String
|
|
1039
|
+
}
|
|
1040
|
+
```
|
|
963
1041
|
|
|
964
|
-
|
|
965
|
-
|
|
1042
|
+
### 📞 Call State Lifecycle
|
|
1043
|
+
* **`Incoming call` state lifecycle**: incoming -> connecting -> confirmed -> disconnected
|
|
1044
|
+
* **`Outgoing call` state lifecycle**: calling -> early -> connecting -> confirmed -> disconnected
|
|
966
1045
|
|
|
967
|
-
* onSwitchboardAnswer have callback when employee answered script call.
|
|
968
1046
|
|
|
969
1047
|
- Table describing code_end_call status
|
|
970
1048
|
|
|
971
1049
|
| Code | Description |
|
|
972
1050
|
| --------------- | --------------------------------------------------------------------------------------------------------------------- |
|
|
973
|
-
| `600, 503
|
|
1051
|
+
| `600, 503` | These are the codes of the network operator or the user who did not answer the call |
|
|
974
1052
|
| `408` | Call request timeout (Each call usually has a waiting time of 30 seconds. If the 30 seconds expire, it will time out) |
|
|
975
1053
|
| `403` | Your service plan only allows calls to dialed numbers. Please upgrade your service pack|
|
|
976
1054
|
| `404` | The current number is not allowed to make calls to the carrier|
|
|
1055
|
+
| `480` | The number has an error, please contact support to check the details |
|
|
977
1056
|
| `603` | The call was rejected. Please check your account limit or call barring configuration! |
|
|
978
1057
|
| `850` | Simultaneous call limit exceeded, please try again later |
|
|
979
1058
|
| `486` | The listener refuses the call and does not answer |
|
|
@@ -1007,12 +1086,6 @@ useEffect(() => {
|
|
|
1007
1086
|
- `OmiCallEvent.onHold`: hold current call
|
|
1008
1087
|
- Data value: We return `callerNumber`, `sip`, `isVideo: true/false` information
|
|
1009
1088
|
|
|
1010
|
-
- Forward calls to internal staff:
|
|
1011
|
-
- You can use function `transferCall` for transfer to staff you want.
|
|
1012
|
-
example:
|
|
1013
|
-
transferCall({
|
|
1014
|
-
phoneNumber: 102
|
|
1015
|
-
})
|
|
1016
1089
|
|
|
1017
1090
|
# Issues
|
|
1018
1091
|
|
package/android/build.gradle
CHANGED
|
@@ -120,7 +120,7 @@ dependencies {
|
|
|
120
120
|
// use for OMISDK
|
|
121
121
|
implementation("androidx.work:work-runtime:2.8.1")
|
|
122
122
|
implementation "androidx.security:security-crypto:1.1.0-alpha06"
|
|
123
|
-
api 'vn.vihat.omicall:omi-sdk:2.3.
|
|
123
|
+
api 'vn.vihat.omicall:omi-sdk:2.3.17'
|
|
124
124
|
|
|
125
125
|
implementation "com.facebook.react:react-native:+" // From node_modules
|
|
126
126
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
@@ -335,7 +335,7 @@ class CallManager {
|
|
|
335
335
|
if (videoManager == nil && call.isVideo) {
|
|
336
336
|
videoManager = OMIVideoViewManager.init()
|
|
337
337
|
}
|
|
338
|
-
isSpeaker = call.
|
|
338
|
+
isSpeaker = call.speaker
|
|
339
339
|
lastStatusCall = "answered"
|
|
340
340
|
OmikitPlugin.instance.sendMuteStatus()
|
|
341
341
|
break
|
|
@@ -517,7 +517,7 @@ class CallManager {
|
|
|
517
517
|
func getCurrentAudio() -> [[String: String]] {
|
|
518
518
|
return OmiClient.getCurrentAudio()
|
|
519
519
|
}
|
|
520
|
-
|
|
520
|
+
|
|
521
521
|
//video call
|
|
522
522
|
func toggleCamera() {
|
|
523
523
|
if let videoManager = videoManager {
|