ha-plugins
ha-plugins copied to clipboard
Wildcard in number lists
Hi!!
First of all, congratulations to this addon. I'm new in SIP World but already building wonders with that. It's not an issue, but I'd like to know if is it possible to implement wildcard (*) in number lists.
I'd like to use for example "55319*" to block all incoming calls started with "55319" instead of adding all of them on a list.
Thanks in advance!
The problem is, that *
is a valid character in phone numbers, so can't be used as a wildcard. I would suggest something like
allowed_numbers:
- "startswith:55319"
Would that solve your use-case?
Hi, sure!
Actually, any character representing a wildcard would be great.
- "55319$"
- "55319%"
So I could write a stdin to addon asking to "hangup" any incoming call starting with "3030%", for example.
I just released a version which wildcard support for the block and allow list in incoming yaml. See the docs for details. No support for wildcards in stdin service, yet.
OK, thank you!
I'll wait for stdin implement, cause "blocked_numbers" in incoming file just avoid the calling to be answered not the phone to ring. I have so much spam callers that I need to hangup them before my phone ring.
You could use the second SIP account for that: Put all the blocked numbers in allowed_numbers and do something like this for the incoming sip file config for that account:
allowed_numbers:
- "55555555555"
- "6666{*}"
answer_after: 0
menu:
post_action: hangup
You could use the second SIP account for that: Put all the blocked numbers in allowed_numbers and do something like this for the incoming sip file config for that account:
allowed_numbers: - "55555555555" - "6666{*}" answer_after: 0 menu: post_action: hangup
Did you mention that solution using the two sip configs with the same sip number, right? For some reason, there are conflits avoiding the behavior that I'm trying to reproduce that is: sip_1 config managing accepted calls and sip_2 config blocking other numbers.