@babblevoice/babble-drachtio-callmanager 2.3.17 → 2.3.19

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.
Files changed (2) hide show
  1. package/lib/call.js +15 -40
  2. package/package.json +1 -1
package/lib/call.js CHANGED
@@ -1841,47 +1841,28 @@ class call {
1841
1841
  } )
1842
1842
  }
1843
1843
 
1844
- /**
1845
- *
1846
- * @param { object } other
1847
- * @returns { object }
1848
- */
1849
- swapchannel( other ){
1850
-
1851
- const this_audio = this.channels.audio
1852
- const this_sdp = this.sdp.local
1853
- const this_chem = this.channels.audio.em
1854
- const other_chem = other.channels.audio.em
1855
-
1856
- this.channels.audio = other.channels.audio
1857
- this.channels.audio.em = this_chem
1858
- this.sdp.local = other.sdp.local
1859
-
1860
- other.channels.audio = this_audio
1861
- other.channels.audio.em = other_chem
1862
- other.sdp.local = this_sdp
1863
-
1864
- /* reinvite will pick up on this */
1865
- const selectedcodec = other.selectedcodec
1866
- other.selectedcodec = this.selectedcodec
1867
- this.selectedcodec = selectedcodec
1868
- return this
1869
- }
1870
-
1871
1844
  /**
1872
1845
  Send out modified SDP to get the audio to the new location.
1846
+ This method might be use, but there are problems - so when it is used
1847
+ it can be re-written but should use a mthod to create a codec - which is the
1848
+ same as used elsewhere.
1873
1849
  @private
1874
1850
  */
1875
1851
  async reinvite() {
1876
1852
 
1877
- this.sdp.local
1878
- .clearcodecs()
1879
- .addcodecs( this.selectedcodec )
1880
- .select( this.selectedcodec )
1881
- .setaudiodirection( "sendrecv" )
1853
+ this.sdp.local = sdpgen.create().addcodecs( this.selectedcodec )
1854
+ this.sdp.local.setaudioport( this.channels.audio.local.port )
1855
+ .setconnectionaddress( this.channels.audio.local.address )
1882
1856
 
1883
- if( true === callmanager.options.rfc2833 ) {
1884
- this.sdp.local.addcodecs( "2833" )
1857
+ this.#checkandadd2833()
1858
+
1859
+ /* DTLS is only supported ( outbound ) on websocket connections */
1860
+ if( this._iswebrtc ) {
1861
+ this.sdp.local
1862
+ .addssrc( this.channels.audio.local.ssrc )
1863
+ .secure( this.channels.audio.local.dtls.fingerprint ,"passive" )
1864
+ .addicecandidates( this.channels.audio.local.address, this.channels.audio.local.port, this.channels.audio.local.icepwd )
1865
+ .rtcpmux()
1885
1866
  }
1886
1867
 
1887
1868
  const remotesdp = await this._dialog.modify( this.sdp.local.toString() )
@@ -2237,8 +2218,6 @@ class call {
2237
2218
  c_1.waitforanyevent( { "action": "mix", "event": "finished" }, 0.5 ),
2238
2219
  ] )
2239
2220
 
2240
- a_1.swapchannel( b_2 )
2241
-
2242
2221
  await new Promise( ( resolve ) => {
2243
2222
  res.send( 202, "Refering", {}, ( /* err, response */ ) => {
2244
2223
  resolve()
@@ -2254,10 +2233,6 @@ class call {
2254
2233
  return
2255
2234
  }
2256
2235
 
2257
- /* modify ports and renegotiate codecs */
2258
- await a_1.reinvite()
2259
-
2260
- /* there might be situations where mix is not the correct thing - perhaps a pop push application? */
2261
2236
  /* Link logically and mix */
2262
2237
  a_1.adopt( c_1, true )
2263
2238
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@babblevoice/babble-drachtio-callmanager",
3
- "version": "2.3.17",
3
+ "version": "2.3.19",
4
4
  "description": "Call processing to create a PBX",
5
5
  "main": "index.js",
6
6
  "scripts": {