@wazo/sdk 0.38.1 → 0.38.4
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 +82 -7
- package/dist/wazo-sdk.js +5 -5
- package/esm/index.js +103 -42
- package/esm/simple/Auth.js +103 -42
- package/esm/simple/Configuration.js +103 -42
- package/esm/simple/Phone.js +103 -42
- package/esm/simple/Softphone.js +104 -43
- package/esm/simple/index.js +103 -42
- package/esm/simple/room/LocalParticipant.js +103 -42
- package/esm/simple/room/Participant.js +103 -42
- package/esm/simple/room/RemoteParticipant.js +103 -42
- package/esm/simple/room/Room.js +103 -42
- package/esm/simple/room/SipRoom.js +103 -42
- package/esm/simple/room/Stream.js +103 -42
- package/esm/simple/room/__tests__/RemoteParticipant.test.js +103 -42
- package/esm/simple/utils.js +103 -42
- package/lib/index.js +103 -42
- package/lib/simple/Auth.js +103 -42
- package/lib/simple/Configuration.js +103 -42
- package/lib/simple/Phone.js +103 -42
- package/lib/simple/Softphone.js +104 -43
- package/lib/simple/index.js +103 -42
- package/lib/simple/room/LocalParticipant.js +103 -42
- package/lib/simple/room/Participant.js +103 -42
- package/lib/simple/room/RemoteParticipant.js +103 -42
- package/lib/simple/room/Room.js +103 -42
- package/lib/simple/room/SipRoom.js +103 -42
- package/lib/simple/room/Stream.js +103 -42
- package/lib/simple/room/__tests__/RemoteParticipant.test.js +103 -42
- package/lib/simple/utils.js +103 -42
- package/package.json +1 -1
- package/src/simple/Softphone.js +104 -43
package/README.md
CHANGED
|
@@ -614,7 +614,9 @@ Wazo.Softphone.init({
|
|
|
614
614
|
language, // Softphone language (optional).
|
|
615
615
|
wrapUpDuration, // How long (in seconds) should the softphone display the card after the call (optional).
|
|
616
616
|
// When the user changes anything on the card, this timeout is canceled
|
|
617
|
-
|
|
617
|
+
enableAgent, // display the agent tab in the tab bar (defaults to true).
|
|
618
|
+
tenantId, // Tenant id used for LDAP connection
|
|
619
|
+
debug, // Set to `true` to display wording customization labels
|
|
618
620
|
});
|
|
619
621
|
```
|
|
620
622
|
|
|
@@ -647,9 +649,66 @@ Wazo.Softphone.onOptionsResults(fieldId, results);
|
|
|
647
649
|
|
|
648
650
|
`onOptionsResults` is used to populate Autocomplete fields
|
|
649
651
|
|
|
652
|
+
#### Updating card value:
|
|
653
|
+
```js
|
|
654
|
+
Wazo.Softphone.setCardValue(field, value);
|
|
655
|
+
```
|
|
656
|
+
|
|
657
|
+
#### Customizing page style
|
|
658
|
+
|
|
659
|
+
You can inspect the iframe with your dev tool console to figure out how to override styles.
|
|
660
|
+
|
|
661
|
+
```js
|
|
662
|
+
Wazo.Softphone.injectCss(`
|
|
663
|
+
# Reduce dialer number font size
|
|
664
|
+
.keypad-number, .keypad-number::placeholder {
|
|
665
|
+
font-size: 20px;
|
|
666
|
+
}
|
|
667
|
+
`);
|
|
668
|
+
```
|
|
669
|
+
|
|
670
|
+
#### Override appearance
|
|
671
|
+
```js
|
|
672
|
+
Softphone.customizeAppearance({
|
|
673
|
+
// Theme, default values :
|
|
674
|
+
primary: '#203890',
|
|
675
|
+
button: '#292C87',
|
|
676
|
+
black: '#000',
|
|
677
|
+
white: '#fff',
|
|
678
|
+
greenButton: '#7ed865',
|
|
679
|
+
greenButtonHover: '#6ebf5a',
|
|
680
|
+
redButton: '#FA5846',
|
|
681
|
+
redButtonHover: '#FF604F',
|
|
682
|
+
buttonText: '#fff',
|
|
683
|
+
error: '#E80539',
|
|
684
|
+
secondary: '#203890',
|
|
685
|
+
grey: '#8A95A0',
|
|
686
|
+
secondGrey: '#eee',
|
|
687
|
+
headerColor: '#888',
|
|
688
|
+
avatar: '#bdbdbd',
|
|
689
|
+
divider: 'rgba(0, 0, 0, 0.12)',
|
|
690
|
+
placeholder: 'rgba(22, 44, 66, 0.5)',
|
|
691
|
+
hovered: '#6181F4',
|
|
692
|
+
}, {
|
|
693
|
+
// Translation
|
|
694
|
+
// Set `debug: true` to know where to change translations, eg:
|
|
695
|
+
en: {
|
|
696
|
+
user: {
|
|
697
|
+
login: 'My login button', // will be displayed as `user:login` in the button when settings `debug: true` in the init() method
|
|
698
|
+
},
|
|
699
|
+
},
|
|
700
|
+
}, {
|
|
701
|
+
// Assets
|
|
702
|
+
// logo: [url to your logo],
|
|
703
|
+
});
|
|
704
|
+
```
|
|
705
|
+
|
|
706
|
+
`onOptionsResults` is used to populate Autocomplete fields
|
|
707
|
+
|
|
650
708
|
#### Customizing card form
|
|
651
709
|
|
|
652
|
-
You can use [JSON schema](http://json-schema.org/) to customize the card form with `Softphone.setFormSchema(schema, uiSchema)
|
|
710
|
+
You can use [JSON schema](http://json-schema.org/) to customize the card form with `Softphone.setFormSchema(schema, uiSchema)`,
|
|
711
|
+
the Softphone uses [React Json schema form](https://react-jsonschema-form.readthedocs.io) internally to display card form :
|
|
653
712
|
|
|
654
713
|
```js
|
|
655
714
|
Softphone.setFormSchema({
|
|
@@ -714,6 +773,22 @@ Softphone.onCallIncoming = call => {
|
|
|
714
773
|
// You can make action here like redirecting to the contact page (by using `call.number).
|
|
715
774
|
};
|
|
716
775
|
|
|
776
|
+
Softphone.onCallLocallyAnswered = call => {
|
|
777
|
+
// Invoked when the user accepts the call locally
|
|
778
|
+
};
|
|
779
|
+
|
|
780
|
+
Softphone.onCallEstablished = call => {
|
|
781
|
+
// Invoked when the call is up
|
|
782
|
+
};
|
|
783
|
+
|
|
784
|
+
Softphone.onOutgoingCallMade = call => {
|
|
785
|
+
// Invoked when the user makes a call
|
|
786
|
+
};
|
|
787
|
+
|
|
788
|
+
Softphone.onCallRejected = call => {
|
|
789
|
+
// Invoked when the user rejects an incoming call
|
|
790
|
+
};
|
|
791
|
+
|
|
717
792
|
Softphone.onCallEnded = (call, card, direction) => {
|
|
718
793
|
// Invoked when the call is ended
|
|
719
794
|
};
|
|
@@ -722,10 +797,6 @@ Softphone.onCardSaved = card => {
|
|
|
722
797
|
// Invoked when the user save the card at the end of the call
|
|
723
798
|
};
|
|
724
799
|
|
|
725
|
-
Softphone.onCallMade = call => {
|
|
726
|
-
// Invoked when an outgoing call is made
|
|
727
|
-
};
|
|
728
|
-
|
|
729
800
|
Softphone.onSearchOptions = (fieldId: string, query: string) => {
|
|
730
801
|
// Invoked when the user is making a search from an Autocomplete field in the card form
|
|
731
802
|
// We need to call `onOptionsResults` here to send results to the softphone
|
|
@@ -744,7 +815,7 @@ Softphone.onAgentLoggedIn = () => {
|
|
|
744
815
|
// Invoked when the agent logs in
|
|
745
816
|
};
|
|
746
817
|
|
|
747
|
-
Softphone.onAgentLoggedOut = ) => {
|
|
818
|
+
Softphone.onAgentLoggedOut = () => {
|
|
748
819
|
// Invoked when the agent logs out
|
|
749
820
|
};
|
|
750
821
|
|
|
@@ -815,6 +886,10 @@ Softphone.onAuthenticated = session => {
|
|
|
815
886
|
Softphone.onLoggedOut = session => {
|
|
816
887
|
// Invoked when the user is is logged out in the softphone
|
|
817
888
|
};
|
|
889
|
+
|
|
890
|
+
Softphone.onIFrameLoaded = session => {
|
|
891
|
+
// Invoked when the iframe is loaded
|
|
892
|
+
};
|
|
818
893
|
```
|
|
819
894
|
|
|
820
895
|
## Advanced API
|