-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Using the Twilio Agent
The Twilio Agent, as the name implies, allows arbitrary agent networks to output events to Twilio. If you haven't previously written code specific to Twilio, using this agent effectively can be somewhat daunting. This wiki page aims to resolve that.
To access your Twilio account, you need to set up a TwiML app. Follow these steps:
- Go to the Twilio Apps Page.
- Create a new TwiML app (you can name it 'Huginn' or any other name you prefer).
- Each TwiML app requires two Request URLs to be configured: one for voice and one for SMS/MMS. Both of these URLs should point to the front page of your Huginn instance, e.g., https://huginn.example.com/.
- If you are running in DEVELOPMENT mode and have set up HTTP Basic Auth for your instance, it is recommended to set up a second account specifically for Twilio access. The URL would then look something like this: https://twilio:password@huginn.example.com/.
The Twilio Agent can accept the following keys as its input: {{message}}, {{text}}, or {{sms}}. These keys are Liquid enabled. Please note that the values of these keys cannot exceed 160 characters in length.
- Phone Number: The agent requires a phone number to contact, specified by the key {{receiver_cell}}.
-
Receive Text ({{receive_text}}): A Boolean switch that determines if the specified phone number will receive a text message.
-
Receive Call ({{receive_call}}): A Boolean switch that determines if the specified phone number will receive a phone call (the message will be run through Twilio's speech synthesis system).
At least one of {{receive_text}} or {{receive_call}} must be set to true for the agent to function.
- If you don't have a paid Twilio account, all messages sent through this service will have a standard "Buy a real account" nag prepended.