0

I'm trying to create an customized Music for Call forwarding.

When someone calling the it's redirecting to Enqueue named by "support".

<Response>
    <Enqueue waitUrl="waitMusic.xml"></Enqueue>
</Response>

waitMusic.xml (Playing the audio)

<Response>
    <Play>http://audio_file.mp3</Play>
</Response>

I don't know how to continue, I tried all out of things, and nothing works. Please help!

Roy Tal
  • 1
  • 3
  • Could you add the call log for a sample call to your question? This way we can see the requests that Twilio is making to your server. Is it doing a request to waitMusic.xml? – Juan Sep 28 '18 at 17:57
  • Yes, the music is working. but If It's just me calling, it's need to redirect me automatically to agent. It's just add me to Queue. – Roy Tal Sep 28 '18 at 18:16

1 Answers1

1

You have 2 legs, the user leg and the agent leg.

When the user calls to Twilio's number, Twilio will do a request to your server which should return (same TwiML as you are using, but with a queue name):

<Response>
    <Enqueue waitUrl="waitMusic.xml">support</Enqueue>
</Response>

This puts the user in hold playing the music from waitMusic.xml if there are no agents available.

But you also need the logic for the agent. The agent will call to a Twilio phone, and in this case you'll return a different TwiML:

<Response>
    <Dial>
        <Queue url="agentWaitMusic.xml">support</Queue>
    </Dial>
</Response>

This is a "dial queue" (docs) that automatically dequeues any user that is on the the queue "support" and connects them together. If there are no users in the queue, the agent will be put on hold, playing the music from "agentWaitMusic.xml".

It's important to use the same queue name (in this case "support") for both, the "enqueue" and the "dial queue" actions.

Juan
  • 687
  • 1
  • 8
  • 22
  • Yeah but the problem is I would to create when the Client calling and waiting it will connect him to Agent. The agent will get the call (Means the client will call using Dial or something) – Roy Tal Sep 28 '18 at 21:18
  • For that you'll need to manage it all in your system, instead of using Twilio's queue. You'll need to add something on your system so that the agent can say "I'm available", so the system doesn't send a caller to an agent that is not working. After you have that, when a call comes in, your system will check if there are any available agents, put the user in a conference, call the agent and when the agent picks up, send the agent to the same conference (dial conference). Twilio's task router may help with this: https://www.twilio.com/docs/taskrouter/tutorials/dynamic-call-center-csharp-mvc – Juan Sep 29 '18 at 13:49