1

I am using the twilio php library to implement the calling .. I am running through an issue .. the issue is that .. I am using the following code to redirect the call to a particular url

require_once('/path/to/twilio-php/Services/Twilio.php'); // Loads the library

$sid = "ACXXXXX"; 
$token = "YYYYY"; 
$client = new Services_Twilio($sid, $token);

$call = $client->account->calls->get("CAe1644a7eed5088b159577c5802d8be38");
$call->update(array(
    "Url" => "example.php",
    "Method" => "POST"
));

and after redirecting I am making the machine to speak particular text using the following code

<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Say>Hello</Say>
</Response>

but the problem is that after saying the text.. the call gets disconnected at both ends.. I want that the call should continue after this also ... please help me out with this!

Thev
  • 59
  • 12
Vivek Bhardwaj
  • 530
  • 5
  • 16

1 Answers1

2

Twilio developer evangelist here.

Your call disconnects because once the <Say> command is complete there are no more instructions for the call, so Twilio hangs up. In order to carry on the call you will need to either <Redirect> the caller back to the original state or add more TwiML after the <Say>.

philnash
  • 70,667
  • 10
  • 60
  • 88
  • Hello philnash ! thank you so much for your valuable answer... can u please tell me that how can i redirect my call to the original state? – Vivek Bhardwaj Apr 29 '16 at 13:02
  • It depends on what your call was doing in the first place! What is your actual use case here, perhaps I can suggest a way to do it? – philnash Apr 29 '16 at 13:51
  • in the first place there is nothing but a simple call going on between two users.. i just want to make a call between the two users.. and in between i want the machine to play some text and then the call should again go back to its previous state.. – Vivek Bhardwaj Apr 30 '16 at 04:54