Hi I am still trying to wrap my head around Twilio's API. Could someone please provide some guidance on this issue? I will be extremely grateful!:
I am attempting to execute the following command in Python Django:
for customerServiceRep in availCustomerServiceReps:
client = TwilioRestClient(account_sid, auth_token)
call = client.calls.create(to="+1" + str(int(customerServiceRep)),
Twilio evangelist here.
I think your question is pretty close to this one.
Basically you're going to need to use the
StatusCallback parameter to have Twilio tell your app what the result of the outbound call is. You can either dial everyone at once like you show above, then when someone answers just use the REST API to terminate all of the other outbound calls, or you can make one outbound call at a time, wait for Twilio to call the StatusCallback URL and then decide if you need to call the next agent or not.
Hope that helps.