arnonym / ha-plugins

Home-Assistant SIP Gateway
Apache License 2.0
171 stars 22 forks source link

Get own phone number on call in webhook #78

Closed Feuerhamster closed 8 months ago

Feuerhamster commented 9 months ago

I am trying to do an automation where I need the exact number that is called on an incoming call.

So, the sip client has the internal phone number **635 for example. In my phone system, I can append whatever I want to it and the call will still be routed correctly. What I am trying to do is something like **635#1 will call an automation that do different stuff based on the digit after the #.

As far as I tested it, the call gets through, but in the triggered webhook I cannot find the number that is called (e.g. **635#1) but I need that to check in my automation.

Would it be possible to add the exact number that is called as a property to the webhook data?

gerard33 commented 8 months ago

According to this response in another issue it's not possible to know the called number.

arnonym commented 8 months ago

Thanks @gerard33! I looked into that some time ago, and could not find that information in the data available from pjsip. If I missed something, it would be easy to make it available in the webhook data.