Dialogflow-fulfillment-nodejs: TELEPHONY Transfer response

Created on 16 Aug 2018  路  13Comments  路  Source: dialogflow/dialogflow-fulfillment-nodejs

Is there way I can send back Telephony's "transfer" response using webhook? I cannot find any reference about Telephony platform from document.. It'd be great if you could point me to the guide whitepaper. If not, just let me know how to send back transfer response.
I appreciate the help.

Feature Request

Most helpful comment

I was able to achieve a call transfer from the fulfillment code by:

DESIGNER

  • creating an Intent in the designer for the transfer
  • Set a Default Response text
  • Set a Telephony Response for the Call Transfer with the number
  • Make sure the _"Use response from the DEFAULT tab as the first response"_ is OFF
  • Create an Event on the intent (e.g. "my-transfer-event")

FULFILLMENT

// set a dummy default intent
// the designer response text is used but we need this!? 
// otherwise we get default response errors in the fulfillment code/logs
agent.add("dummy default response that is ignored"); 

// call the event
agent.setFollowupEvent("my-transfer-event");

// call should be transferred using the Intent transfer settings (does for me)

All 13 comments

I would also like to know this as I want to execute my own code simultaneously.

Is there any news on programatically transferring calls using the phone gateway?

On this reference page you will see the TelephonyTransferCall method

On this reference page you will see the TelephonyTransferCall method

Is this possible to use in fulfilment code? I can't find a way?

I was able to achieve a call transfer from the fulfillment code by:

DESIGNER

  • creating an Intent in the designer for the transfer
  • Set a Default Response text
  • Set a Telephony Response for the Call Transfer with the number
  • Make sure the _"Use response from the DEFAULT tab as the first response"_ is OFF
  • Create an Event on the intent (e.g. "my-transfer-event")

FULFILLMENT

// set a dummy default intent
// the designer response text is used but we need this!? 
// otherwise we get default response errors in the fulfillment code/logs
agent.add("dummy default response that is ignored"); 

// call the event
agent.setFollowupEvent("my-transfer-event");

// call should be transferred using the Intent transfer settings (does for me)

What version of dialogflow-fulfillment are you using @LukeHartcher - 0.4.1, 0.5.0, 0.6.0?

What version of dialogflow-fulfillment are you using @LukeHartcher - 0.4.1, 0.5.0, 0.6.0?

package.json

  "dependencies": {
    "actions-on-google": "^2.2.0",
    "firebase-admin": "^5.13.1",
    "firebase-functions": "^2.0.2",
    "dialogflow": "^0.6.0",
    "dialogflow-fulfillment": "^0.5.0"
  }

It was a new agent/intent that I created yesterday, so just the defaults.

Thanks @LukeHartcher! I've been having some trouble with setFollowupContext. I'll try the steps you've taken.

Hope I have understood the question correctly but to make a telephony transfer from fulfillment code I use this structure
const bodyObject = { "fulfillmentMessages": [ { "platform": "TELEPHONY", "telephonySynthesizeSpeech": { "ssml": "<speak>Whatever message you want to say to the caller<break time=0.2s />Goodbye</speak>" } }, { "platform": "TELEPHONY", "telephonyTransferCall": { "phoneNumber": "+1989XXXXXX" //E.164 format phone number, US only at this point } }, { "text": { "text": [ "Some text if your fulfillment code is called from a text based service" ] } } ] };

This will play the announcement to the caller first and then transfer the call (Only works with PhoneGateway, doesn't work if you SIP trunk into Dialogflow.
I send bodyObject back to Dialogflow as part of my response.

Hope that helps, apologies if I missed the point of the question.

Using @jphorsfield 's solution, Dialogflow will play the message and then transfer the call. However, the transfer occurs before the message finishes and I hear it overlapping the destination call.

Hope I have understood the question correctly but to make a telephony transfer from fulfillment code I use this structure
const bodyObject = { "fulfillmentMessages": [ { "platform": "TELEPHONY", "telephonySynthesizeSpeech": { "ssml": "<speak>Whatever message you want to say to the caller<break time=0.2s />Goodbye</speak>" } }, { "platform": "TELEPHONY", "telephonyTransferCall": { "phoneNumber": "+1989XXXXXX" //E.164 format phone number, US only at this point } }, { "text": { "text": [ "Some text if your fulfillment code is called from a text based service" ] } } ] };

This will play the announcement to the caller first and then transfer the call (Only works with PhoneGateway, doesn't work if you SIP trunk into Dialogflow.
I send bodyObject back to Dialogflow as part of my response.

Hope that helps, apologies if I missed the point of the question.

Hello, do you use this object with agent.add in the transfer function?

Is it working now?

To use this in fulfillment code, do this

  function someIntentHandler() {
    let responseJson = {};
    responseJson.fulfillmentText = "";
    let richResponses = [
      {
        "text": {
          "text": [
            "This text  will be returned to the user if it is not a phone call."
          ]
        }
      },
      {
        "platform": "TELEPHONY",
        "telephonyTransferCall": {
          "phoneNumber": "+19998887777"
        }
      }
    ];

    responseJson.fulfillmentMessages = richResponses;
    response.json(responseJson);
  }

this will transfer the call to +19998887777.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zamil89 picture zamil89  路  4Comments

malikasinger1 picture malikasinger1  路  7Comments

SiddAjmera picture SiddAjmera  路  8Comments

KirillMoizik picture KirillMoizik  路  3Comments

jzxhuang picture jzxhuang  路  6Comments