drachtio-srf 4.5.40 → 4.5.41

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/srf.js +4 -6
  2. package/package.json +1 -1
package/lib/srf.js CHANGED
@@ -10,6 +10,7 @@ const debug = require('debug')('drachtio:srf') ;
10
10
  const Socket = require('net').Socket;
11
11
  const noop = () => {};
12
12
  const idgen = require('short-uuid')();
13
+ const sdpTransform = require('sdp-transform');
13
14
 
14
15
  class DialogState {}
15
16
  class DialogDirection {}
@@ -560,12 +561,9 @@ class Srf extends Emitter {
560
561
  res
561
562
  });
562
563
  }
563
- let bhSdp = res.body.replace(/c=IN\s+IP4\s+(\d+\.\d+\.\d+\.\d+)/, (match, p1) => {
564
- return 'c=IN IP4 0.0.0.0' ;
565
- }) ;
566
- bhSdp = bhSdp.replace(/(o=[a-zA-Z0-9]+\s+\d+\s+\d+\s+IN\s+IP4\s+)(\d+\.\d+\.\d+\.\d+)/,
567
- (match, p1) => { return p1 + '0.0.0.0' ;}
568
- ) ;
564
+ const parsed = sdpTransform.parse(res.body);
565
+ parsed.direction = 'recvonly';
566
+ const bhSdp = sdpTransform.write(parsed);
569
567
  ack({
570
568
  body: bhSdp
571
569
  }) ;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drachtio-srf",
3
- "version": "4.5.40",
3
+ "version": "4.5.41",
4
4
  "description": "drachtio signaling resource framework",
5
5
  "main": "lib/srf.js",
6
6
  "types": "lib/@types/index.d.ts",