It is actually interesting that your TargetSelected returns .GA . Are you using Agent Groups or Virtual Agent Groups?
You are using TargetSelected and according to the manual for 6.5:
TargetSelected:
This function returns the DN and the switch name of the target to which the interaction was routed definitively; the result is returned in an apparent highlevel target format (Name@StatServerName.Type). If the interaction has not yet been routed definitively, the function returns the empty string.
The Type of the target selected is one of the following high level Types as described in the Framework 6.5 Stat Server Userfs Guide: Agent, Place, Queue, RoutePoint, GroupAgents, or GroupPlaces.
What you want to use is TargetObjectSelected:
TargetObjectSelected
Parameters: none
Return value type: STRING
This function returns the highlevel target to which the interaction was routed definitively. If the interaction has not yet been routed definitively, the function returns the empty string.
If that still does not get you what you want (depends what highlevel target you are using), then try:
I have never done this, but I heard that use_agentid=true for URS option might do the trick, because it actually tells PBX to route to agent and not DN, but BE VERY VERY CAREFUL! It might not work depending on your PBX, so test it first.
I would check TargetObjectSelected[] first.