I send calls out by building an html file that contains twiml markup, and use the php lib to place the call to the outgoing number (see e.g.)
$tw_call = $twilio_client->calls->create(
"+1".$recipient['address'], "+1".$org['twilio_number'],
array(
'Url' => VOICE_CALL_LINK.'/'.$file, (this contains the SAY verbs and text)
'Timeout' => '30',
'StatusCallback' => CALLBACK_LINK.'/voice_call_handler.php',
'StatusCallbackEvent' => array('initiated', 'ringing', 'answered', 'completed')
)
I want to know if it is possible to record a dtmf code from the call recipient via the method I am using for placing the call?
Can an additional callback url be placed in the text file? If so how would I capture which call the was coming back? Would the call sid be available to the possible callback url within the text file?
Ok I must be missing something. I tried the following:
<Response>
<Pause length='1'/>
<Say voice='alice'>$intro</Say>
<Pause length='1'/>
<Say voice='alice'>$msg_body</Say>
<Pause length='1'/>
<Gather action='absolute html path' numDigits='1'>
<Say Please respond by selecting 1 for I can come. Select 2 for I cannot come.</Say>
</Gather>
</Response>";
I get back from Twilio "an application error has occurred". If I remove the Gather tags and the Say tag within the Gather tags, I receive a perfect call.
Same error occurs if I leave the tags and remove the action and path.
Can you gather responses on outbound calls? I ask because all twilio docs refer to inbound call.