arnonym / ha-plugins

Home-Assistant SIP Gateway
Apache License 2.0
157 stars 19 forks source link

missing `call_disconnected` event from action webhook #36

Closed topic2k closed 1 year ago

topic2k commented 1 year ago

I'm using this great piece of software in an automation. In the automation i'm waiting for a webhook from ha-sip with event call_disconnected. This event is only sent to the global webhook id from the addon configuration. The webhook id defined in the action (webhook_to_call_after_call_was_established) don't receive the call_disconnected event. Is this on intent or can you add this with a next update?

Hanging in the wait loop ```yaml alias: ha-sip-test description: "" trigger: - platform: state entity_id: - input_button.testanruf condition: [] action: - service: hassio.addon_stdin data_template: addon: c7744bff_ha-sip input: command: dial number: sip:**622@fritz.box webhook_to_call_after_call_was_established: action_webhook_id ring_timeout: 20 sip_account: 1 menu: message: >- What is the answer to the ultimate question of live, the universe and everything? post_action: repeat_message timeout: 60 choices: "42": message: Douglas Adams post_action: hangup default: post_action: return timeout: post_action: hangup - repeat: until: - condition: template value_template: "{{ wait.trigger.json.event == 'call_disconnected' }}" sequence: - service: notify.persistent_notification data: message: waiting... - wait_for_trigger: - platform: webhook webhook_id: action_webhook_id continue_on_timeout: false - service: notify.persistent_notification data: message: webhook received. event {{ wait.trigger.json.event }} - service: notify.persistent_notification data: message: end of automation mode: single ```
arnonym commented 1 year ago

Yes, this is on intent, as the configuration parameter is called "after call was established". In theory you can do everything with the global web-hook and some conditions but I see that it would be easier to be able to specify specific web-hook IDs,

I'll think about that a bit and keep you informed here.

arnonym commented 1 year ago

I've added the option to use different (or same) web-hooks for all events that can happen for a call for incoming and outgoing calls. See the docs and the change log for details. Please provide feed-back if this is working as intended for you!

topic2k commented 1 year ago

Wow, great. Works like charm and the way it is now, makes it even simpler as i don't need to check if event == call_disconnected.

Thank you. Where is the donate button? 😄

arnonym commented 1 year ago

There is none. You can leave a github :star: if you like. I'm doing this for internet fame :rocket: :fire: