I'm attempting to setup a simple voicemail system in twiml with this as my guide,
Desired Behaviour:
When a call arrives, connect to SIP. If no answer after 20 sec, play mp3, record message, email message.
<Response>
<Dial action="/voicemail" timeout="20">
<Sip>
username@endpoint.sip.us1.twilio.com
</Sip>
</Dial>
</Response>
with the voicemail function as follows
<Response>
<Play>https://www.example.com/voicemail.mp3</Play>
<Record transcribe="true" transcribeCallback="http://twimlets.com/voicemail?Email=somebody@somedomain.com" action="/hangup"/>
</Response>
Everything works fine, except that the caller is diverted to voicemail regardless of whether the call is picked up or not.
What am I missing that would provide the logic to hangup if the call is completed?
Can this be done purely in twiml since there is no conditional logic operators?
Thanks in advance for any help you can provide!