Are you certain the reasons codes are not being attached? How have you verified this? If its through CC Pulse or CCA you may not have configured the filters on the stat server to interpret the reason codes.
Have you checked the Tserver logs, as my understanding is that you attach data with a Key of _REASON. If that key value pair is there then your problem is not in the code. if it is not there then I suggest you use the Genesys softphone and attach the KV pair to prove that it will work first as that requires no programming effort.