Przejdź do treści

Połączenie na IVR

klient dzwoni z numeru xxxxxxxxx na numer IVR xxxxxxxxx3. Informacja webhook dotyczy stworzenia nowego dialogu dla strony klienta

Body

{
    "event_type": "user_dialog",
    "event_name": "dialog_create",
    "event_time": "2020-08-25 17:39:22",
    "direction": "OUTBOUND",
    "business_direction": "INBOUND",
    "state": "ringing",
    "dialog_type": "EXTERNAL",
    "dialog_uuid": "1da6bb88-a78a-420c-8ecf-d480bfa35054",
    "media": [
        "audio"
    ],
    "self_target": "48xxxxxxxxx",
    "self_name": "48xxxxxxxxx",
    "peer_target": "48xxxxxxxxx3",
    "peer_name": null,
    "peer_type": null,
    "peer_project_name": null,
    "peer_username": null,
    "peer_firstname": null,
    "peer_surname": null,
    "from_display_name": null,
    "from_display_target": null,
    "to_display_name": null,
    "to_display_target": null,
    "caller_contact_address": "48xxxxxxxxx",
    "callee_contact_address": "48xxxxxxxxx3",
    "initial_link_type": "CONTACT_EXTERNAL_LINK",
    "initial_application_info": {
        "type": "EXTERNAL_INBOUND_CALL",
        "side": "CONTACT",
        "data": {
            "caller_dialog_uuid": "1da6bb88-a78a-420c-8ecf-d480bfa35054",
            "caller_contact_address": "48xxxxxxxxx",
            "callee_contact_address": "48xxxxxxxxx3"
        }
    },
    "anonymous": {
        "display_name": "48xxxxxxxxx"
    }
}

połączenie zostało automatycznie odebrane na IVR, informacja webhook dotyczy zmiany stanu dialogu od strony klienta.

Body

{
    "event_type": "user_dialog",
    "event_name": "dialog_state_update",
    "event_time": "2020-08-25 17:39:22",
    "dialog_uuid": "1da6bb88-a78a-420c-8ecf-d480bfa35054",
    "state": "answered"
}

W przedstawionym scenariuszu klient został przekierowany przez IVR na projekt po wybraniu akcji w menu. Projekt miał ustawioną strategię dystrybucji jako "wybór w koło zgodnie z pozycją konsultanta w projekcie" przez co system wydzwania jednego konsultanta na raz - w takim przypadku przed wydzwonieniem tego konsultanta już jest stworzony dialog dla strony konsultanta od razu z parametrem state jako alerting.

Body

{
    "event_type": "user_dialog",
    "event_name": "dialog_create",
    "event_time": "2020-08-25 17:39:34",
    "direction": "INBOUND",
    "business_direction": "INBOUND",
    "state": "alerting",
    "dialog_type": "CONSULTANT",
    "dialog_uuid": "e89d6f2f-079c-4f25-8325-da4df82ddd78",
    "media": [
        "audio"
    ],
    "self_target": "48xxxxxxxxx6",
    "self_name": "Konsultant Paweł",
    "peer_target": "48xxxxxxxxx",
    "peer_name": "48xxxxxxxxx",
    "peer_type": "EXTERNAL",
    "peer_project_name": null,
    "peer_username": null,
    "peer_firstname": null,
    "peer_surname": null,
    "from_display_name": null,
    "from_display_target": null,
    "to_display_name": null,
    "to_display_target": null,
    "caller_contact_address": "48xxxxxxxxx",
    "callee_contact_address": "48xxxxxxxxx3",
    "initial_link_type": null,
    "initial_application_info": {
        "type": "CALL_TO_USER",
        "side": "USER",
        "data": {
            "caller_dialog_uuid": "1da6bb88-a78a-420c-8ecf-d480bfa35054",
            "caller_number": "48xxxxxxxxx",
            "caller_contact_address": "48xxxxxxxxx",
            "callee_contact_address": "48xxxxxxxxx3",
            "tenant_user": {
                "id": 1,
                "username": "pkowalski"
            },
            "project": {
                "id": 1,
                "name": "Projekt Paweł"
            },
            "caller_initial_application_info": {
                "type": "EXTERNAL_INBOUND_CALL",
                "side": "CONTACT",
                "data": {
                    "caller_dialog_uuid": "1da6bb88-a78a-420c-8ecf-d480bfa35054",
                    "caller_contact_address": "48xxxxxxxxx",
                    "callee_contact_address": "48xxxxxxxxx3"
                }
            }
        }
    },
    "tenant_user": {
        "id": 1,
        "username": "pkowalski",
        "firstname": "Paweł",
        "surname": "kowalski",
        "display_name": "Konsultant Paweł"
    },
    "project": {
        "id": 1,
        "name": "Projekt Paweł"
    }
}

odebranie połączenia przez konsultanta zmieni stan jego dialogu na answered, prezentuje to webhook dialog state update

