I followed this page to update a call to a conference room.
Everytime I try to call the update function, I get an error:
No 'To' number is specified
.
Even if I go the standard Twiml where the call entered, it says that. Nowhere in the document is stated that you need a To number.
The code I used:
$call = $tokens['client']->account->calls->get($call_sid);
$call->update(array(
"Url" => $app["request"]->getSchemeAndHttpHost() . "/dial/api/assign_redirect?callsid=" . $call_sid,
"Method" => "POST"
));
The twiml where it is redirected to:
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Say voice="woman">Thank you for your patience. You are now connecting with an agent</Say>
<Dial record="true">
<Conference startConferenceOnEnter="false" endConferenceOnExit="true" eventCallbackUrl="{{ url('API-record') }}" record="record-from-start">{{ callsid }}</Conference>
</Dial>
The other Twiml where the call is accepted:
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Dial record='record-from-answer' callerId='{{ callerId }}'>
{{ numberOrClient|raw }}
</Dial>
</Response>
Twilio support was no help, they pointed me at: https://www.twilio.com/docs/errors/21201 which makes no sense.
I tried a bunch of question on SO already like :
- Twilio - How to move an existing call to a conference
- Move Twilio call to a conference room
- Twilio - How to dial third party number and add him to conference?
Only the last one worked for me. But that creates a third leg. I want to stick to the existing ones. Anyone has a clue how to fix this?
Thanks in advance!
Edit: I am using the v4 of the PHP library.
To
number, so I'm just wondering if there's more context to it? – philnashupdate
– philnash