Fix JSON payload template to generate valid JSON (v2.0.9)

This commit is contained in:
2026-02-08 15:18:26 +01:00
parent b081832eb7
commit ff6b2a2743
2 changed files with 11 additions and 7 deletions

View File

@@ -52,8 +52,8 @@ script:
- service: rest_command.sip_notification_call
data:
destination: "{{ destination }}"
audio_url: "{{ audio_url | default('') }}"
message: "{{ message | default('') }}"
audio_url: "{{ audio_url if audio_url else '' }}"
message: "{{ message if message else '' }}"
duration: "{{ duration | default(30) }}"
rest_command:
@@ -61,11 +61,15 @@ rest_command:
url: "http://088d3b92-sip-notifier:8099/send_notification"
method: POST
content_type: "application/json"
payload: >
payload: >-
{
"destination": "{{ destination }}",
{% if audio_url and audio_url != '' %}"audio_url": "{{ audio_url }}",{% endif %}
{% if message and message != '' %}"message": "{{ message }}",{% endif %}
"destination": "{{ destination }}"
{%- if audio_url and audio_url != '' %},
"audio_url": "{{ audio_url }}"
{%- endif %}
{%- if message and message != '' %},
"message": "{{ message }}"
{%- endif %},
"duration": {{ duration | default(30) }}
}
```

View File

@@ -1,5 +1,5 @@
name: "SIP Voice Notifier"
version: "2.0.8"
version: "2.0.9"
slug: "sip-notifier"
description: "Send voice notifications via SIP phone calls"
arch: