Wrong CDR custom field with call forward

Hi.
This is my scenario.
Number AAAAAAAAA calls BBBBBBBBB. Asterisk calls CCCCCCCCC and bridges with AAAAAAAAA. All that is working. I set up ForkCDR to see two CDR for billing but variables are being set up wrong.

In my dialplan:
INCOMING CALL:
– Executing [BBBBBBBBB@cfw-uncond:28] Set(“SIP/Proxy-0011acc9”, “CDR(UserField)=PLmobile-carrierlovo-fromtrunk-tocl00001-fromnumAAAAAAAAA-tonum717776611-fromsip0-tosip100001-fromip0.0.0.0-monin0-monout0-codec”) in new stack
– Executing [BBBBBBBBB@cfw-uncond:29] Set(“SIP/Proxy-0011acc9”, “CDR(custom_type)=PL*mobile”) in new stack
– Executing [BBBBBBBBB@cfw-uncond:30] Set(“SIP/Proxy-0011acc9”, “CDR(custom_carrier)=lovo”) in new stack
– Executing [BBBBBBBBB@cfw-uncond:31] Set(“SIP/Proxy-0011acc9”, “CDR(custom_from)=trunk”) in new stack
– Executing [BBBBBBBBB@cfw-uncond:32] Set(“SIP/Proxy-0011acc9”, “CDR(custom_to)=cl00001”) in new stack
– Executing [BBBBBBBBB@cfw-uncond:33] Set(“SIP/Proxy-0011acc9”, “CDR(custom_fromnum)=AAAAAAAAA”) in new stack
– Executing [BBBBBBBBB@cfw-uncond:34] Set(“SIP/Proxy-0011acc9”, “CDR(custom_tonum)=BBBBBBBBB”) in new stack
– Executing [BBBBBBBBB@cfw-uncond:35] ForkCDR(“SIP/Proxy-0011acc9”, “w”) in new stack
– Executing [BBBBBBBBB@cfw-uncond:36] Set(“SIP/Proxy-0011acc9”, “fromsip=100001”) in new stack
– Executing [BBBBBBBBB@cfw-uncond:37] Set(“SIP/Proxy-0011acc9”, “custom_calltype=cfw”) in new stack

OUTGOING CALL:
– Executing [s@hangup-functions:10] Set(“SIP/Proxy-0011acc9”, “CDR(UserField)=PLmobile-carrierglobitel-fromcl00001-totrunk-fromnum537370999-tonumCCCCCCCCC-fromsip100001-tosip0-fromipxxxx:5060-monin0-monout0-codecalaw-cost0-tariffflat-hangupcause0") in new stack
– Executing [s@hangup-functions:11] Set(“SIP/Proxy-0011acc9”, "CDR(custom_type)=PL
mobile”) in new stack
– Executing [s@hangup-functions:12] Set(“SIP/Proxy-0011acc9”, “CDR(custom_carrier)=globitel”) in new stack
– Executing [s@hangup-functions:13] Set(“SIP/Proxy-0011acc9”, “CDR(custom_from)=cl00001”) in new stack
– Executing [s@hangup-functions:14] Set(“SIP/Proxy-0011acc9”, “CDR(custom_to)=trunk”) in new stack
– Executing [s@hangup-functions:15] Set(“SIP/Proxy-0011acc9”, “CDR(custom_fromnum)=AAAAAAAAA”) in new stack
– Executing [s@hangup-functions:16] Set(“SIP/Proxy-0011acc9”, “CDR(custom_tonum)=CCCCCCCCC”) in new stack
– Executing [s@hangup-functions:17] Set(“SIP/Proxy-0011acc9”, “CDR(custom_fromsip)=100001”) in new stack
– Executing [s@hangup-functions:18] Set(“SIP/Proxy-0011acc9”, “CDR(custom_calltype)=cfw”) in new stack

All above seems ok. But in SQL it is reversed somehow:

CALL1:
UserField - PLmobile-carrierglobitel-fromcl00001-totrunk-fromnumAAAAAAAAA-tonumCCCCCCCCC-fromsip100001-tosip0-fromipxxx:5060-monin0-monout0-codecalaw-cost0-tariffflat-hangupcause*0
custom_carrier - lovo (should be globitel)
custom_from - trunk (should be cl00001)
custom_to - cl00001 (should be trunk)
etc…
Print screen from SQL here -> http://tancula.net/cdrs.png