@babblevoice/babble-drachtio-callmanager 2.3.6 → 2.3.8
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 +4 -3
- package/lib/callmanager.js +6 -1
- package/package.json +1 -1
package/lib/call.js
CHANGED
|
@@ -1206,6 +1206,8 @@ class call {
|
|
|
1206
1206
|
this._req = req
|
|
1207
1207
|
this._res = res
|
|
1208
1208
|
|
|
1209
|
+
req.on( "cancel", ( req ) => this._oncanceled( req ) )
|
|
1210
|
+
|
|
1209
1211
|
if( !this._auth.has( this._req ) ) return false
|
|
1210
1212
|
|
|
1211
1213
|
const authorization = this._auth.parseauthheaders( this._req )
|
|
@@ -1273,7 +1275,7 @@ class call {
|
|
|
1273
1275
|
this.canceled = true
|
|
1274
1276
|
|
|
1275
1277
|
for( const child of this.children ) {
|
|
1276
|
-
child.hangup()
|
|
1278
|
+
child.hangup( hangupcodes.ORIGINATOR_CANCEL )
|
|
1277
1279
|
}
|
|
1278
1280
|
|
|
1279
1281
|
this._onhangup( "wire", hangupcodes.ORIGINATOR_CANCEL )
|
|
@@ -2988,6 +2990,7 @@ class call {
|
|
|
2988
2990
|
@private
|
|
2989
2991
|
*/
|
|
2990
2992
|
c._req = req
|
|
2993
|
+
c._req.on( "cancel", ( req ) => c._oncanceled( req ) )
|
|
2991
2994
|
|
|
2992
2995
|
/**
|
|
2993
2996
|
@member
|
|
@@ -2997,8 +3000,6 @@ class call {
|
|
|
2997
3000
|
|
|
2998
3001
|
c.parseallow( req )
|
|
2999
3002
|
|
|
3000
|
-
c._req.on( "cancel", () => c._oncanceled.bind( c ) )
|
|
3001
|
-
|
|
3002
3003
|
await callstore.set( c )
|
|
3003
3004
|
callmanager.options.em.emit( "call.new", c )
|
|
3004
3005
|
|
package/lib/callmanager.js
CHANGED
|
@@ -50,7 +50,12 @@ class callmanager {
|
|
|
50
50
|
let c = await callstore.getbycallid( calldesc )
|
|
51
51
|
if( c ) return c._onauth( req, res )
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
try {
|
|
54
|
+
c = await call.frominvite( req, res )
|
|
55
|
+
} catch( e ) {
|
|
56
|
+
console.error( e )
|
|
57
|
+
}
|
|
58
|
+
|
|
54
59
|
|
|
55
60
|
if( false !== this.onnewcall ) {
|
|
56
61
|
try {
|