Peername from IP

Hi,

Due to some device constrains I need to retrieve the peername registered in Asterisk from the IP as my device does not accept the sip INVITE message with IP, it only accepts INVITEs with usernames, so before dialing I need to convert the IP to the specific name and then make the dial. Is there any way to retrieve the peername from the IP?

Thank you very much

Could You explain Your scenario? Which IP should be matched to a peername? And: How do You get the IP-address which should be looked up against a peername?
BTW: IP-Addresses and peernames need not to match uniquely.