Table of Contents

API pro práci s hovory

Součást Odorik.cz API určená pro práci s telefonními hovory.

Callback

POST /callback

Historie hovorů

GET /calls.csv, GET /calls.json, GET /calls.xml

[{"id": 98292358,
  "redirection_parent_id": 98292356,
  "date": "2014-10-01T11:28:31Z",
  "direction": "redirected",
  "source_number": "00420555444333",
  "destination_number": "*300000",
  "destination_name": "Česká rep. - * v síti",
  "length": 362,
  "ringing_length": 8,
  "status": "answered",
  "price": 0.0,
  "price_per_minute": 0.0,
  "balance_after": 554.0288,
  "line": 403366,
  "recording": null}]

Právě probíhající hovory

GET /active_calls.json

[ { "id":14990661,
    "source_number":"00420533533013",
    "destination_number":"00420910110006",
    "destination_name":"Česko v síti 910-test- přesměrováno",
    "start_date":"2013-08-15T06:34:43Z",
    "answer_date":"2013-08-15T06:34:46Z",
    "price_per_minute":0.0,
    "line":403366 } ]

DELETE /active_calls/<id>.json

Statistika

GET /call_statistics.json

{ "incoming":{"count":140,"length":27405,"price":0.0},
  "outgoing":{"count":118,"length":26808,"price":56.9056},
  "redirected":{"count":14,"length":1696,"price":16.6772} }

GET /call_statistics/by_destination.json

[ {"destination":"Česká rep. - mobil","count":10,"length":1234,"price":12.1344,"price_per_minute":0.59,"direction":"out"},
  {"destination":"Česká rep. - mobil","count":14,"length":1696,"price":16.6772,"price_per_minute":0.59,"direction":"redirected"},
  {"destination":"Česká rep. - mobil","count":8,"length":307,"price":7.6239,"price_per_minute":1.49,"direction":"out"},
  {"destination":"Česká rep. - odorikmobil","count":3,"length":105,"price":1.0325,"price_per_minute":0.59,"direction":"out"},
  {"destination":"Česká rep. - odorikpevna","count":54,"length":2603,"price":25.5958,"price_per_minute":0.59,"direction":"out"},
  {"destination":"Česká rep. - pevna","count":2,"length":99,"price":2.4585,"price_per_minute":1.49,"direction":"out"},
  {"destination":"Česká rep. - pevná - špička","count":2,"length":987,"price":8.0605,"price_per_minute":0.49,"direction":"out"},
  {"destination":"Česko v síti","count":106,"length":19028,"price":0.0,"price_per_minute":0.0,"direction":"in"},
  {"destination":"Česko v síti","count":39,"length":21473,"price":0.0,"price_per_minute":0.0,"direction":"out"},
  {"destination":"Odorik.cz mobil","count":34,"length":8377,"price":0.0,"price_per_minute":0.0,"direction":"in"} ]

GET /call_statistics/missed_calls.json

[ {"destination_number":"00420533533533","count":2},
  {"destination_number":"00420533999999","count":3} ]