Here is a list of variables you can use in the webhook system.

variables are referenced by wrapping them in double braces like {{var}}.

inboundconnected - true / false - whether the inbound leg is connected
outboundconnected - true / false - whether the outbound leg is connected
cli - string - the CLI presented on the inbound leg (unformatted)
ddi - string - the wanted number presented on the inbound leg (unformatted)
translatedcli - string - the CLI after translation by the data warehouse
inboundduration - int - the current duration of the inbound leg ( connected)
outboundduration - int - the current duration of the outbound leg (connected)
outboundattempts - int - the number of different attempts made so far dialling out on the outbound leg
preferredcallername / preferredcallernumber - overrides the Display Name and CLI for any future outgoing call to either a trunk or PBX extension.
ivrdigit -  override the last recorded IVR Digit
ivrdigitbuffer - replace the whole collected digit buffer.

You can format durations in seconds into HH:MM:SS with secondsToHHMMSS(duration) e.g. secondsToHHMMSS({{inboundConnectedDuration}})

You can format a number into a national format with formatNumber(number,format) e.g. formatNumber({{cli}},UK)

You can look up a number in the PBX phonebook with pbxPhonebookLookup(number,pbxId,defaultValue) e.g. pbxPhonebookLookup({{cli}},100007,formatNumber({{cli}},UK))

You can process variables nested, so for example setting xCallerName to something and xCompanyName to something else you can then have servar:preferredCallerName={{xCallerName}} - {{xCompanyName}}

You can also create your own variables based upon results you obtain from your webhook queries.