GitHubContribute in GitHub: Edit online

External codec services

Starting with IBM Voice Gateway Version 1.0.3, users can deploy external microservices to support more audio codecs for calls handled by IBM Voice Gateway. These microservices expose a websocket interface that can be used to establish a connection with IBM Voice Gateway for audio encoding and decoding purposes. The list of currently supported external codec services includes:

Adding G.729 codec support to an existing IBM Voice Gateway deployment

For an on-premise installation, you can deploy the G.729 Codec Service as part of your IBM Voice Gateway environment on Docker. The G.729 Codec Service is packaged as a separate Docker image that you configure and deploy along with the core SIP Orchestrator and Media Relay images.

Before you begin

+ Familiarize yourself with Voice Gateway deployment options and deploy a basic environment as described in [Getting started with Voice Gateway](https://www.ibm.com/docs/en/voice-gateway?topic=gateway-getting-started)

Deploying on Docker Engine

For complete setup information for getting started with Docker deployments, see Deploying Voice Gateway on Docker

  1. In an existing docker-compose.yml file, add a new docker container service section for the g729.codec.service section:

    services:
      sip.orchestrator:
        ...
      media.relay:
        ...
      g729.codec.service:
        image: icr.io/voice-gateway/codec-g729:latest
    
  2. In the same file, under the Media Relay configuration, define the EXTERNAL_AUDIO_TRANSFORMS environment variable. As its value specify a websocket URI that points to the G.729 Codec service. This variable specifies which codec services the Media Relay should use for audio encoding and decoding.

    # docker-compose.yml
    services:
      media.relay:
       ...
        environment:
          - SDP_ADDRESS=${EXTERNAL_IP}
          ...
          - EXTERNAL_AUDIO_TRANSFORMS=ws://g729.codec.service:9001
    
  3. Start the containers by running the following command:

    docker-compose up
    
  4. Test with a SIP phone that supports the G.729 codec. When you configure the SIP client, keep the following considerations in mind:

    • If you run the SIP client on the same machine as Voice Gateway, be sure to configure the SIP client to use a port other than 5060 (e.g. 5062) to avoid port conflicts.
    • Configure the SIP client to listen on an IP address that Voice Gateway can route to. For example, your SIP client might be configured by default to listen on a loopback address, and you'll need to change this setting.
    • Disable IPv6 in the SIP client.

    To test Voice Gateway, call the following SIP URI from your SIP phone:

    sip:watson@<IP address of Voice Gateway>:5060
    

Deploying on Kubernetes

For complete setup information for getting started with Kubernetes deployments, see Deploying Voice Gateway to a Kubernetes cluster.

  1. In an existing deploy.yml file, add a new container section for the vgw-codec-g729-service section:

    # deploy.yaml
    kind: Deployment
    containers:
      - name: vgw-media-relay
        image: icr.io/voice-gateway/media-relay:latest
      ...
      - name: vgw-codec-g729-service
        image: icr.io/voice-gateway/codec-g729:latest
      ...
    
  2. In the same file, under the Media Relay configuration, define the EXTERNAL_AUDIO_TRANSFORMS environment variable. As its value specify a websocket URI that points to the G.729 Codec service. This variable specifies which codec services the Media Relay should use for audio encoding and decoding.

    # deploy.yaml
    kind: Deployment
    containers:
       - name: vgw-media-relay
           image: icr.io/voice-gateway/media-relay:latest
           ports:
           - containerPort: 8080
             hostPort: 8080
             protocol: TCP
           lifecycle:
             preStop:
               exec:
                 command:
                 - "/opt/quiesce.sh"
           env:
           - name: SDP_ADDRESS
           ...
           - name: EXTERNAL_AUDIO_TRANSFORMS
             value: 'ws://localhost:9001'
    
  3. Deploy your Kubernetes cluster by specifying your deployment configuration file on the kubectl create command.

     kubectl create -f deploy.yaml
    
  4. Verify that your cluster is running with the kubectl get pods command.

    The command displays the status of all pods in your cluster.

    >kubectl get pods
    NAME                   READY     STATUS    RESTARTS   AGE
    vgw-4151379926-7xbz5   2/2       Running   0          6s
    
  5. Test with a SIP phone that supports the G.729 codec. When you configure the SIP client, keep the following considerations in mind:

    • If you run the SIP client on the same machine as Voice Gateway, be sure to configure the SIP client to use a port other than 5060 (e.g. 5062) to avoid port conflicts.
    • Configure the SIP client to listen on an IP address that Voice Gateway can route to. For example, your SIP client might be configured by default to listen on a loopback address, and you'll need to change this setting.
    • Disable IPv6 in the SIP client.

    To test Voice Gateway, call the following SIP URI from your SIP phone:

    sip:watson@<IP address of Voice Gateway>:5060