@voicenter-team/vsip
v1.1.63
Published
A vue based jssip wrapper.
Downloads
175
Readme
vsip
A vue based jssip wrapper.
Installation
Using npm:
$ npm i -g npm
$ npm i @voicenter-team/vsip
Usage
Firstly use the lib:
import VueJsSIP from '@voicenter-team/vsip';
Vue.use(VueJsSIP, {
store // Vuex store
});
This lib will be injected to your Vex as a vsip
module.
To init library call init
action with the following options:
const options = {
configuration: {
session_timers: Boolean,
uri: String,
password: String,
},
socketInterfaces: [String],
sipDomain: String,
sipOptions: {
session_timers: Boolean,
extraHeaders: [String],
pcConfig: {}
}
}
Then you will be able to use getters and call actions.
Actions
async setMediaDevices()
- will set up media devicesasync setMicrophone(deviceId: Number)
- set passed device as input for callsasync setSpeaker(deviceId: Number)
- set passed device as output for callsasync setCurrentActiveRoom(roomId: Number)
- move to the roomdoCallHold({callId: Number, toHold: Boolean})
- hold/unhold call by iddoCall(target: String)
- call to the targetcallTerminate(callId: Number)
- terminate callcallTransfer({callId: Number, target: String})
- transfer call to targetcallMerge(roomId: Number)
- merge calls in specific roomcallAnswer(callId: Number)
- answer the callsetMetricConfig(config: Object)
- set the metric config (used for audio quality indicator)doMute(muted: Boolean)
- set the agent mutenesssetDND(value: Boolean)
- set the agent "Do not disturb" statusasync callChangeRoom({callId: Number, roomId: Number})
- move call to the roomcallMove({callId: Number, roomId: Number})
- Same as callChangeRoom. Move call to the specific roomsubscribe({type: String, listener: function})
- subscribe to an event. Available events:new_call
,ended
,progress
,failed
,confirmed
removeListener(type: String)
- remove event listenerinit({configuration: Object, socketInterfaces: String[], listeners: Array, sipDomain: String, sipOptions: Object})
- init the lib
Getters
getActiveRooms: []
- returns a list of active roomsgetSipDomain: String
- returns sip domaingetSiOptions: Object
- returns sip optionsgetInputDeviceList: []
- returns list of input devicesgetOutputDeviceList: []
- returns list of output devicesgetCurrentActiveRoomId: Number
- returns current active room idgetSelectedInputDevice: Number
- returns current selected input devicegetSelectedOutputDevice: Number
- returns current selected output deviceisDND: Boolean
- returns if the agent is in "Do not disturb" statusisMuted: Boolean
- returns if the agent is mutedmetricConfig: Object
- returns metric config (used for audio quality indicator)