Pakistan played a key role in mediating a two-week US-Iran ceasefire, with talks set in Islamabad for a long-term deal.