You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Simple bridge to allow the use of a twilio phone number to be used for messaging using any XMPP client, such as Conversations.
Sending SMS from Phone Numbers
The service is set up so you can have 1 phone number per each xmpp account.
To set up your phone number. You will need to get from Twilio:
Account SID
Phone Number
You will also need to authenticate to twilio, with either:
API Key SID and API Key Secret
OR
Auth token
Then message the admin bot ( COMPONENT_DOMAIN ) from your xmpp account with message 'help' to see command, or 'register' and follow the steps.
Message 'cancel' or 'help' at any time to return to the help section.
Recieving SMS from phone numbers
This should be set up automatically by the bot or iq registration, if your API_HOST variable is set up correctly.
If not, this can be changed manually:
Go to https://console.twilio.com
Go to Develop > Phone Numbers > Manage > Active Numbers
Click on the phone number you want to add
Go to the Configure tab
Scroll down to 'Messaging' and change 'A message Comes in' to the url you are hosting the web app on. For example: https://twilio.sgx.domain.tld/sms
Installation:
Bare installation
Required:
nodejs >= 14
redis server
xmpp server that supports components ( eg: prosody )
Installation:
Clone the Repo
git clone https://github.com/pesvut/sgx-twilio
Install the nodejs packages
cd ./sgx-twilio && npm install
Run the server with environmental variables
Variable
Description
XMPP_ADMIN
(optional) Who to send messages regarding updates and missing messages
COMPONENT_HOST
Host for the Xmpp instance component in format "xmpp(s)://xmpp-instance:5347" ( default: "xmpp://prosody:5347" )
COMPONENT_DOMAIN
Domain of the component this is, eg: 'twilio.sgx.domain.tld'
COMPONENT_SECRET
Component Secret / password to administer the xmpp component
REDIS_URL
redis instance to connect to ( or default redis if not present )
PORT
port to host the web server for recieving messages ( default: 80 )
An all-in one docker-compose file for running redis, xmpp and sgx-twilio behind an instance of nginx or apache.
Note that E2E_POLICY_CHAT is set to none because the server needs to be able to read the messages to bridge them.
add cert folders to /certs for each of the following domains ( see https://github.com/SaraSmiseth/prosody for more information on setting up your xmpp )
conference.domain.tld
domain.tld
media.domain.tld
proxy.domain.tld
add a configuration file for the new component, config/conf.d/06-components.cfg.lua:
local comp_secret = os.getenv("COMPONENT_SECRET")
Component "twilio.sgx.domain.tld"
component_secret = comp_secret