Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Tip

Default settings for timeouts, TTL and repeat frequency can be customized with the following environment variables added to /etc/systemd/system/pbx-data-engine.service.d/override.conf file:

  • XHOP_SMART_NOTIFICATION_CONFIRMATION_TIMEOUT: timeout period for a confirmation

  • XHOP_SMART_NOTIFICATION_QUEUE_TIMEOUT: timeout for queued requests

  • XHOP_SMART_NOTIFICATION_PLAY_FREQUENCY: frequency for repeating the notification playback

    Code Block
    [Service]  
    Environment='XHOP_SMART_NOTIFICATION_CONFIRMATION_TIMEOUT=65'    
    Environment='XHOP_SMART_QUEUE_TIMEOUT=65'     
    Environment='XHOP_SMART_PLAY_FREQUENCYT=65'                                                                                                                                                                          
    ExecStart=                                                                                                                                                                                     
    ExecStart=/usr/sbin/pbx_data_engine.py --conf_recording --daemon --mode calls presence xhop -e -l 4 
  • The HTTP API proxies requests to the data engine API:

    Code Block
    /usr/sbin/data_engine_cli xhop::SmartNotification::${DATA}

where ${DATA} is a base64-encoded JSON payload containing the request parameters, for example:

Code Block
/usr/sbin/data_engine_cli xhop::SmartNotification::1::eyJmcm9tIjogInNob3AiLCAibm90aWZpY2F0aW9uVHlwZSI6ICJicm9hZGNhc3RNZXNzYWdlIiwgImV2ZW50IjogImhlbHAgbmVlZGVkIiwgImJyb2FkY2FzdE1lc3NhZ2UiOiAiaGVscCBpcyBuZWVkZWQiLCAiY29uZmVyZW5jZUlkIjogIjEifQ==
Code Block
/usr/sbin/data_engine_cli xhop::SmartNotification::eyJmcm9tIjogInNob3AxIiwgIm5vdGlmaWNhdGlvblR5cGUiOiAiYnJvYWRjYXN0TWVzc2FnZSIsICJldmVudCI6ICJoZWxwIG5lZWRlZCIsICJicm9hZGNhc3RNZXNzYWdlIjogIkhlbHAgaXMgbmVlZGVkIG9uIHRoZSBzZWNvbmQgZmxvb3IiLCAiY29uZmVyZW5jZUlkIjogIjEiLCAicGxheUZyZXF1ZW5jeSI6IDEwLCAiY29uZmlybWF0aW9uVGltZW91dCI6IDMwLCAicXVldWVUaW1lb3V0IjogMzAwLCAicHJpb3JpdHkiOiAwLCAib3JpZ2luIjogIlFSIiwgImN1c3RvbVJpZCI6ICI2OWMwMzM0Ni1mZjY4LTRiZmQtYjM3Zi0yYTZiOGY3YTAyNDkifQ==
  • To check the status of the current request, use the following command:

    Code Block
    data_engine_cli xhop::state | jq

Possible responses

Below are the possible response types:

Code Block
{"type": "result", "result": {"requestId": "d7037f0b-23d8-46d5-9909-96867fb7fa56"}}
Code Block
{"type": "error", "reason": "'conferenceId' is a required property"}
Code Block
{"type": "error", "reason": "'playFrequency' validation error: 100 is greater than the maximum of 30"}
  • auto

Configure Dialplan

To configure smart notifications for playback on x-hoppers headsets, proceed with the following steps:

...