Skip to content

Commit

Permalink
[CD-2] Added cb_acdc_call_stats for Kazoo 4.1 (#3948)
Browse files Browse the repository at this point in the history
  • Loading branch information
kalda341 authored and jamesaimonetti committed Jul 20, 2017
1 parent 87eaa4c commit f2cca7c
Show file tree
Hide file tree
Showing 9 changed files with 584 additions and 11 deletions.
3 changes: 3 additions & 0 deletions applications/acdc/priv/couchdb/views/call_stats.json
Expand Up @@ -4,6 +4,9 @@
"views": {
"call_log": {
"map": "function(doc) { if ( doc.pvt_type != 'call_stat' ) return; emit([doc.queue_id, doc.entered_timestamp], null); }"
},
"crossbar_listing": {
"map": "function(doc) { if ( doc.pvt_type != 'call_stat' ) return; emit(doc.entered_timestamp, {entered_timestamp: doc.entered_timestamp, handled_timestamp: doc.handled_timestamp, caller_id_number: doc.caller_id_number, caller_id_name: doc.caller_id_name, entered_position: doc.entered_position, status: doc.status, agent_id: doc.agent_id, wait_time: doc.wait_time, talk_time: doc.talk_time, queue_id: doc.queue_id}); }"
}
}
}
34 changes: 34 additions & 0 deletions applications/crossbar/doc/acdc_call_stats.md
@@ -0,0 +1,34 @@
### Acdc Call Stats

#### About Acdc Call Stats

#### Schema



#### Fetch

> GET /v2/accounts/{ACCOUNT_ID}/acdc_call_stats
```shell
curl -v -X GET \
-H "X-Auth-Token: {AUTH_TOKEN}" \
http://{SERVER}:8000/v2/accounts/{ACCOUNT_ID}/acdc_call_stats
```

Get a time range of ACDC Call Stats (using gregorian seconds for timestamps):

```shell
curl -v -X GET \
-H "X-Auth-Token: {AUTH_TOKEN}" \
http://{SERVER}:8000/v2/accounts/{ACCOUNT_ID}/acdc_call_stats?created_from={FROM_TIMESTAMP}&created_to={TO_TIMESTAMP}
```

Get ACDC Call Stats as CSV:

```shell
curl -v -X GET \
-H "Accept: text/csv" \
-H "X-Auth-Token: {AUTH_TOKEN}" \
http://{SERVER}:8000/v2/accounts/{ACCOUNT_ID}/acdc_call_stats
```
18 changes: 18 additions & 0 deletions applications/crossbar/doc/ref/acdc_call_stats.md
@@ -0,0 +1,18 @@
### Acdc Call Stats

#### About Acdc Call Stats

#### Schema



#### Fetch

> GET /v2/accounts/{ACCOUNT_ID}/acdc_call_stats
```shell
curl -v -X GET \
-H "X-Auth-Token: {AUTH_TOKEN}" \
http://{SERVER}:8000/v2/accounts/{ACCOUNT_ID}/acdc_call_stats
```

Expand Up @@ -133,6 +133,8 @@
"crossbar.accounts.new_account_notify_delay_s": "crossbar.accounts new account notify delay in seconds",
"crossbar.accounts.random_realm_strength": "crossbar.accounts random realm strength",
"crossbar.accounts.trial_time": "crossbar.accounts trial time",
"crossbar.acdc_call_stats.maximum_bulk": "The maximum number of call stats to load in a request",
"crossbar.acdc_call_stats.maximum_range": "The maximum number of seconds between the start and end time of a call stats request",
"crossbar.allow_tracing": "crossbar allow tracing",
"crossbar.api_auth_tokens": "crossbar api auth tokens",
"crossbar.auth.auth_modules": "Default crossbar authentication modules configuration",
Expand Down
53 changes: 44 additions & 9 deletions applications/crossbar/priv/api/swagger.json
Expand Up @@ -681,7 +681,7 @@
"type": "object"
},
"auth_config": {
"description": "corssbar authentication module configuration",
"description": "crossbar authentication module configuration",
"properties": {
"enabled": {
"description": "whether or not this authentication module is enabled",
Expand Down Expand Up @@ -731,7 +731,7 @@
"type": "object"
},
"auth_config_account": {
"description": "corssbar account authentication modules configuration",
"description": "crossbar account authentication modules configuration",
"properties": {
"auth_modules": {
"additionalProperties": true,
Expand Down Expand Up @@ -22152,8 +22152,8 @@
"port_requests.to_scheduled": {
"description": "Schema for a port request to be transitioned to the 'scheduled' state",
"properties": {
"schedule_on": {
"description": "date-time at which to perform the porting",
"scheduled_date": {
"description": "Time at which to perform the porting, either as a gregorian timestamp or as datetime",
"properties": {
"date_time": {
"pattern": "^2\\d\\d\\d-\\d\\d-\\d\\d \\d\\d:\\d\\d$",
Expand Down Expand Up @@ -22745,13 +22745,15 @@
"timezone",
"date_time"
],
"type": "object"
},
"scheduled_date": {
"description": "Gregorian timestamp at which to perform the porting",
"type": "integer"
"type": [
"integer",
"object"
]
}
},
"required": [
"scheduled_date"
],
"type": "object"
},
"profile": {
Expand Down Expand Up @@ -24924,6 +24926,22 @@
},
"type": "object"
},
"system_config.crossbar.acdc_call_stats": {
"description": "Schema for crossbar.acdc_call_stats system_config",
"properties": {
"maximum_bulk": {
"default": 50,
"description": "The maximum number of call stats to load in a request",
"type": "integer"
},
"maximum_range": {
"default": 2682000,
"description": "The maximum number of seconds between the start and end time of a call stats request",
"type": "integer"
}
},
"type": "object"
},
"system_config.crossbar.auth": {
"description": "Schema for crossbar.auth system_config",
"properties": {
Expand Down Expand Up @@ -30859,6 +30877,23 @@
}
}
},
"/accounts/{ACCOUNT_ID}/acdc_call_stats": {
"get": {
"parameters": [
{
"$ref": "#/parameters/auth_token_header"
},
{
"$ref": "#/parameters/ACCOUNT_ID"
}
],
"responses": {
"200": {
"description": "request succeeded"
}
}
}
},
"/accounts/{ACCOUNT_ID}/acls": {
"get": {
"parameters": [
Expand Down
Expand Up @@ -2,7 +2,7 @@
"$schema": "http://json-schema.org/draft-04/schema#",
"_id": "auth_config",
"additionalProperties": true,
"description": "corssbar authentication module configuration",
"description": "crossbar authentication module configuration",
"properties": {
"enabled": {
"description": "whether or not this authentication module is enabled",
Expand Down
Expand Up @@ -2,7 +2,7 @@
"$schema": "http://json-schema.org/draft-04/schema#",
"_id": "auth_config_account",
"additionalProperties": true,
"description": "corssbar account authentication modules configuration",
"description": "crossbar account authentication modules configuration",
"properties": {
"auth_modules": {
"additionalProperties": true,
Expand Down
@@ -0,0 +1,18 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"_id": "system_config.crossbar.acdc_call_stats",
"description": "Schema for crossbar.acdc_call_stats system_config",
"properties": {
"maximum_bulk": {
"default": 50,
"description": "The maximum number of call stats to load in a request",
"type": "integer"
},
"maximum_range": {
"default": 2682000,
"description": "The maximum number of seconds between the start and end time of a call stats request",
"type": "integer"
}
},
"type": "object"
}

0 comments on commit f2cca7c

Please sign in to comment.