I have used cloud functions for my action. Based on the agent resource type, I am sending the response back. As per the guidelines provided in the document i have changed the Twilio integration.
After deployment when i check the agent.requestSource type it returns null. Earlier it returns 'twilio' or 'GOOGLE_ASSISTANT' but now it returns null.
exports.dialogflowFirebaseFulfillment = functions.https.onRequest(
(request, response) => {
console.log("Dialogflow Request body: ", request.body);
const agent = new WebhookClient({ request, response });
console.log("agent originalRequest", agent.originalRequest);
console.log("Agent resource", agent.requestSource);
const conv = agent.conv();
let sender;
let receiver;
if (agent.requestSource === "twilio") {
const requestBody = request.body;
sender = requestBody.originalDetectIntentRequest.payload.data.From;
receiver = requestBody.originalDetectIntentRequest.payload.data.To;
}
........