satej kumar sahu
satej kumar sahu

Reputation: 309

Twilio Call hangs up after moving call from one queue to another

When I move a call from one queue to another and then connect to it from an agent, the call hangs up after a few seconds of connection.

Please let me know as to what could be the issue.

Upvotes: 0

Views: 358

Answers (2)

satej kumar sahu
satej kumar sahu

Reputation: 309

Below is sample code to reproduce my issue: Its implemented using Codeigniter framework.

<?php
class Test_queue extends CI_Controller {
    function test()
    {
        $action = site_url('test_queue/action');
        $wait = site_url('test_queue/wait');

        echo <<<XML
    <?xml version="1.0" encoding="UTF-8"?>
    <Response>
        <Enqueue method="GET" waitUrlMethod="GET" action="$action" waitUrl="$wait">Queue Demo</Enqueue>
    </Response>
    XML;
    }

    function wait()
    {
        echo <<<XML
<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Say>
        You are about to leave queue Queue Demo
    </Say>
    <Leave />
</Response>
XML;
    }

    function action()
    {
        $action = site_url('test_queue/second_action');
        $wait = site_url('test_queue/second_wait');

        echo <<<XML
<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Enqueue method="GET" waitUrlMethod="GET" action="$action" waitUrl="$wait">Queue Demo1</Enqueue>
</Response>
XML;
    }

    function second_action()
    {
        echo <<<XML
<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Hangup/>
</Response>
XML;
    }

    function second_wait()
    {
        echo <<<XML
<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Say>
        You are in queue Queue Demo1
    </Say>
</Response>
XML;
    }

    function dial()
    {
        $url = site_url('test_queue/agent_msg');
        echo <<<XML
<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Dial method="GET">
        <Queue>Queue Demo1</Queue>
    </Dial>
</Response>
XML;
    }

    function agent_msg()
    {
        echo <<<XML
<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Say>You will now be connected to an agent.</Say>
</Response>
XML;
    }
}

Basically, the issue occurred when call moved from first queue to second queue and the agent(Twilio.Device) connected to the call with the dial() function call.

If I provide url parameter for twiML, so that a message is said back, before connecting the caller to agent, the call does not hang up any more.

Below is the working response for dial() function:

$url = site_url('test_queue/agent_msg');
echo <<<XML
<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Dial method="GET">
        <Queue url="$url" method="GET">Queue Demo1</Queue>
    </Dial>
</Response>
XML;

Upvotes: 0

xmjw
xmjw

Reputation: 3434

Twilio Evangelist here. This should work perfectly, so I suspect you might want to contact Twilio Support ([email protected]) with your Twilio Account SID and they can probably check this out for you.

Hope this helps!

Upvotes: 2

Related Questions