-1

I have one issue with Twilio. Sometimes when you call the center it requires a press number and upon this will continue the call. How can I achieve that using PHP or JavaScript with PHP?

I searched and I found Play DTMF tones in outgoing call using Twilio, but that didn't match my case. I need to click buttons through the call, not on dialing.

And I think this is not achievable with PHP itself. I mean it's a required Ajax request or JavaScript SDK.

DarkBee
  • 16,592
  • 6
  • 46
  • 58

2 Answers2

0

You should use: https://www.twilio.com/docs/voice/sdks/javascript/twiliocall#callsenddigitsdigits

After you established a connection, use function call.sendDigits(digits), passing digits as string

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jan 14 '22 at 00:35
0

this works fine for me

        $('.pad-container .digit').on('click',function(){
            var connection = Twilio.Device.activeConnection();
            if(connection) {
                connection.sendDigits($(this).text());
            }
        })