Recording Archive Format
Tuesday, September 1, 2020 10:32 AM

Archive is is just a folder with single monitor subfolder.

Call files

Every archived call recording represented by one or two files:


  • xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.wav — the call recording. This file is absent if a call does not have associated audio recording.
  • xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.json — the call metadata. This file is always present.


File names are string representation of call guid in the FocalScope database. You can see the guid in 'Recording ID' column of the 'Dial Log' call properties.


Shape

There are two shapes of the archive folder.

ymdutc

It is default shape. Calls are placed into per-day folders with name in form of YYYY-UTC/MM/DD, where YYYY - year, MM - month (01-12), DD - day (01-31) of UTC date of the call.


archive_folder/
  monitor/
    2019-UTC/ # year folder 
      01/ # month folder
        ...
        12/ # day folder 
          xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.wav
          xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.json
          ...


If you try to remove/copy folder inside the archive please remember - the date here is the UTC date not the local date.

For example if you want to backup data for 2018 year - include folders  <archive root>/monitor/2017-UTC/21/31 and <archive root>/monitor/2019-UTC/01/01 in the backup as well. Indeed you need either previous or next date depending of timezone, but it is easier to include both.

plain

It is old, outdated shape. All files are lumped into the single folder


archive_folder/
  monitor/
    xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.wav
    xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.json
    ...


JSON call metadata dictionary


This is a sample of a content of xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.json file


{
/* identification fields */
  "nId": 53709, /*integer, internal database id */
  "usId": "abfdc548-c88f-4061-80f9-aa2152a302e7", /*string, guid */
  "sUniqueId": "1468393037.671281", /* string, call id from asterisk */

/* PBX fields */
  "nIdAsterisk": 1, /* integer, internal id of FSVM machine */
  "usIdAsterisk": "SG", /* string, unique string of FSVM machine, same as in conf/pbx.xml */
  "sLocation": "Singapore", /* string */

/* date fields */
  "dtEvent": 1468393037000, /* integer, time when call started in milliseconds from unix epoch like in javascript */
  "nDur": 17000, /* integer, call duration in milliseconds */

/* classification fields */
  "sCallType": "Outgoing", /* string enum, one of Incoming, Outgoing, Internal, Login, API or Conference */
  "fVoicemail": false,

/* From fields */
  "sExten": "sg40", /* for outgoing calls, for ingoing - null */
  "sAgentOrig": "John Smith", /* for outgoing calls, for ingoing - null */
  "sCustomer": null, /* for incoming calls when possible to detect customer number or name */

/* To fields */
  "sNumber": "84242424242",
  "sAgentResp": null, /* for incoming calls */
  "sGroup": null, /* for incoming calls */
  "sPickupNumber": null /* form incoming calls */
}