Break incoming call 'Wait' and send to another extension?

I’m trying to figure out a way to use my Google AIY (on a raspberry PI) to force my Asterisk server to pickup a call when I’m pretty sure by looking at the number that is a telemarketer and send it to Lenny by saying for example, ‘Hey Google, Lenny’. The Google AIY part I’ll figure out, it is the asterisk part that I’m not sure how to do.

My setup is that I have a ATA that is connected to my PSTN that forwards the incoming calls to my Asterisk server. When the call comes in, there is a ‘Wait(16)’ to allow us to pickup the phone before Asterisk takes the call and sends it to voicemail. What I want to do is be able to ‘break’ the Wait(16) and change the extension and send it to another extension. Is there a way to do this through the CLI?

exten => s,1,NoOp(Incomming Call on ATA)
 same => n,NoOp(CallerID Num:  ${CALLERID(num)} - Prefix: ${CALLERID(num):0:6})
 same => n,NoOp(CallerID Name: ${CALLERID(name)} - Prefix: ${CALLERID(name):0:6})
 same => n,GotoIf(${DB_EXISTS(blacklist/${CALLERID(number)})}?blacklisted,s,1)
 same => n,Macro(check-lenny)
 same => n,Wait(16)
 same => n,Answer
 same => n,Wait(1)
 same => n,Set(VMAILBOX=200)
 same => n,Goto(vmail-leave-message,1,1)

AMI ChannelRedirect. However, also consider whether the channel pickup feature might be a better solution.

Hmm yes that looks like it is probably what I’m looking for. I guess I’ll have to figure out first what channel the call is coming in on first… ‘core show channels’ and wrap that through grep/awk if I want to do this in a bash script I guess?