I set up a Twilio Flow to collect some data from the caller, using "Gather" widgets and connect the caller to FLEX agent.
Every time someone calls and gets connected, Twilio creates two separate records in its "Calls" log:
- Call, initiated by the caller dialing Twilio number
- Call, initiated in the Flow, connecting the caller to FLEX agent
Neither of the logs give me data points that would allow me to connect these two calls and record them as a single event.
I tried passing {{widgets.SendCallToAgent.TaskSid}}
from the Twilio Flow as a parameter to the function that posts caller's input to the database, but it returned no value.
The only reference I could find that pointed me to the original call from the second call log was in the request URL under Request Inspector section of Call Details screen. CustomerCallSid key points to the call SID of the initial call.
http://torch.taskrouter.prod.twilio.com:19610/CallEvents?WorkspaceSid=WSXXXXXXXXXX&TaskSid=WTXXXXXXXXXXd&ReservationSid=WRXXXXXXXXXX&WorkerSid=WKXXXXXXXXXX&CustomerCallSid=CAXXXXXXXXXX
Is there a way to get CustomerCallSid as a separate data point in the flow or in the logs?
Are there any other common data points to relate these two records?