dialogflow-fulfillment-nodejs
dialogflow-fulfillment-nodejs copied to clipboard
How do i get caller phone number
I can redirect call to some other number but I cannot get the number of my user calling me, what an unfortunate, all I want is to make a list of phone numbers who is calling me on dialogflow but seems getting caller phone number is not possible
There are work around for this problem:
-
I don't give dialogflow phone number in marketing at all, and I give a twilio phone number and as soon as someone call to that number i note down the caller phone number and redirect call to dialogflow phone number so my customer start talking to dialogflow. What are you doing dialogflow you are making your customers to give business to other providers while you can provide these features without any problem, just give caller phone number in request object
-
get phone number from caller through slot filling, but there are two problems in this workaround, one it is difficult sometimes to write down phone number quickly and you miss it and you struggle to make your phone number understand by nlp, second it doesn't make sense if someone is calling you and entering the same number again, it is similar to when a friend call you and in the end of talk ask you to save his number and you ask hey what is your number, your friend will of course reply goto call logs my number is there I just calling you from my very own number
Please take this issue as feature request, or if that feature already exists and unaware of it let me know
Other people if you found my workaround useful thumbs up
https://stackoverflow.com/questions/53446468/how-to-access-caller-phone-number-in-google-dialogflow-phone-gateway/59879712#59879712
Its not just me, other people facing this problem too
@malikasinger1 - I had similar issue and the article below helped me. https://stackoverflow.com/questions/60620275/how-to-get-the-caller-id-of-caller-using-originaldetectintentrequest-api-of-goog
@mInzamamMalik If you're still facing the issue. Since you are using the twilio integration with dialogflow. I assume you must be using the studio flow in twilio to connect to the dialogflow virtual agent as detailed in this onboarding guide. You can add the incoming phone number as a parameter, which would be {{trigger.call.From}}. It will then show up as a parameter in dialogflow. Hope this helps you. Cheers!
Thank you @jaydenlewis111. This has really helped me. In case you are wondering how to do it exactly. Just do the following in the Twilio Studio:
You will then find a parameter in the JSON payload when you call WebHooks from Dialogflow CX:
{
"detectIntentResponseId": "afc6b68f-befb-46c9-a3fc-adfasdfasdf",
"intentInfo": {
"lastMatchedIntent": "projects/ccai-development/locations/europe-west3/agents/abcabcabc/intents/00000000-0000-0000-0000-000000000000",
"displayName": "Default Welcome Intent",
"confidence": 0.8262407
},
"pageInfo": {
"currentPage": "projects/ccai-development/locations/europe-west3/agents/abcabcabc/flows/00000000-0000-0000-0000-000000000000/pages/START_PAGE",
"displayName": "Start Page"
},
"sessionInfo": {
"session": "projects/ccai-development/locations/europe-west3/agents/abcabcabc/environments/draft/sessions/abcabcabc",
"parameters": {
"From": "+4912345678810"
}
},
"fulfillmentInfo": {
"tag": "getCallerId"
},
"messages": [
{
"text": {
"text": [
"Hallo!"
],
"redactedText": [
"Hallo!"
]
},
"responseType": "HANDLER_PROMPT",
"source": "VIRTUAL_AGENT"
}
],
"transcript": "Das ist ein Test",
"languageCode": "de"
}