@@ -25,7 +25,12 @@ const channelmap = {
2525 "play" : ( chan , msg ) => chan . play ( msg . soup ) ,
2626 "record" : ( chan , msg ) => chan . record ( msg . options ) ,
2727 "playrecord" : ( chan , msg ) => chan . playrecord ( msg . options ) ,
28- "direction" : ( chan , msg ) => chan . direction ( msg . options )
28+ "direction" : ( chan , msg ) => chan . direction ( msg . options ) ,
29+ /* "transcribe" carries no channel action of its own - it is consumed by the
30+ node's pre hook (the consumer registers a token->channel binding and taps
31+ audio itself via getchannel() + createReadStream). Registered here as a
32+ no-op so the framework acknowledges it rather than replying "Unknown method". */
33+ "transcribe" : ( ) => { }
2934}
3035
3136/**
@@ -313,6 +318,18 @@ class rtpnode {
313318 this . _post = this . _defaulthandler . bind ( this )
314319 }
315320
321+ /**
322+ * @summary Look up a live channel object by its uuid.
323+ * Channels are created by the node when the server sends an "open" command
324+ * and stored in the module-level map. This exposes them to pre/post hooks
325+ * (e.g. to tap audio with channel.createReadStream for live transcription).
326+ * @param { string } uuid - our channel uuid
327+ * @returns { object | undefined } the channel object, or undefined if unknown
328+ */
329+ getchannel ( uuid ) {
330+ return channels . get ( uuid )
331+ }
332+
316333 /**
317334 * @summary Connect to a server.
318335 * @param {string } host
0 commit comments