Skip to content

Commit

Permalink
feat(SIP): use signaling control messages to update the phones store
Browse files Browse the repository at this point in the history
Signed-off-by: DorraJaouad <dorra.jaoued7@gmail.com>
  • Loading branch information
DorraJaouad committed Oct 30, 2023
1 parent 6df3263 commit da70642
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/store/participantsStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -962,6 +962,15 @@ const actions = {
}
},

addPhonesStates(context, { phoneStates }) {
Object.values(phoneStates).forEach(phoneState => {
context.commit('setPhoneState', {
callid: phoneState.callid,
value: phoneState
})
})
},

deletePhoneState(context, { callid }) {
context.commit('deletePhoneState', callid)
},
Expand Down
4 changes: 3 additions & 1 deletion src/utils/signaling.js
Original file line number Diff line number Diff line change
Expand Up @@ -1324,7 +1324,9 @@ Signaling.Standalone.prototype.processTransientEvent = function(data) {
// ignore event
break
case 'initial':
// ignore event
if (data.transient.data) {
store.dispatch('addPhonesStates', { phoneStates: data.transient.data })
}
break
default:
console.error('Unsupported event type', data)
Expand Down

0 comments on commit da70642

Please sign in to comment.