1
votes

I have an application that does the following.

  1. When the client calls a twilio number
  2. my app will be notified, and list of numbers are sent back to be dialed by twilio depending on the agent's availability.
  3. Then depending on the first call's status, if answered => success, otherwise try another agent's number.

Sequence Diagram

  • 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 ?

1

1 Answers

0
votes

Twilio developer evangelist here.

I think you need to check the DialCallStatus parameter which will be the status of the call leg you are making with the <Dial> rather than the status of the original call.

Let me know if that helps at all.