I have an application that does the following.
- When the client calls a twilio number
- my app will be notified, and list of numbers are sent back to be dialed by twilio depending on the agent's availability.
- Then depending on the first call's status, if answered => success, otherwise try another agent's number.
First test:
$twiml = new Twiml(); $dial = $twiml->dial(); $dial->number('XXXXXXX'); // Agent A $dial->number('XXXXXXX'); // Agent B
=> The problem with this version is that all agents are called simultaneously. Don't want that.
Checking call status:
$twiml = new Twiml(); $twiml->dial('XXXXXXXXX', ['action' => 'https://myapp.dev/xml/logger', 'method' => 'POST', 'statusCallbackEvent' =>'answered completed']); // Log file .. 'CallStatus' => 'completed', ..
=> The call status is always completed even if the agent has rejected the call
Is there a way to implement my application need using twilio Voice SDK without using the complex Taskrouter API ?