Fix JSON payload template to generate valid JSON (v2.0.9)
This commit is contained in:
@@ -52,8 +52,8 @@ script:
|
|||||||
- service: rest_command.sip_notification_call
|
- service: rest_command.sip_notification_call
|
||||||
data:
|
data:
|
||||||
destination: "{{ destination }}"
|
destination: "{{ destination }}"
|
||||||
audio_url: "{{ audio_url | default('') }}"
|
audio_url: "{{ audio_url if audio_url else '' }}"
|
||||||
message: "{{ message | default('') }}"
|
message: "{{ message if message else '' }}"
|
||||||
duration: "{{ duration | default(30) }}"
|
duration: "{{ duration | default(30) }}"
|
||||||
|
|
||||||
rest_command:
|
rest_command:
|
||||||
@@ -61,11 +61,15 @@ rest_command:
|
|||||||
url: "http://088d3b92-sip-notifier:8099/send_notification"
|
url: "http://088d3b92-sip-notifier:8099/send_notification"
|
||||||
method: POST
|
method: POST
|
||||||
content_type: "application/json"
|
content_type: "application/json"
|
||||||
payload: >
|
payload: >-
|
||||||
{
|
{
|
||||||
"destination": "{{ destination }}",
|
"destination": "{{ destination }}"
|
||||||
{% if audio_url and audio_url != '' %}"audio_url": "{{ audio_url }}",{% endif %}
|
{%- if audio_url and audio_url != '' %},
|
||||||
{% if message and message != '' %}"message": "{{ message }}",{% endif %}
|
"audio_url": "{{ audio_url }}"
|
||||||
|
{%- endif %}
|
||||||
|
{%- if message and message != '' %},
|
||||||
|
"message": "{{ message }}"
|
||||||
|
{%- endif %},
|
||||||
"duration": {{ duration | default(30) }}
|
"duration": {{ duration | default(30) }}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
name: "SIP Voice Notifier"
|
name: "SIP Voice Notifier"
|
||||||
version: "2.0.8"
|
version: "2.0.9"
|
||||||
slug: "sip-notifier"
|
slug: "sip-notifier"
|
||||||
description: "Send voice notifications via SIP phone calls"
|
description: "Send voice notifications via SIP phone calls"
|
||||||
arch:
|
arch:
|
||||||
|
|||||||
Reference in New Issue
Block a user