Index pairing with Alexander-Spanier cocycles