I would like to keep a SIP peer in some queues, but in a paused state.
I need this user in this queues because there is a software, built on top of Asterisk (via AMI), that check queue members and show to the user “things” related to him. At the same time, I don’t want this user to ring at any queue call.
So I put this member in all queues and paused him from the queues he doesn’t want to ring in.
I know, it’s not a great solutions, but it works.
My problem is that if the server would be restarted, I have to pause this user again. There is any way to perform some actions when Asterisk starts? I want to pause the peer in some of its queues, when Asterisk starts
After pausing the member, just do some other action to the queue, like add and remove a random member, and see if that helps. I have no issues with members loosing pause state on restart of asterisk, on the servers I run.
Thank you Chano :-), that would be a great solution, but I can’t use dynamic queue members.
The software I use (build by the company I work for) handles only static queue members.
Although dynamic persistent members feature would keep the member in the queue, I can’t use this feature because with the software I use it would be useless.
Maybe a quick and dirty way could be to pause the queue members with a command “asterisk -rx XXX” using systemd via ExecStartPost in the .service file but I don’t know is there is a better way to achieve what I need (leave systemd out would be better).
Maybe there is some hook provided by Asterisk? Something like “PostStart” where I can exec some commands? In the manual I don’t find anything.
Although all this seems to be abusing the queue mechanism if you never want to all them from the queue, put them in with a higher penalty than the maximum for the queue
The fact is that I can’t edit the software and I can’t say “no” because our customer is already angry to us (for other reasons that we can’t handle). I want him to be happy so I’m looking for some even crappy solution that does the job. It’s really a sad situation.
The penalty, as you suggested, isn’t a viable solution because it’s very likely that someone will not answer the phone, making the peer of this guy ring when he doesn’t want.
The problem is that ensuring the command runs only after Asterisk has started can be challenging (as Chano pointed out). Also, if for some reason Asterisk restarts (only Asterisk, not the server) the command wouldn’t be executed.
Ok, I’ve tried your options and the result are “interesting” (unfortunately ).
Both when I set the penalty over the QUEUE_MAX_PENALTY and when I set the penalty to a negative value (with negative_penalty_invalid = yes) the same thing happens:
if I ran queue show I see that the member has not penalty:
Normal Man (SIP/xxx1) with penalty 1 (ringinuse disabled) (Not in use) has taken no calls yet
**No Ring Man (SIP/xxx2) (ringinuse disabled) (Not in use) has taken no calls yet**
Normal Man (SIP/xxx3) with penalty 1 (ringinuse disabled) (Not in use) has taken no calls yet
Normal Man (SIP/xxx4) with penalty 1 (ringinuse disabled) (Not in use) has taken no calls yet
Calling the queue I see that changing the penalty (both over QUEUE_MAX_PENALTY and negative value) has the opposite effect: the No Ring Man is always the first to ring!
If I set the penalty to something like 2, everything works as expected (who has penalty 1 rings before, the guy with penalty 2 rings after).
Asterisk version is: Asterisk certified/13.18-cert2
Playing with penalty doesn’t seem to be a viable solution so