Versions Compared

Key

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



Html
<div id="fb-root"></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = 'https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.11';
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

...

Html
<div class="fb-like" data-href="#https://confluence.wildix.com/x/PQIkBg" data-layout="button_count" data-action="recommend" data-size="large" data-show-faces="true" data-share="true"></div>

...

Info

This guide explains how to handle JSON documents inside Wildix Dialplan.

Created: November 2021

Permalink: https://confluence.wildix.com/x/PQIkBg


Table of Contents

Starting from WMS Beta 5.04, res_json is integrated into the system. It is a wrapper module around a JSON library that allows you to handle JSON documents inside Wildix Dialplan and send requests to external software (e.g. CRM systems).

List of supported apps and functions


App/ function 

Description

JSONELEMENT(doc,path)

(r/o function) gets the value of an element at a given path in a JSON document

jsonvariables(doc)

(app) reads a single level JSON document (dictionary) into Dialplan variables

jsonadd(doc,path,elemtype,name,value)

(app) adds an element to the JSON document at the given path

jsonset(doc,path,newvalue)

(app) changes the value of an element in the JSON document

jsondelete(doc,path)

(app) deletes an element in the JSON document

JSONPRETTY(doc)

(r/o function) formats a JSON document for nice printing

JSONCOMPRESS(doc)

(r/o function) formats a JSON document for minimum footprint


Parameters:

  • doc: the name of the variable that contains the JSON document

    Note

    Note: All the functions and apps require the name of a Dialplan variable that contains the JSON document, instead of the parseable string itself. 


  • path: path to the element you are looking for (like /path/to/element, or /path/to/element/3 to identify the element with index 3 in an array)
  • elemtype: element type, one of bool, null, number, string, node or array
  • name: the name of the element to be added (may be missing if adding elements to an array)
  • value: value to be set for the element we added
  • newvalue: value to be set

...