Tranfer...userfield...CDR

I’m having problems with CDR userfield when transfering the call.
Here is the simplified dialplan from extensions.ael:

context incoming {
40 => {
Set(CDR(userfield)=incoming);
Dial(Zap/40,30,tTr);
Hangup(); }
}

context outgoing {
_X. => Set(CDR(userfield)=outgoing);
Dial(mISDN/g:isdnports/${EXTEN:1},40,T);
}

context local-40 {
40 => Hangup();
9 => {
Set(CALLERID(number)=222240);
goto outgoing|${EXTEN}|1; }
}

…userfield…CDR

  1. 111111 calls 40______________________________________incoming_________CDR1
  2. 40 answers and hit # for blind transfer
  3. 40 dials external number 9222222
  4. 40 gets hangup
  5. 111111 gets ringing tone to 9222222____________________incoming_________CDR2

Therefore I get two CDR inputs, and in step 5 instead of userfield=ougoing, I’m getting userfield=incoming ! I need this for the billing application that uses userfield ! Actualy it uses “Set userfield” entry from incoming context, and not from outgoing context :frowning:
Is there a way to change this behaviour?
Thanks

Anyone?