Start Server

Starting from version 3.0, running ASR requires the Oracle Java JDK 17 or higher 64-bit version. If this is not your default installation, you can indicate the path from where Java is installed in the server startup command:

/opt/cpqd/asr/server/bin/start-server [--foreground | --background] <path da versão java>

To fix the startup script, change the asr-server.service file, including the correct path of the desired Java version.

sudo systemctl edit asr-server

Include Java version path in the ExecStart variable

ExecStart=/opt/cpqd/asr/server/bin/start-server --foreground <path da versão do java desejado>

Use the following procedure to start the ASR server only when it is not running. When the server is running, it will have no effect.

1) Open a console on the machine where the ASR server has been installed

2) Verify ASR server status

Verify the ASR server status using the following command:

sudo systemctl status asr-server

The following example shows an idle ASR server:

$ sudo systemctl status asr-server

● asr-server.service - Speech Recognition Server
   Loaded: loaded (/usr/lib/systemd/system/asr-server.service; disabled; vendor preset: disabled)
   Active: inactive (dead)
     Docs: https://speechweb.cpqd.com.br/asr/docs/latest

3) Start the ASR server

If the ASR server is stopped, it can be started with the following command:

sudo systemctl start asr-server

4) Verify ASR server status

Verify the ASR server status using the following command:

sudo systemctl status asr-server

The following example shows an ASR server that is running:

$ sudo systemctl status asr-server

● asr-server.service - Speech Recognition Server
   Loaded: loaded (/usr/lib/systemd/system/asr-server.service; disabled; vendor preset: disabled)
   Active: active (running) since Thu 2018-04-12 13:11:26 UTC; 16s ago
     Docs: https://speechweb.cpqd.com.br/asr/docs/latest
 Main PID: 1380 (java)
   CGroup: /docker/c4cbfc49230515553eced80d3bc4b229fe478b06aa0f3bd503cd1a3ed1cd53b3/system.slice/asr-server.service
           └─1380 java -Xms128m -Xmx256m -XX:MaxDirectMemorySize=512m -XX:ErrorFile=/var/log/cpqd/asr/server/hs_err_pid%p.log -Dcpqd.asr.wrapper.file=/opt/cpqd/asr/config/server/asr-wrapper.properties -Dcpqd.sessionlog.config.fi...

Apr 12 13:11:26 c4cbfc492305 systemd[1]: Started Speech Recognition Server.
Apr 12 13:11:26 c4cbfc492305 systemd[1]: Starting Speech Recognition Server...
Apr 12 13:11:26 c4cbfc492305 start-server[1380]: Starting process asr-server...

5) Wait for the ASR server to start

Wait for the ASR server to finish the startup process, using the following command:

cpqdasr-status

The command should return only after the server is ready to receive requests.

Warning

When using free speech recognition, ASR startup can take a few minutes (usually less than 5) and the return of the above command will be displayed only after startup is complete.

The result must be as shown below, with the most important lines highlighted:

$ cpqdasr-status
Service Status: STARTED

    Health Check:
    {
            "components": {
                    "asrEngine": {
                            "details": {
                                    "licenseStatus": "ONLINE",
                                    "version": "3.9.0"
                            },
                            "status": "UP"
                    },
                    "diskSpace": {
                            "details": {
                                    "exists": true,
                                    "free": 171307741184,
                                    "threshold": 10485760,
                                    "total": 269490393088
                            },
                            "status": "UP"
                    },
                    "grpcChannel": {
                            "status": "UP"
                    },
                    "licenseManager": {
                            "status": "UP"
                    },
                    "ping": {
                            "status": "UP"
                    }
            },
            "status": "UP"
    }

6) Verify the log and confirm the ASR server startup

Verify if the ASR server has started up successfully, using the log /var/log/cpqd/asr/server/asr-server.log. Run the following command:

tail -F /var/log/cpqd/asr/server/asr-server.log

Server startup is confirmed by the message Server started, as shown in the example:

$ tail -F /var/log/cpqd/asr/server/asr-server.log

WARN   [18-04-16 16:40:49.073] [main] b.c.c.a.s.AsrServerApplication [ ] Starting ASR Server...
WARN   [18-04-16 16:40:49.076] [main] b.c.c.a.AsrEngine [ ] Loading ASR: /opt/cpqd/asr/engine/lib/libcpqd_asr.so, /opt/cpqd/asr/config/engine/engine.conf
WARN   [18-04-16 16:40:56.218] [main] b.c.c.a.AsrEngine [ ] [0] ASR engine created (3.2.0)
WARN   [18-04-16 16:40:56.218] [main] b.c.c.a.s.AsrServerApplication [ ] Server started after 241 secs