Hi James,
If you are calling the transaction from irpt page, then you can use the Illuminator service to get the hostname. I am not sure about the SID.
Please go through the link below for the various Illuminator services
Hope you get some pointers from this!!
Regards,
Anuj