WASdev / sample.voice.gateway

Lots of helpful samples to help jumpstart development with the IBM Voice Gateway.
Apache License 2.0
62 stars 113 forks source link

Error when VGW tries to connect to SMS-gateway #220

Open giacomobartoli opened 3 years ago

giacomobartoli commented 3 years ago

Hi, I have the voice gateway and sms gateway both deployed into the same Kubernetes cluster hosted on IBM Cloud. Essentially, I am following those tutorials:

The aim is to trigger Watson Assistant, through voice call, to send a simple sms. I completed succesfully the first tutorial, so now I have a voice assistant deployed on Kubernetes. I also have the sms-gateway deployed on the same cluster.

Within Watson Assistant I have a node with the following action:

 "vgwAction": {
      "command": "vgwActSendSMS",
      "parameters": {
        "message": "This is a test message from Watson"
      }
    }

So when I call the dedicated Twilio number, Watson replies directly to me. Then, I ask to send a message and it enteres the node that contains the vgwActSendSMS command. However, nothing happens and if I check the VGW logs (sip-orchestrator pod) into Kubernetes I have this error:

[ERROR ] CWSGW00126E: A failure occurred when trying to send an SMS message. reason = Error response received from SMS Gateway: java.net.ConnectException: Timeout connecting to [sms-gateway/172.21.220.27:9080] sessionID = d1d28a0a-0923-408a-91a8-211d9019b345 tenantID = sip:+447575742570@169.51.203.203:5060;transport=tcp

It is clear that is a matter of connection parameters. However I cannot find what is wrong in my configuration.

This is the yaml of my sip-orchestrator:

{
                                "name": "SMS_GW_URL",
                                "value": "http://sms-gateway:9080/sms.gateway/smsPipe"
                            },
                            {
                                "name": "ENABLE_INBOUND_SMS",
                                "value": "false"
                            },
                            {
                                "name": "SMS_GW_READ_TIMEOUT",
                                "value": "30000"
                            },
                            {
                                "name": "WEB_HOOK_HOST",
                                "value": "vgwHostName"
                            },
                            {
                                "name": "HTTP_HOST",
                                "value": "localhost"
                            },
                            {
                                "name": "DISABLE_STT_DURING_PLAYBACK",
                                "value": "true"
                            },
                            {
                                "name": "WHITELIST_TO_URI",
                                "value": "my-twilio-phone-number"
                            },
                            {
                                "name": "WATSON_CONVERSATION_READ_TIMEOUT",
                                "value": "5"
                            },
                            {
                                "name": "WATSON_CONVERSATION_CONNECT_TIMEOUT",
                                "value": "5"
                            },
                            {
                                "name": "MEDIA_RELAY_HOST",
                                "value": "localhost:8080"
                            },
                            {
                                "name": "SIP_PORT",
                                "value": "5060"
                            },
                            {
                                "name": "HTTPS_PORT",
                                "value": "9443"
                            },
                            {
                                "name": "HTTP_HOST",
                                "value": "127.0.0.1"
                            },
                            {
                                "name": "WATSON_CONVERSATION_WORKSPACE_ID",
                                "value": "my-skill-id"
                            },
                            {
                                "name": "WATSON_CONVERSATION_USERNAME",
                                "value": "apikey"
                            },
                            {
                                "name": "WATSON_CONVERSATION_PASSWORD",
                                "valueFrom": {
                                    "secretKeyRef": {
                                        "name": "secret-creds",
                                        "key": "WATSON_CONVERSATION_PASSWORD"
                                    }
                                }
                            },
                            {
                                "name": "WATSON_CONVERSATION_URL",
                                "value": "my-watson-url"
                            },
                            {
                                "name": "ENABLE_AUDIT_MESSAGES",
                                "value": "true"
                            },
                            {
                                "name": "ENABLE_TRANSCRIPTION_AUDIT_MESSAGES",
                                "value": "true"
                            },
                            {
                                "name": "LOG_LEVEL",
                                "value": "ALL"
                            }

And this is the yaml configuration of the sms-gateway:

{
    "kind": "Deployment",
    "apiVersion": "apps/v1",
    "metadata": {
        "name": "sms-gateway",
        "creationTimestamp": null,
        "labels": {
            "servoce": "sms-gateway"
        }
    },
    "spec": {
        "replicas": 1,
        "selector": {
            "matchLabels": {
                "service": "sms-gateway"
            }
        },
        "template": {
            "metadata": {
                "creationTimestamp": null,
                "labels": {
                    "service": "sms-gateway"
                }
            },
            "spec": {
                "volumes": [
                    {
                        "name": "secret-certs",
                        "secret": {
                            "secretName": "secret-certs"
                        }
                    }
                ],
                "containers": [
                    {
                        "name": "vgw-sms-gateway",
                        "image": "ibmcom/voice-gateway-sms:latest",
                        "imagePullPolicy": "Always",
                        "ports": [
                            {
                                "containerPort": 9080,
                                "protocol": "TCP"
                            },
                            {
                                "containerPort": 9443,
                                "protocol": "TCP"
                            }
                        ],
                        "env": [
                            {
                                "name": "SMS_PROVIDER_PASSWORD",
                                "value": "my-twilio-token"
                            },
                            {
                                "name": "SMS_PROVIDER_URL",
                                "value": "twilio-endpoint"   
                            },
                            {
                                "name": "SMS_PROVIDER_USERNAME",
                                "value": "my-twilio-user"
                            },
                            {
                                "name": "TENANT_PHONE_NUMBER",
                                "value": "my-twilio-number"
                            },
                            {
                                "name": "TIMEOUT_FOR_SESSION",
                                "value": "3600"
                            },
                            {
                                "name": "WATSON_CONVERSATION_URL",
                                "value": "watson-url"
                            },
                            {
                                "name": "WATSON_CONVERSATION_WORKSPACE_ID",
                                "value": "watons-skill-id"
                            },
                            {
                                "name": "WATSON_CONVERSATION_TOKEN_SERVICE_PROVIDER_URL",
                                "value": "https://iam.cloud.ibm.com/identity/token"
                            },
                            {
                                "name": "LOG_LEVEL",
                                "value": "info"
                            },
                            {
                                "name": "ENABLE_TRANSCRIPTION_MESSAGES",
                                "value": "false"
                            }
                        ]

                    }
                ],
                "restartPolicy": "Always"
            }
        },
        "strategy": {
            "type": "Recreate"
        }
    },
    "status": {}
}

Could you explain why the VGW does not connect the SMS-Gateway?

Thanks in advance,