rewritten prototype code to jquery + modified Plivo Answer callback logic