;Send calls from this DID to IVR
exten => 18005555555,1,Answer
exten => 18005555555,2,NoOp(Inbound Call on ${EXTEN} from ${CALLERID(num)})
exten => 18005555555,3,Goto(s,1)
I primarily use SIP no IAX. If you add this second line to your inbound dialplan you will be able to see what number it arrived on and where it orginated in the asterisk console.
If you want to log this information you may want to check out the log command rather than noop
http://www.voip-info.org/wiki/view/Asterisk+cmd+Log
If you want something custom you should read up on writing AGI. I've always written my AGI scripts using perl. Here is a link to the cpan module for Asterisk::AGI
I was going to link you to it but I don't have enough rep to post more than one link just google, "perl cpan asterisk agi"
Hope this helps