arnonym / ha-plugins

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

Incoming Call Transfers #58

Closed cefranco76 closed 11 months ago

cefranco76 commented 1 year ago

Hello,

It`ll be possible in the future incoming call transfers?

Thanks.

arnonym commented 1 year ago

Hi,

you can already transfer active calls: https://github.com/arnonym/ha-plugins#to-transfer-a-call-to-a-different-sip-uri

cefranco76 commented 1 year ago

Well, when I dial to an extension configured in sip_1 and then execute a transfer using STDIN command, I receive the following message:

| 15:46:18.520947 [ ] Warning: call not in progress: sip:6000@192.168.1.40:8088

image

image

But if I dial using STDIN, the call is transfered. Maybe I`m missing something.

arnonym commented 1 year ago

That's currently a bit unlucky in how ha-sip identifies calls. for outgoing calls it uses exactly the string you specified when you dialed the number, for incoming it gets some parsed version of that. In your case that's probably just "6000", but you can look in the logs for "Registering call with id ". The number is the identifier you need to use for the transfer. You also can set the log level to "2" if the log is too noisy.

cefranco76 commented 1 year ago

The incoming call identify for transfer worked well and the STDIN command did its job, but...

If I place the same stdin command in an automation I get the following log message:

image

image

I've already tried the input parameter "number:" without quotes, single and double quotes, with the same result.

arnonym commented 1 year ago

For some reason the trailing curly brace is missing and I don't have a clue how that can happen. Maybe try "data_template" instead of "data" and hope that home assistant is doing something differently then or check the leading white-space in the yaml for tabs. :man_shrugging:

arnonym commented 11 months ago

Closed because of inactivity.

cefranco76 commented 8 months ago

Hi,

I've never succeeded transferring calls using automation. If you could test it and report if you get the same behavior I'll appreciate.

Only works if I execute the command STDIN, but if I use an automation, I get the error :"Could not deserialize JSON: "command":"transfer","number":"6002","transfer_to":"sip:6001@192.168.1.40:8088"}"

with a missing curly bracket.

cefranco76 commented 8 months ago

Hi,

I've never succeeded transferring calls using automation. If you could test it and report if you get the same behavior I'll appreciate.

Only works if I execute the command STDIN, but if I use an automation, I get the error :"Could not deserialize JSON: "command":"transfer","number":"6002","transfer_to":"sip:6001@192.168.1.40:8088"}"

with a missing curly bracket.

Forget about it, after several tests I got the point. The problem was related to webhooks triggering automations. For some reason action is not properly executed. I solved the issue adding a 3 seconds delay before action to be executed and works fine.