Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The Vonage Contact Center Javascript Engine is a special type of web service that accepts some JavaScript, run the script and returns the results. You can then write these results to Data Sources for use later in the call plan.

...

For example, a customer currently uses a Data an Announcer to announce a caller's postcode, which is stored in a Data Source, but wants to only announce the first three characters of the postcode. The customer can use the Vonage Contact Center Javascript Engine to run a JavaScript method that extracts the first three characters of the provided postcode.

...

Note
titleDouble quotes, tabs, or newline characters in Data Source value

The EscapeDoubleQuotes formatter reformats data source values. When using the Vonage Contact Center Javascript Engine, you can use the EscapeDoubleQuotes formatter to escape any double-quotes, tabs, or newline characters within data sources in your JavaScript methods. 

If the value of a data source contains a double quote ...

for example, a JSON object returned by an earlier call to a web service:
{ "type" : "postcode", "name" : "AB12 3CD" }

... you can add the EscapeDoubleQuotes suffix to the end of the data source name:

{ "script" : "x = '$(AddressDetail:EscapeDoubleQuotes)';" }

Adding the suffix escapes any double-quotes in the data source value. The reformatted value contains escaped double-quotes:

{ "script" : "x = { \\\"type\\\" : \\\"postcode\\\", \\\"name\\\" : \\\"AB12 3CD\\\" };" }

...