Reputation: 6090
I'm working on configuring an app to call a user automatically. Upon calling them they're prompted to press 1 to talk to an agent. Once they press 1, the call is routed to our call center. All this works great. The problem is that the call center is receiving a call from the Twilio number instead of the user's phone number which makes it really difficult for them to track who they're talking to.
Does anyone know if you can transfer a call with Twilio using the user's number that was originally dialed instead of your Twilio number?
Here's my action on my rails controller that fires after the user presses 1 that connects them to the call center:
def connect
number = params[:call_center_number]
response = "
<Response>
<Say>Please hold while we try to connect you to the next available representative.</Say>
<Dial>
<Number
statusCallbackEvent='initiated ringing answered completed'
statusCallback='http://example.com/events'
statusCallbackMethod='POST'>+1#{number}
</Number>
</Dial>
</Response>"
render text: response
end
Upvotes: 0
Views: 83
Reputation: 2784
According to the documentation, you can use the callerId
attribute (https://www.twilio.com/docs/api/twiml/dial#attributes-caller-id)
<Response>
<Say>Please hold while we try to connect you to the next available representative.</Say>
<Dial callerId=#{NUMBER_TO_DISPLAY_ON_CALLERID}>
<Number>+1#{number}</Number>
</Dial>
</Response>
Upvotes: 1