A 1994 law mandated telecommunication companies build surveillance capabilities into their networks allowing the FBI to link field offices and its headquarters in Quantico , Va . , to national telephone companies and Internet firms .