@babblevoice/babble-drachtio-callmanager 1.3.1 → 1.3.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/lib/call.js +6 -4
- package/package.json +1 -1
- package/test/interface/call.js +2 -2
package/lib/call.js
CHANGED
|
@@ -317,13 +317,15 @@ class call {
|
|
|
317
317
|
}
|
|
318
318
|
|
|
319
319
|
let entitycalls = await callstore.getbyentity( this._entity.uri )
|
|
320
|
+
let entitycallcount = 0
|
|
321
|
+
if( false !== entitycalls ) entitycallcount = entitycalls.size
|
|
320
322
|
|
|
321
323
|
return {
|
|
322
324
|
"username": this._entity.username,
|
|
323
325
|
"realm": this._entity.realm,
|
|
324
326
|
"uri": this._entity.uri,
|
|
325
327
|
"display": this._entity.display?this._entity.display:"",
|
|
326
|
-
"ccc":
|
|
328
|
+
"ccc": entitycallcount
|
|
327
329
|
}
|
|
328
330
|
} )()
|
|
329
331
|
}
|
|
@@ -1957,13 +1959,13 @@ class call {
|
|
|
1957
1959
|
/* Call outstanding resolves for promises - this will trigger out hangup promise also */
|
|
1958
1960
|
resolves.forEach( r => r( this ) )
|
|
1959
1961
|
|
|
1960
|
-
this.removealllisteners()
|
|
1961
|
-
|
|
1962
1962
|
this._em.emit( "call.destroyed", this )
|
|
1963
1963
|
callmanager.options.em.emit( "call.destroyed", this )
|
|
1964
1964
|
|
|
1965
1965
|
this._em.emit( "call.reporting", this )
|
|
1966
1966
|
callmanager.options.em.emit( "call.reporting", this )
|
|
1967
|
+
|
|
1968
|
+
this.removealllisteners()
|
|
1967
1969
|
}
|
|
1968
1970
|
|
|
1969
1971
|
/**
|
|
@@ -2216,7 +2218,7 @@ class call {
|
|
|
2216
2218
|
}
|
|
2217
2219
|
|
|
2218
2220
|
let cs = await callstore.getbyentity( options.entity.uri )
|
|
2219
|
-
if( cs.size >= options.entity.max ) {
|
|
2221
|
+
if( cs && cs.size >= options.entity.max ) {
|
|
2220
2222
|
return false
|
|
2221
2223
|
}
|
|
2222
2224
|
}
|
package/package.json
CHANGED
package/test/interface/call.js
CHANGED
|
@@ -554,9 +554,9 @@ describe( "call object", function() {
|
|
|
554
554
|
eventhappened = true
|
|
555
555
|
} )
|
|
556
556
|
|
|
557
|
-
await c.hangup()
|
|
558
|
-
|
|
559
557
|
expect( eventhappened ).to.be.false
|
|
558
|
+
await c.hangup()
|
|
559
|
+
expect( eventhappened ).to.be.true
|
|
560
560
|
} )
|
|
561
561
|
|
|
562
562
|
it( `uas.newuac - answered and destroyed event`, async function() {
|