twinkle icon indicating copy to clipboard operation
twinkle copied to clipboard

Request: enable/disable/switch profiles with cli argument

Open Cyborgscode opened this issue 2 years ago • 3 comments

ATM: Twinkle offers to use a specific profile:

--set-profile Make the active profile. When using this option in conjunction with --call and --cmd, then the profile is activated before executing --call or --cmd.

I like to request two new options: --enable-profile & --disable-profile

Background:

The so far integration of twinkle into PVA Carola works like a charm :) I now want to be able to "enable" the Auto-Answere functionality via voice command, which then ofcourse will need to trigger the required profiles via a cli cmd.

It would be possible to add a check to the call/end-scripts via a flag file in /tmp or /run , but those tend to make problems on reboot or crashes. The IMHO better way would be to have an active on-demand change in the running profiles inside twinkle. On the next start, everything would be back to "normal" ;)

Cyborgscode avatar Jun 07 '22 09:06 Cyborgscode

I now want to be able to "enable" the Auto-Answere functionality via voice command, which then ofcourse will need to trigger the required profiles via a cli cmd.

Forgive me if I'm missing something obvious, but isn't this simply a matter of running the auto_answer CLI command? Why would this involve multiple profiles?

fbriere avatar Jun 09 '22 00:06 fbriere

As i said: yes, you can resolve this inside the script twinkle calls in callstart. BUT, for this to work the script needs to check some sort of flag, to decide to send auto-answere or do nothing. flag/pidfiles of crashed apps, if not auto removed on reboot, cause funny problems, i just wanne avoid this source of bug ;)

As long as the profile setup is not permanently saved, it's reset on reboot => all fine. Besides this, I think it can be usefull to en- or disable profiles on the fly by other apps in general, for the same reasons I need it: sip control

Cyborgscode avatar Jun 09 '22 09:06 Cyborgscode

Forgive me if I'm missing something obvious, but isn't this simply a matter of running the auto_answer CLI command?

Just to clear up any confusion: I was talking about activating the "Auto answer" service for the current profile with twinkle --cmd 'auto_answer -a on', and not about adding action=autoanswer to your script's output. I suspect this is why we couldn't understand each other.

(Note that the setting of this service, like all others, will persist after Twinkle is restarted. But you could easily disable it on startup with a simple script it that's what you prefer.)

fbriere avatar Jun 14 '22 00:06 fbriere