It quite depends on the version of Asterisk you are using.... you can usually reger to a channel using differnt names (e.g. Agent/100, Local/100@from-internal, SIP/100...) so it's a matter of finding out which one works best with your Asterisk.
It should understand the agents as well - how do you set them up? because if you set up using e.g. ADDMEMBER there is no way for QM to guess who could they be.