question

telnyx_slacker avatar image
telnyx_slacker asked

How can I in PHP pick up a user's click during an outgoing call?

On the documentation I found this link, https://developers.telnyx.com/docs/api/v2/call-control/Call-Commands?lang=php

I guess it is the answer() method that collects the user's choice, can you confirm for me? but the statement $call->answer() is made as soon as the phone call starts, how can i wait for the user's interaction?

call-controloutgoing-callsphp
10 |600

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

·
vishal avatar image
vishal answered

Hello,

You can use gather command to read user's input. Please check relevant documentation for the same here.

There are three types of gather available:

gather using audio — plays an audio file as a prompt to collect DTMF input,

gather using speak — uses text-to-speech (TTS) as a prompt to collect DTMF input,

gather — collects DTMF without providing a prompt.

Each one these issues a call.gather.ended once the final input can be determined

If you're new to DTMF, you can learn more about them here

10 |600

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Manage Your Content