Skip to content

Twiml voice calls #111

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

TechWilk
Copy link

@TechWilk TechWilk commented Oct 28, 2020

Twilio now supports sending TwiML along with the initial request to create a call, rather than needing an external url to fetch TwiML from. It would be nice to support this alongside the existing url() method.

https://www.twilio.com/docs/voice/tutorials/how-to-make-outbound-phone-calls-php

Example use case:

You have a system which you want to be able to send a text-based notification to a phone.
i.e. call a phone -> read out a message -> then hang up.

This can now be achieved by sending the message directly from the laravel notification, the same way you would a SMS, instead of also needing to handle urls and routing. It leaves open the whole TwiML flexibilty for more complex call chains by accepting an instance of VoiceResponse.

Previously this would be difficult for a system which didn't allow incoming network requests from the net, especially those behind a firewall, since you potentially need an entirely different system would need to handle the TwiML url responses.


Tests

I've been struggling to get the existing unit tests to pass Error: Class 'Orchestra\Testbench\TestCase' not found (I have run composer install. Will add new ones when I get past this. EDIT: So it seems github-actions doesn't get that message, so must be something on my local box. I'll take another go at it over the weekend. Any thoughts still appreciated! :)

I've opened this PR to get comments while I finish it off. There are several ways it could be implemented & happy to adjust to your style if that's preferred.

@atymic
Copy link
Member

atymic commented Oct 29, 2020

Looks awesome! Let me know when you are ready and i'll review.

@andy-shi88
Copy link

@TechWilk for the Error: Class 'Orchestra\Testbench\TestCase' not found issue,

if you look into the .github/workflows/php.yml [Run Integration Tests] it installs composer require --dev --no-interaction "orchestra/testbench:^5.1" before running the tests (which is not included in the composer.json), try running that locally and it should solve the dependency issue.

andy-shi88 added a commit to andy-shi88/twilio that referenced this pull request Mar 23, 2021
@andy-shi88
Copy link

also added fixes for the tests 62f90b3

andy-shi88 added a commit to AnalogRepublic/twilio that referenced this pull request Mar 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants