- dotnet
- A Twilio account - sign up
- A Twilio Phone Number provisioned for voice
- An MP3 (upload to a space that is available on the web, such as Twilio assets)
This application should give you a ready-made starting point for writing your own application. Before we begin, we need to collect all the config values we need to run the application:
- Account SID
- Auth Token
- Twilio Phone Number
- Incoming Phone Number
After the above requirements have been met:
- Clone this repository and
cdinto it
git clone git@github.com:twilio-samples/add-mp3-to-phone-call
cd add-mp3-to-phone-call- Add necessary nuget packages
dotnet add package Twilio
dotnet add package Microsoft.Extensions.Configuration
dotnet add package Microsoft.Extensions.Configuration.UserSecrets
- Set necessary user secrets by getting the credentials from your Twilio dashboard:
dotnet user-secrets init
dotnet user-secrets set Twilio:AccountSid [TWILIO_ACCOUNT_SID]
dotnet user-secrets set Twilio:AuthToken [TWILIO_AUTH_TOKEN]
dotnet user-secrets set Twilio:PhoneNumber [TWILIO_PHONE_NUMBER]
dotnet user-secrets set ReceivingNumber [NUMBER_TO_CALL]-
Replace placeholder value ASSET_URL in the application with the URL of your MP3 Asset
-
Build to install the dependencies
dotnet build- Run the application
dotnet run