{
  "__inputs": [
    {
      "name": "DS_XCALLY",
      "label": "XCALLY",
      "description": "",
      "type": "datasource",
      "pluginId": "mysql",
      "pluginName": "MySQL"
    }
  ],
  "__requires": [
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "5.2.2"
    },
    {
      "type": "panel",
      "id": "graph",
      "name": "Graph",
      "version": "5.0.0"
    },
    {
      "type": "datasource",
      "id": "mysql",
      "name": "MySQL",
      "version": "5.0.0"
    },
    {
      "type": "panel",
      "id": "singlestat",
      "name": "Singlestat",
      "version": "5.0.0"
    },
    {
      "type": "panel",
      "id": "text",
      "name": "Text",
      "version": "5.0.0"
    }
  ],
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "description": "",
  "editable": true,
  "gnetId": 4443,
  "graphTooltip": 0,
  "id": null,
  "links": [
    {
      "icon": "external link",
      "tags": [
        "xCALLY"
      ],
      "type": "dashboards"
    },
    {
      "icon": "external link",
      "tags": [],
      "title": "xCALLY Official Site",
      "type": "link",
      "url": "http://www.xcally.com"
    }
  ],
  "panels": [
    {
      "content": "<img src=\"http://www.xenialab.it/meo/web/white/images/xcally.jpg\" alt=\"xCALLY logo\">",
      "gridPos": {
        "h": 4,
        "w": 2,
        "x": 0,
        "y": 0
      },
      "id": 14,
      "links": [],
      "mode": "html",
      "title": "",
      "transparent": true,
      "type": "text"
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": false,
      "colors": [
        "#d44a3a",
        "rgba(237, 129, 40, 0.89)",
        "#299c46"
      ],
      "datasource": "${DS_XCALLY}",
      "format": "none",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": true,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 4,
        "w": 5,
        "x": 2,
        "y": 0
      },
      "id": 9,
      "interval": null,
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "postfix": "",
      "postfixFontSize": "50%",
      "prefix": "",
      "prefixFontSize": "50%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "rgba(31, 118, 189, 0.18)",
        "full": false,
        "lineColor": "rgb(31, 120, 193)",
        "show": true
      },
      "tableColumn": "",
      "targets": [
        {
          "alias": "",
          "format": "time_series",
          "hide": false,
          "rawSql": "SELECT \n  $__timeGroup(calldate,'24h') as time,\n  sum(if(disposition='ANSWERED', 1,0))/count(*)*100 as value\nFROM motion2.cdr\nWHERE $__timeFilter(calldate)\nGROUP BY $__timeGroup(calldate,'24h')\nORDER BY $__timeGroup(calldate,'24h') ASC\n",
          "refId": "A"
        }
      ],
      "thresholds": "90,95",
      "title": "Answer rate",
      "type": "singlestat",
      "valueFontSize": "80%",
      "valueMaps": [
        {
          "op": "=",
          "text": "N/A",
          "value": "null"
        }
      ],
      "valueName": "avg"
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": false,
      "colors": [
        "#299c46",
        "rgba(237, 129, 40, 0.89)",
        "#d44a3a"
      ],
      "datasource": "${DS_XCALLY}",
      "format": "none",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": true,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 4,
        "w": 5,
        "x": 7,
        "y": 0
      },
      "id": 10,
      "interval": null,
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "postfix": "",
      "postfixFontSize": "50%",
      "prefix": "",
      "prefixFontSize": "50%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "rgba(31, 118, 189, 0.18)",
        "full": false,
        "lineColor": "rgb(31, 120, 193)",
        "show": true
      },
      "tableColumn": "",
      "targets": [
        {
          "alias": "",
          "format": "time_series",
          "hide": false,
          "rawSql": "SELECT \n  $__timeGroup(calldate,'24h') as time,\n  sum(if(disposition='BUSY', 1,0))/count(*)*100 as value\nFROM motion2.cdr\nWHERE $__timeFilter(calldate)\nGROUP BY $__timeGroup(calldate,'24h')\nORDER BY $__timeGroup(calldate,'24h') ASC\n",
          "refId": "A"
        }
      ],
      "thresholds": "5,10",
      "title": "Busy rate",
      "type": "singlestat",
      "valueFontSize": "80%",
      "valueMaps": [
        {
          "op": "=",
          "text": "N/A",
          "value": "null"
        }
      ],
      "valueName": "avg"
    },
    {
      "aliasColors": {
        "ANSWERED": "#629e51",
        "BUSY": "#ef843c",
        "FAILED": "#890f02",
        "NO ANSWER": "#eab839"
      },
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_XCALLY}",
      "fill": 1,
      "gridPos": {
        "h": 11,
        "w": 12,
        "x": 12,
        "y": 0
      },
      "hideTimeOverride": false,
      "id": 3,
      "legend": {
        "alignAsTable": false,
        "avg": false,
        "current": false,
        "hideEmpty": false,
        "hideZero": false,
        "max": false,
        "min": false,
        "rightSide": false,
        "show": true,
        "total": false,
        "values": false
      },
      "lines": true,
      "linewidth": 1,
      "links": [],
      "minSpan": null,
      "nullPointMode": "null as zero",
      "percentage": true,
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [
        {
          "alias": "FAILED",
          "yaxis": 1
        }
      ],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "alias": "",
          "format": "time_series",
          "hide": false,
          "rawSql": "SELECT \n  $__timeGroup(calldate,'24h') as time,\n  count(*) as value,\n  disposition as metric\nFROM motion2.cdr\nWHERE $__timeFilter(calldate)\nGROUP BY disposition, $__timeGroup(calldate,'24h')\nORDER BY $__timeGroup(calldate,'24h') ASC",
          "refId": "B"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeShift": null,
      "title": "Phone Calls",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "transparent": false,
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "decimals": null,
          "format": "short",
          "label": "Call count",
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "label": "",
          "logBase": 1,
          "max": null,
          "min": null,
          "show": false
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "aliasColors": {},
      "bars": true,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_XCALLY}",
      "fill": 1,
      "gridPos": {
        "h": 15,
        "w": 12,
        "x": 0,
        "y": 4
      },
      "id": 5,
      "legend": {
        "avg": false,
        "current": false,
        "max": false,
        "min": false,
        "show": true,
        "total": false,
        "values": false
      },
      "lines": false,
      "linewidth": 1,
      "links": [],
      "nullPointMode": "null",
      "percentage": false,
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": true,
      "steppedLine": false,
      "targets": [
        {
          "alias": "",
          "format": "time_series",
          "rawSql": "SELECT  $__timeGroup(createdAt,'24h') as time,\n  count(*) as value,\n  'Chat' as metric\n  FROM motion2.chat_messages\n WHERE $__timeFilter(createdAt)\n GROUP BY $__timeGroup(createdAt,'24h')\nUNION SELECT  $__timeGroup(createdAt,'24h') as time,\n  count(*) as value,\n  'SMS' as metric\n  FROM motion2.sms_messages\n WHERE $__timeFilter(createdAt)\n GROUP BY $__timeGroup(createdAt,'24h')\nUNION SELECT  $__timeGroup(createdAt,'24h') as time,\n  count(*) as value,\n  'FAX' as metric\n  FROM motion2.fax_messages\n WHERE $__timeFilter(createdAt)\n GROUP BY $__timeGroup(createdAt,'24h')\nUNION SELECT  $__timeGroup(createdAt,'24h') as time,\n  count(*) as value,\n  'Mail' as metric\n  FROM motion2.mail_messages\n WHERE $__timeFilter(createdAt)\n GROUP BY $__timeGroup(createdAt,'24h')\nUNION SELECT  $__timeGroup(createdAt,'24h') as time,\n  count(*) as value,\n  'OpenChannel' as metric\n  FROM motion2.openchannel_messages\n WHERE $__timeFilter(createdAt)\n GROUP BY $__timeGroup(createdAt,'24h')\nUNION SELECT  cast(cast(origtime/(60*60*24) as signed)*60*60*24 as signed) as time,\n  count(*) as value,\n  'VoiceMail' as metric\n  FROM motion2.voice_voicemail_messages\n WHERE $__timeFilter(origtime)\n GROUP BY cast(cast(origtime/(60*60*24) as signed)*60*60*24 as signed)\n UNION SELECT  $__timeGroup(calldate,'24h') as time,\n  count(*) as value,\n  'Phone' as metric\n  FROM motion2.cdr\n WHERE $__timeFilter(calldate)\n GROUP BY $__timeGroup(calldate,'24h')\nORDER BY 1 ASC",
          "refId": "A"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeShift": null,
      "title": "Channels",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "aliasColors": {
        "in": "#64b0c8",
        "out": "#bf1b00"
      },
      "bars": true,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_XCALLY}",
      "fill": 1,
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 12,
        "y": 11
      },
      "id": 12,
      "legend": {
        "avg": false,
        "current": false,
        "max": false,
        "min": false,
        "show": true,
        "total": false,
        "values": false
      },
      "lines": false,
      "linewidth": 1,
      "links": [],
      "nullPointMode": "null",
      "percentage": false,
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": true,
      "steppedLine": false,
      "targets": [
        {
          "alias": "",
          "format": "time_series",
          "rawSql": "SELECT \n  $__timeGroup(createdAt,'24h') as time,\n  count(*) as value,\n  direction as metric\nFROM motion2.mail_messages\nWHERE $__timeFilter(createdAt)\nGROUP BY direction, $__timeGroup(createdAt,'24h')\nORDER BY $__timeGroup(createdAt,'24h') ASC,direction\n",
          "refId": "A"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeShift": null,
      "title": "Mail Channel",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    }
  ],
  "refresh": false,
  "schemaVersion": 16,
  "style": "dark",
  "tags": [
    "xCALLY",
    "xCALLY Dash"
  ],
  "templating": {
    "list": []
  },
  "time": {
    "from": "now-30d",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ],
    "time_options": [
      "5m",
      "15m",
      "1h",
      "6h",
      "12h",
      "24h",
      "2d",
      "7d",
      "30d"
    ]
  },
  "timezone": "",
  "title": "4xCALLY Dashboard",
  "uid": "oHI5nUcmz",
  "version": 21
}