A
A
Anton2020-05-28 15:20:41
API
Anton, 2020-05-28 15:20:41

How to reset a call in Zadarma telephony?

All exhausted already by this question, technical support answers not at all what you ask.
Essence:
There is a webhook to which the operator sends a signal about the beginning of the call:

if (isset($_GET['zd_echo'])) exit($_GET['zd_echo']);
if ($_POST['event'] == 'NOTIFY_START'){
sendTelegram(
      'sendMessage', 
      array(
        'chat_id' => '251203ХХХ',
        'text' => 'Звонок от '.$_POST['caller_id']
      )
    );
  };

Judging by the api, as they write: https://za darma.com/ru/support/api/
For NOTIFY_START and NOTIFY_IVR requests, you can change the script for the current call on the fly by sending one of the following options in response:

For example, dropping a call:
{
    "hangup": 1,
}

I don’t understand point-blank - how to send this in response, maybe someone has a similar implementation, an example in php?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
lubezniy, 2020-05-28
@lubezniy

Something like this:
header('Content-Type: application/json');
echo json_encode(['hangup' => 1, ]);

A
Anton, 2020-05-28
@anton99zel

Let the question remain open for now, because there is no clear answer.
But on GitHub I found a third-party solution, which turned out to be more understandable than their own (
With its help, what I wanted to do worked.
https://github.com/nabarabane/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question