Exhibit 5.1 [TESTA, HURWITZ & THIBEAULT, LLP LETTERHEAD] August 27, 1999 Excel Switching Corporation 255 Independence Drive Hyannis, MA 02601 Re: REGISTRATION STATEMENT ON FORM S-3 RELATING TO THE REGISTRATION OF 924,458 SHARES OF COMMON STOCK Dear Sir or Madam: Reference is made to the above-captioned Registration Statement on Form S-3 (the "Registration Statement") filed by Excel Switching Corporation (the "Company") on the date hereof with the Securities and Exchange Commission under the Securities Act of 1933, as amended, relating to an aggregate of 924,458 shares of Common Stock, par value $.01 per share, of the Company (the "Shares"). We have reviewed the corporate proceedings taken by the Board of Directors of the Company with respect to the authorization and issuance of the Shares. We have also examined and relied upon originals or copies, certified or otherwise authenticated to our satisfaction, of all corporate records, documents, agreements or other instruments of the Company and have made all investigations of law and have discussed with the Company's officers all questions of fact that we have deemed necessary or appropriate. We are only members of the bar of the Commonwealth of Massachusetts and are not expert in, and express no opinion regarding, the laws of any jurisdiction other than the Commonwealth of Massachusetts, the General Corporation Law of the State of Delaware and the United States of America. Based on the foregoing, we are of the opinion that the Shares are validly issued, fully paid and non-assessable. We hereby consent to the filing of this opinion as Exhibit 5.1 to the Registration Statement and further consent to the use of our name wherever appearing in the Registration Statement and any amendments thereto. Very truly yours, /s/ Testa, Hurwitz & Thibeault, LLP TESTA, HURWITZ & THIBEAULT, LLP