Solid and liquid AgI at high pressure and high temperature: a x-ray absoprtion spectroscopy study