Body

{
    "event_type": "user_dialog",
    "event_name": "dialog_state_update",
    "event_time": "2020-08-25 17:39:38",
    "dialog_uuid": "e89d6f2f-079c-4f25-8325-da4df82ddd78",
    "state": "answered"
}

w tym momencie oba dialogi znajdują się w jednym meetingu. Od tej chwili mogą się ze sobą komunikować oraz ich stan obu dialogów zmienia się z answered na talking:

Body

{
    "event_type": "user_dialog",
    "event_name": "dialog_state_update",
    "event_time": "2020-08-25 17:39:39",
    "dialog_uuid": "e89d6f2f-079c-4f25-8325-da4df82ddd78",
    "state": "talking"
}

Body

{
    "event_type": "user_dialog",
    "event_name": "dialog_state_update",
    "event_time": "2020-08-25 17:39:39",
    "dialog_uuid": "1da6bb88-a78a-420c-8ecf-d480bfa35054",
    "state": "talking"
}

rozmowa jest prowadzona, następnie po rozłączeniu połączenia, webhook poinformuje o zamknięciu dialogu

Body

{
    "event_type": "user_dialog",
    "event_name": "dialog_close",
    "event_time": "2020-08-25 17:39:58",
    "direction": "OUTBOUND",
    "business_direction": "INBOUND",
    "from_display_name": "48xxxxxxxxx",
    "from_display_target": "48xxxxxxxxx",
    "to_display_name": "Główny IVR API",
    "to_display_target": "48xxxxxxxxx3",
    "caller_contact_address": null,
    "callee_contact_address": null,
    "initial_application_target_id": "5f454a1280f35704900fdcbb",
    "initial_application_target_name": "Główny IVR API",
    "initial_application_selection_id": null,
    "initial_application_selection_name": null,
    "initial_target_type": "IVR",
    "variables": {
    },
    "close_cause": "DIALOG_LEFT",
    "dialog_uuid": "1da6bb88-a78a-420c-8ecf-d480bfa35054",
    "initial_application_info": {
        "type": "EXTERNAL_INBOUND_CALL",
        "side": "CONTACT",
        "data": {
            "caller_dialog_uuid": "1da6bb88-a78a-420c-8ecf-d480bfa35054",
            "caller_contact_address": "48xxxxxxxxx",
            "callee_contact_address": "48xxxxxxxxx3"
        }
    },
    "anonymous": {
        "display_name": "48xxxxxxxxx",
        "presentation_number": "48xxxxxxxxx"
    }
}

Body

{
    "event_type": "user_dialog",
    "event_name": "dialog_close",
    "event_time": "2020-08-25 17:39:58",
    "direction": "INBOUND",
    "business_direction": "INBOUND",
    "from_display_name": "48xxxxxxxxx",
    "from_display_target": "48xxxxxxxxx",
    "to_display_name": "Projekt Paweł",
    "to_display_target": "PA",
    "caller_contact_address": null,
    "callee_contact_address": null,
    "initial_application_target_id": 1,
    "initial_application_target_name": "Projekt Paweł",
    "initial_application_selection_id": null,
    "initial_application_selection_name": null,
    "initial_target_type": "PROJECT",
    "variables": {
    },
    "close_cause": "HANGUP",
    "dialog_uuid": "e89d6f2f-079c-4f25-8325-da4df82ddd78",
    "initial_application_info": {
        "type": "CALL_TO_USER",
        "side": "USER",
        "data": {
            "caller_dialog_uuid": "1da6bb88-a78a-420c-8ecf-d480bfa35054",
            "caller_number": "48xxxxxxxxx",
            "caller_contact_address": "48xxxxxxxxx",
            "callee_contact_address": "48xxxxxxxxx3",
            "tenant_user": {
                "id": 1,
                "username": "pkowalski"
            },
            "project": {
                "id": 1,
                "name": "Projekt Paweł"
            },
            "caller_initial_application_info": {
                "type": "EXTERNAL_INBOUND_CALL",
                "side": "CONTACT",
                "data": {
                    "caller_dialog_uuid": "1da6bb88-a78a-420c-8ecf-d480bfa35054",
                    "caller_contact_address": "48xxxxxxxxx",
                    "callee_contact_address": "48xxxxxxxxx3"
                }
            }
        }
    },
    "tenant_user": {
        "id": 1,
        "username": "pkowalski",
        "firstname": "Paweł",
        "surname": "kowalski",
        "outbound_name": "Konsultant Paweł",
        "outbound_number": "48xxxxxxxxx6"
    },
    "project": {
        "id": 1,
        "name": "Projekt Paweł"
    }
}

na podstawie parametru close_cause wiemy, która strona zakończyła połączenie.

HANGUP - rozłączenie połączenia przez daną strone.
DIALOG_LEFT - druga strona rozłączyła się.