Is there any possibility to stop ringall when one of the ring group extension is forwarded?
I forward one of the two main extensions (x) that receive all external incomings calls, to another (y) that play a different voicemail message, but I can’t reach y because x is in the same ring group of the second main extension (z) that continue to ring, even if x is forwarded.
Can I force hungup on extension a when extension b ringing?
I know that I can with AMI but I don’t know where insert php script in the extension.conf (extension-custom.conf for freepbx users) for the context of extension b.
You can only hang up channels, and to some extent devices. I think you are using FreePBX terminology, not Asterisk terminology.
There is no facility to trigger dialplan processing on receiving AST_CONTROL_RINGING,
You can hangup a channel that is being rung by using ChannelRedirect, from dialplan running on a different channel, to redirect it to an extension that hangs it up. You should be able to do this even on outgoing channels. Finding the channel name may be difficult, without AMI.