Just create an AGI and add it to the Queue() call:
; Sales Queue
exten => queuein,1,Verbose(Entering Sales Queue)
exten => queuein,n,Read(_custid,pls-entr-cust-id,4)
exten => queuein,n,Queue(sales,,,300,connect_script)
exten => queuein,n,Hangup()
In your AGI you should be able to read the custid variable, and I’m pretty sure there is also a QUEUEMEMBER variable that’s set with the agent extension (not sure of the variable name, that’s just off the top of my head).