@babblevoice/babble-drachtio-callmanager 1.6.9 → 1.6.10
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 +7 -36
- package/package.json +1 -1
- package/test/interface/early.js +1 -1
- package/test/interface/xfer.js +3 -0
package/lib/call.js
CHANGED
|
@@ -1019,36 +1019,9 @@ class call {
|
|
|
1019
1019
|
|
|
1020
1020
|
this.sdp.remote = sdpgen.create( this._req.msg.body )
|
|
1021
1021
|
|
|
1022
|
-
|
|
1023
|
-
if( this.
|
|
1024
|
-
|
|
1025
|
-
alegremotesdp = this.parent.sdp.remote
|
|
1026
|
-
} else {
|
|
1027
|
-
alegremotesdp = sdpgen.create( this.parent._req.msg.body )
|
|
1028
|
-
}
|
|
1029
|
-
let alegpossiblecodecs = alegremotesdp.intersection( this.options.preferedcodecs )
|
|
1030
|
-
if( !alegpossiblecodecs ) alegpossiblecodecs = alegremotesdp.intersection( callmanager.options.preferedcodecs )
|
|
1031
|
-
if( !alegpossiblecodecs ) {
|
|
1032
|
-
return this.hangup( hangupcodes.INCOMPATIBLE_DESTINATION )
|
|
1033
|
-
}
|
|
1034
|
-
|
|
1035
|
-
this.selectedcodec = this.sdp.remote.intersection( alegpossiblecodecs, true )
|
|
1036
|
-
/* if this doesn't work - then we will have to transcode if we can find a codec which works */
|
|
1037
|
-
if( this.selectedcodec ) {
|
|
1038
|
-
this.parent.selectedcodec = this.selectedcodec
|
|
1039
|
-
} else {
|
|
1040
|
-
this.selectedcodec = this.sdp.remote.intersection( this.options.preferedcodecs, true )
|
|
1041
|
-
if( !this.selectedcodec ) this.selectedcodec = this.sdp.remote.intersection( callmanager.options.preferedcodecs )
|
|
1042
|
-
if( !this.selectedcodec ) {
|
|
1043
|
-
return this.hangup( hangupcodes.INCOMPATIBLE_DESTINATION )
|
|
1044
|
-
}
|
|
1045
|
-
}
|
|
1046
|
-
} else {
|
|
1047
|
-
/* no parent - just pick our prefered codec */
|
|
1048
|
-
this.selectedcodec = this.sdp.remote.intersection( this.options.preferedcodecs, true )
|
|
1049
|
-
if( !this.selectedcodec ) {
|
|
1050
|
-
return this.hangup( hangupcodes.INCOMPATIBLE_DESTINATION )
|
|
1051
|
-
}
|
|
1022
|
+
this.selectedcodec = this.sdp.remote.intersection( this.options.preferedcodecs, true )
|
|
1023
|
+
if( !this.selectedcodec ) {
|
|
1024
|
+
return this.hangup( hangupcodes.INCOMPATIBLE_DESTINATION )
|
|
1052
1025
|
}
|
|
1053
1026
|
|
|
1054
1027
|
let target = this.sdp.remote.getaudio()
|
|
@@ -1433,13 +1406,11 @@ class call {
|
|
|
1433
1406
|
|
|
1434
1407
|
if( this.canceled || this.established ) return
|
|
1435
1408
|
|
|
1436
|
-
options = { ...callmanager.options, ...this.options, ...options }
|
|
1409
|
+
this.options = { ...callmanager.options, ...this.options, ...options }
|
|
1437
1410
|
|
|
1438
1411
|
let channeldef
|
|
1439
1412
|
if( this._req.msg && this._req.msg.body ) {
|
|
1440
|
-
|
|
1441
|
-
this.selectedcodec = this.sdp.remote.intersection( options.preferedcodecs, true )
|
|
1442
|
-
if( !this.selectedcodec ) this.selectedcodec = this.sdp.remote.intersection( callmanager.options.preferedcodecs, true )
|
|
1413
|
+
this.selectedcodec = this.sdp.remote.intersection( this.options.preferedcodecs, true )
|
|
1443
1414
|
if( !this.selectedcodec ) {
|
|
1444
1415
|
return this.hangup( hangupcodes.INCOMPATIBLE_DESTINATION )
|
|
1445
1416
|
}
|
|
@@ -1476,7 +1447,7 @@ class call {
|
|
|
1476
1447
|
.setconnectionaddress( ch.local.address )
|
|
1477
1448
|
.setaudioport( ch.local.port )
|
|
1478
1449
|
|
|
1479
|
-
if(
|
|
1450
|
+
if( this.options.rfc2833 ) {
|
|
1480
1451
|
this.sdp.local.addcodecs( "2833" )
|
|
1481
1452
|
}
|
|
1482
1453
|
|
|
@@ -1490,7 +1461,7 @@ class call {
|
|
|
1490
1461
|
if( this.canceled ) return
|
|
1491
1462
|
}
|
|
1492
1463
|
|
|
1493
|
-
if( options.early ) {
|
|
1464
|
+
if( this.options.early ) {
|
|
1494
1465
|
this.state.early = true
|
|
1495
1466
|
this._em.emit( "call.early", this )
|
|
1496
1467
|
callmanager.options.em.emit( "call.early", this )
|
package/package.json
CHANGED
package/test/interface/early.js
CHANGED
|
@@ -448,8 +448,8 @@ a=sendrecv`.replace(/(\r\n|\n|\r)/gm, "\r\n")
|
|
|
448
448
|
expect( channelmessages[ 2 ].remote.address ).to.equal( "82.19.206.102" )
|
|
449
449
|
expect( channelmessages[ 3 ].channel ).to.equal( "mix" )
|
|
450
450
|
|
|
451
|
+
expect( channelmessages[ 6 ].channel ).to.equal( "close" )
|
|
451
452
|
expect( channelmessages[ 7 ].channel ).to.equal( "close" )
|
|
452
|
-
expect( channelmessages[ 8 ].channel ).to.equal( "close" )
|
|
453
453
|
|
|
454
454
|
expect( msginfo.body ).to.include( "UDP/TLS/RTP/SAVPF" )
|
|
455
455
|
|
package/test/interface/xfer.js
CHANGED