Call processing for the period

Call processing for the period

Itgrix module API request

If for some reason the Itgrix module has been disabled, or if during the first installation there is a desire to process already passed calls, you can use a special request /pbx/read_call in the API of the Itgrix module. It can be used to trigger the processing of certain calls.

For example, you can make a query using curl (here <Asterisk> is the address of the server where the Itgrix module is installed, login:password is the login:password for the integration module's admin panel):

curl --digest -u login:password "<Asterisk IP>:8077/pbx/read_call?<parameters>"

The method has two options for using parameters:

  • specify one or more call identifiers id;
  • specify the start_date and (optionally) end_date (in this case the module finds all CEL records in the specified dates and processes calls by ID) (in this case the module finds all CEL records in the specified dates, takes linkedid from them and processes calls by ID).

Using the call ID

If you need to process a single call, the easiest thing to do is to make GET-query with parameter id:

curl --digest -u login:password "<Asterisk IP>:8077/pbx/read_call?id=1234567890.1"

If you need to process several calls, you can pass a JSON-object with an id array via POST request :

curl --digest -u login:password "<Asterisk IP>:8077/pbx/read_call" \
-H "Content-Type: application/json" \
-d '{"id":["1111111111.1", "2222222222.2"]}'

Using Period Bounds

The period's boundaries are defined by the start_date and end_date . The end_date parameter is optional; that is, it does not have to be specified, in which case the module will process all calls starting from the start_date.

Parameters can be specified in three ways:

  • Date and time inYYYY-MM-DD hh:mm:ssformat .
    When sending a GET request with this parameter, you must replace the space with the special sequence %20 when sending a POST request with parameters in JSON format, this is not required.
    For example, let's process the calls from May 25, 2021, from 10:30 a.m. to 10:00 p.m.:
    curl --digest -u login:password "<Asterisk IP>:8077/pbx/read_call?\
    start_date=2021-05-25%2010:30:00&\
    end_date=2021-05-25%2022:00:00"
  • Timestamp in UNIX time format (can be obtained from the call ID - it is the number before the decimal point; for example, in the call 1267568856.11, the number 1267568856 is the timestamp).
    For example, let's process calls from May 27, 2021, at 06:01:59 GMT, i.e., UNIX time 1622138519:
    curl --digest -u login:password "<Asterisk IP>:8077/pbx/read_call?start_date=1622138519"
  • Number of days ago (a negative integer).
    For example, process the calls from the day before yesterday:
    curl --digest -u login:password "<Asterisk IP>:8077/pbx/read_call?start_date=-2&end_date=-1"
    Example of calls handled in a week:
    curl --digest -u login:password "<Asterisk IP>:8077/pbx/read_call?start_date=-7"
    There is also a special option, start_date=-0, which processes calls from today (starting at midnight local time):
    curl --digest -u login:password "<Asterisk IP>:8077/pbx/read_call?start_date=-0"

On this page