Spy-accused former soldier Daniel Khalife had a 30-minute phone conversation with an Iranian agent while posted at a US army base, a court has heard.