Channel Switch
  • 19 Jul 2024
  • 1 Minute to read
  • Contributors
  • PDF

Channel Switch

  • PDF

Article summary

Redirects channels depending on the provided labels in the request.

Parameters:

name
description
default
ChannelTagsList of tags for each channel. Each line in this list shows the tags of a single channel. Each line can contain one or more tags, if there are mode than one tag for a channel they should be separated by commas. Comma ( , ) and semicolon ( ; ) characters are forbidden in tags since they are commonly used as separators.

Inputs

Audio:
All

Events:
All

Outputs

Audio:
All

Events:
All

Supported flow types: stream, batch

Remarks:

Example Project
We use Channel Switch to differentiate services between separate channels. Let's explain the usage of tags with an example. The following image is from an actual project. This project, among other things, detects the emotions of agent audio and also determines the customer's sentiments from its recognized text.

Figure 1:
image.png

***Tagging channels*** The designer of this Dataflow project has labeled each channel with appropriate tags. The tags are specified from the ChannelSwitch node settings dialog in the following manner:

Figure 2:
image.png

In this example : - channel 0 is labeled as "agent". - channel 1 is labeled as both "customer" and "incoming".

Using Tags
The user of this project should provide tag(s) for each channel in the start message. The related part in the start message would look like the following:

{
"Settings":
{ 
 "ChannelTags":[    
   "customer",
   "agent"
 ]
},
...
}

With this start message the user is declaring that any stereo audio file should be treated the following way:

  • the first channel (channel 0) is the "customer"
  • the second channel (channel 1) is the "agent"

This project is designed to serve the "agent" with the the topmost channel of Channel Switch output (see Figure-1 and Figure-2). So

  • channel-0 (top audio&event outputs of Entry node) will continue its flow as ChannelSwitch's bottom output.
  • channel-1 (bottom audio&event outputs of Entry node) will continue its flow as ChannelSwitch's top output.

Note : Tags are just plain strings, using appropriate strings for tags is the designer's responsibility.
Note 2 : For http POST requests, start message is provided in the multiform/data "parameters" part. An example postman request would look like this:

Figure 3:
image.png


Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.