Australia and Indonesia have agreed to negotiate a new security pact to replace one that was scrapped in 1999 .