Setvar in sip.conf doesn't work on 302 "Moved Temporarily"

In sip.conf, my SIP peers use a context ‘from-internal-phone’ for dialing calls. I also have them set some channel variables using ‘setvar=’. This works properly for outbound calls where my users pick up their phones and dial a phone number (or extension).

[phone1]
type=friend
secret=1234
qualify=yes
nat=yes
host=dynamic
context=from-internal-phone
setvar=phone=phone1
setvar=user=user1
canreinvite=no

The problem occurs when one of my phones has Call Forwarding turned on. When someone calls, the phones sends a “302 Moved Temporarily” to Asterisk. As expected, Asterisk then initiates a call from that peer using the correct ‘from-internal-phone’ context. Unfortunately, the channel variables are not set.

-- Got SIP response 302 "Moved Temporarily" back from 1.2.3.4
-- Now forwarding SIP/4.3.2.1-0000019b to 'Local/19525551234@from-internal-phone' (thanks to SIP/phone1-0000019c)
-- Executing [19525551234@from-internal-phone:1] NoOp("Local/19525551234@from-internal-phone-1121;2", "phone=") in new stack

Can anyone help?