@jambonz/mrf 0.1.6 → 0.1.7
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/mediaserver.js +2 -8
- package/package.json +1 -1
package/lib/mediaserver.js
CHANGED
|
@@ -136,9 +136,7 @@ class MediaServer extends EventEmitter {
|
|
|
136
136
|
const data = {};
|
|
137
137
|
if (opts.remoteSdp) data.remoteSdp = opts.remoteSdp;
|
|
138
138
|
if (opts.codecs) data.codecs = Array.isArray(opts.codecs) ? opts.codecs : [opts.codecs];
|
|
139
|
-
|
|
140
|
-
* connectCaller marks inbound; everything else defaults outbound */
|
|
141
|
-
data.tags = { direction: 'outbound', ...(opts.tags || {}) };
|
|
139
|
+
if (opts.tags) data.tags = opts.tags;
|
|
142
140
|
const options = {};
|
|
143
141
|
if (opts.media_timeout) options.mediaTimeoutMs = parseInt(opts.media_timeout, 10);
|
|
144
142
|
if (opts.media_hold_timeout) options.holdTimeoutMs = parseInt(opts.media_hold_timeout, 10);
|
|
@@ -156,11 +154,7 @@ class MediaServer extends EventEmitter {
|
|
|
156
154
|
* it. Works with drachtio req/res objects (duck-typed).
|
|
157
155
|
*/
|
|
158
156
|
async connectCaller(req, res, opts = {}) {
|
|
159
|
-
const endpoint = await this.createEndpoint({
|
|
160
|
-
...opts,
|
|
161
|
-
remoteSdp: req.body,
|
|
162
|
-
tags: { direction: 'inbound', ...(opts.tags || {}) }
|
|
163
|
-
});
|
|
157
|
+
const endpoint = await this.createEndpoint({ ...opts, remoteSdp: req.body });
|
|
164
158
|
const dialog = await res.send(200, { body: endpoint.local.sdp });
|
|
165
159
|
return { endpoint, dialog };
|
|
166
160
|
}
|