Girib10
Girib10

Reputation: 3

Get SIP Invite Header on Watson Voice Agent

I'm doing an application in Java that connects a phone call to Watson Voice Agent to my user via Twilio and i need to pass some information to the Voice Agent and make it available to the assistant. I'm passing the information on the sip invite header but I can't get the information on the assistant dialog. My Twilio call class:

public String callPhone(String to, String from,String data)throws URISyntaxException{
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

        Call call = Call.creator(
                new com.twilio.type.PhoneNumber(to),
                new com.twilio.type.PhoneNumber(from),
                new URI("https://handler.twilio.com/twiml/xxxx?data_sent="+data))
                .create();

        return call.getSid();
    }

My TwinML Bin code:

<?xml version="1.0" encoding="UTF-8"?>
<Response>
  <Dial>
    <Sip>sip:{{From}}@us-south.voiceagent.cloud.ibm.com?X-data={{data_sent}}</Sip>
  </Dial\>
</Response>

In my Voice Agent config I put the "Custom SIP INVITE header" as "data" (without quotes) and in the Assistant I try to access $vgwSIPCustomInviteHeader but the Voice Agent doesn't say anything where this value should be.

Upvotes: 0

Views: 275

Answers (2)

Team GIFAmp
Team GIFAmp

Reputation: 1

Just checking does this still work, i seem to get no value in that variable $vgwSIPCustomInviteHeader

Upvotes: 0

Girib10
Girib10

Reputation: 3

I've already solved it, for some reason if I use the header parameter with "_" the TwinML Bin doesn't seem to be able to send the value correctly, I changed the parameter to "dataSent" and now it works fine.

Upvotes: 0

Related Questions