@jambonz/mrf 0.1.4 → 0.1.5
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/endpoint.js +11 -1
- package/package.json +1 -1
package/lib/endpoint.js
CHANGED
|
@@ -541,13 +541,23 @@ class Endpoint extends EventEmitter {
|
|
|
541
541
|
*/
|
|
542
542
|
function ttsVars(tts) {
|
|
543
543
|
if (!tts) return {};
|
|
544
|
-
|
|
544
|
+
const out = {
|
|
545
545
|
...(tts.playbackId && {variable_tts_playback_id: tts.playbackId}),
|
|
546
546
|
...(tts.ttfbMs !== undefined && {variable_tts_time_to_first_byte_ms: String(tts.ttfbMs)}),
|
|
547
547
|
...(tts.cacheFilename && {variable_tts_cache_filename: tts.cacheFilename}),
|
|
548
548
|
...(tts.error && {variable_tts_error: tts.error}),
|
|
549
549
|
...(tts.responseCode !== undefined && {variable_tts_response_code: String(tts.responseCode)}),
|
|
550
550
|
};
|
|
551
|
+
/* vendor dial/response metadata (request id, connect timings, voice):
|
|
552
|
+
* FS modules exposed these as tts_<vendor>_<field> channel variables
|
|
553
|
+
* and the feature-server turns every variable_tts_* into an otel span
|
|
554
|
+
* attribute */
|
|
555
|
+
if (tts.vendor && tts.info) {
|
|
556
|
+
for (const [k, v] of Object.entries(tts.info)) {
|
|
557
|
+
out[`variable_tts_${tts.vendor}_${k}`] = String(v);
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
return out;
|
|
551
561
|
}
|
|
552
562
|
|
|
553
563
|
module.exports = Endpoint;
|