Fixed variable reference issue (and bug).  Copying callid to store its state before incrementing