Problems Fetching Grammars
Capacity Private Cloud, including the Media Server, can fetch grammars from a local filesystem or across a network using URIs such as file:// or http://. Serving grammars over HTTP from an application or web server is generally the better choice, because it lets the platform take advantage of HTTP caching and keeps grammar management in one place rather than scattered across hosts.
When a grammar fails to load, the cause almost always falls into one of three categories: the grammar URI is not reachable, the connection is HTTPS and TLS trust is not configured, or the web server is returning the wrong MIME type. The sections below cover each in turn.
Confirm the grammar is reachable
If you are serving grammars from a web server, first confirm the server is actually configured to serve your grammar files. The fastest way to isolate a fetch problem is to request the grammar URI yourself, exactly as the platform would — open it in a web browser, or use a command-line tool such as curl or wget, from a host with the same network access as your deployment. If you cannot retrieve the file that way, the problem is in the web server or network path, not in the grammar or the speech engine.
Fetching grammars over HTTPS
Grammars can be fetched over HTTPS as well as HTTP. When you use HTTPS, the platform must be able to establish TLS trust with the server hosting the grammar, which is the most common reason an HTTPS grammar URI fails where the equivalent HTTP URI would succeed. The relevant settings — notably SSL_VERIFYPEER and CERTIFICATE_AUTHORITY_FILE — are documented in Speech Client Configuration (client_property.conf). Use those to point the platform at the correct certificate authority and to control how strictly the server certificate is verified.
MIME types
The SRGS specification defines the media types a server should return when grammars are referenced over HTTP:
- ABNF grammars should use a media type of application/srgs
- GrXML grammars should use a media type of application/srgs+xml
Returning the wrong content type is a subtle but common cause of fetch failures — over HTTP or when loading a grammar via MRCP. The declared type is trusted: if a server reports application/srgs+xml for what is actually an ABNF grammar, the platform takes the server at its word, assumes the grammar is GrXML, and fails when it tries to parse it as XML. Configure your web server to return the correct media type for each grammar format you host.
If no content type is specified — or one the platform does not recognize — it falls back to auto-detecting the grammar format. Auto-detection is a safety net, not a substitute for correct server configuration; set the proper media type whenever you can.
