-
-
Notifications
You must be signed in to change notification settings - Fork 32
Description
I tried adapting the answer command example from the README.md to dynamically accept any call.
(I know that I can use the accept mode for this, but I just wanted to test drive.)
service: hassio.addon_stdin
data:
addon: c7744bff_ha-sip
input:
command: answer
number: "{{ trigger.json.parsed_caller }}"
menu:
message: Bye
post_action: hangupparsed_caller looks like this for me: +49151xxxxxxxx
It always includes a leading + and country code.
Unfortunately the leading + triggers a quirk in the Home Assistant template parser: the result is always interpreted as a number and the + disappears.
i.e the result is not the expected:
number: "+49151xxxxxxxx"but:
number: 49151xxxxxxxxThe only known way around this is:
action: hassio.addon_stdin
data_template:
addon: c7744bff_ha-sip
input: |-
{{ {
'command': 'answer',
'number': trigger.json.parsed_caller,
'menu': {
'message': 'Bye',
'post_action': 'hangup'
}
} }}
I understand that this is not a bug with the (awesome!) ha-sip addon.
But what do you think about auto-inserting a missing leading + for number inside the addon?
It would enable the more convenient template form, which users would expect to work by default, if it weren't for this weird / unobvious Home Assistant quirk.
Thanks for this amazing addon. It unlocks so many new possibilities! ❤