@subiz/wsclient 4.0.2 → 4.0.3
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/package.json +1 -1
- package/webrtc.js +10 -10
package/package.json
CHANGED
package/webrtc.js
CHANGED
|
@@ -150,21 +150,22 @@ function WebRTCConn(options) {
|
|
|
150
150
|
}
|
|
151
151
|
})
|
|
152
152
|
|
|
153
|
-
Object.keys(calls
|
|
153
|
+
Object.keys(calls).map((callid) => {
|
|
154
154
|
let call = calls[callid]
|
|
155
|
-
if (endRequest[callid]
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
}
|
|
155
|
+
if (!endRequest[callid]) return
|
|
156
|
+
if (!call || call.status == 'ended') return
|
|
157
|
+
calls[callid] = Object.assign({}, call, {
|
|
158
|
+
call_id: callid,
|
|
159
|
+
ended: endRequest[callid],
|
|
160
|
+
status: 'ended',
|
|
161
|
+
hangup_code: 'cancel',
|
|
162
|
+
})
|
|
163
163
|
})
|
|
164
164
|
return calls
|
|
165
165
|
}
|
|
166
166
|
|
|
167
167
|
let call = activeCalls[callid]
|
|
168
|
+
if (!call && dialingRequest[callid]) call = dialingRequest[callid]
|
|
168
169
|
if (endRequest[callid] && call && call.status != 'ended') {
|
|
169
170
|
return Object.assign({}, call, {
|
|
170
171
|
call_id: callid,
|
|
@@ -173,7 +174,6 @@ function WebRTCConn(options) {
|
|
|
173
174
|
hangup_code: 'cancel',
|
|
174
175
|
})
|
|
175
176
|
}
|
|
176
|
-
if (!call && dialingRequest[callid]) return dialingRequest[callid]
|
|
177
177
|
return call
|
|
178
178
|
}
|
|
179
179
|
|