Twilio Integration Problem

Very disappointing to have lost this highly valuable resource when we “upgraded”.
Twilio is less than a penny per SMS text message (0.75 cents to be exact) and now it costs us $200 per month for phone minutes and labor time to make patient reminder calls. Is there no one out there willing to work with us to get this back?

@hitechelp are you saying that you’ve tried using @sjpadgett’s sms module which uses twilio and its not working for you? This thread seems to suggest the person is trying to do twilio on a older version of OpenEMR and can’t use the new sms module that Jerry Padgett put together?

Hi Stephen,

I appreciate your taking the time to respond in a timely manner. Thank you.

I need to install Composer which is apparently just the first step in many undocumented steps.
I read up on their site, but I don’t know which directory it must be installed in for OpenEMR use or which type (local vs global). And it seems we must use an old version (1.10.10) Ok but only if it’s secure.

I got this “How to” off the Composer site; My notes are in caps.

DO A PACKAGE UPDATE FIRST
sudo apt-get update
sudo apt-get upgrade

INSTALL COMPOSER DEPENDENCIES (IF NOT ALREADY INSTALLED)
sudo apt install curl php-cli php-mbstring git unzip

CD TO YOUR DESIRED INSTALLATION DIRECTORY
php -r “copy(‘https://getcomposer.org/installer’, ‘composer-setup.php’);”
php -r “if (hash_file(‘sha384’, ‘composer-setup.php’) === ‘756890a4488ce9024fc62c56153228907f1545c228516cbf63f885e036d37e9a59d27d63f46af1d4d07ee0f76181c7d3’) { echo ‘Installer verified’; } else { echo ‘Installer corrupt’; unlink(‘composer-setup.php’); } echo PHP_EOL;”
php composer-setup.php --version=1.10.10
php -r “unlink(‘composer-setup.php’);”

I was hoping to find someone who’s got this working so I can get some answers.

There has to be more to getting this working than just using Composer to install Jerry’s module with;
composer require "openemr/oe-module-faxsms:2.2.0

I have no such module (registered or unregistered) in my “Manage Modules” tab in OpenEMR.

Thanks again,

David

What is the operating system of your OpenEMR installation. Are you using docker? Is this on Windows, Linux, Other? How familiar are you with information technology (IT) tasks?

Composer is a third party php software installer (called a package manager). It allows you to install 3rd party software packages that live on https://packagist.org/ Jerry’s SMS module is a 3rd party library that adds SMS functionality into OpenEMR.

Ubuntu 18.04 (LAMPS), OpenEMR v6.0.0 (1), not using docker. Would you recommend that I should?
I am a 30+ year Unix SysAdmin, and Information Systems Security Officer (US Navy retired)
I’ve been running OpenEMR since 2012 on multiple headless servers I built over the years.
I set up SMS Appointment Reminders back in 2013 on v4.1.1 using Twilio, but lost that functionality when we “upgraded” to v5.02 in May of 2020. Been struggling ever since to get it going again.

I don’t have much experience in PhP but I can usually make my way.

A lot of us are using the docker since it comes already with the tools such as composer installed, I don’t think you have to switch your installation but you may run into things from time to time like this where a tool needs to be installed.

Here is some documentation for installing and configuring the fax/sms module that Jerry wrote. Note the fax has been disabled by Twilio since the module was written:

Stephen,
I follow that thread and I’m still waiting patiently for the “detailed how to” mentioned on Oct 19 however, it has yet to materialize. (nudge-nudge Jerry ;o)

So @hitechelp can you check inside your ‘composer.json’ file and look inside the “require” section to see if openemr/oe-module-faxsms is listed?

If its not listed then your composer install failed and we’d need to debug further. If it is listed double check inside your <openemr_install>/interface/modules/custom_modules/ and check if the oe-module-faxsms directory is there.

If both of those items are there then make sure that you are looking at the unregistered tabs in your modules directory and see if the module is listed there. Here is a screenshot of my unregistered modules tab:

Hit the register on the FaxSMS, then hit the install button and finally the enable button (yes I hate the 3 step click).

Let me know if you get that far or any errors you hit on the way.

I don’t have composer installed yet because, as I said yesterday, I don’t know which directory to install composer or which type of install (local vs global) is needed for it to work with OpenEMR.

Perhaps you could enlighten me, please.

It doesn’t matter, either one will work with OpenEMR as long as the version is correct. If you are on the 6.0 OpenEMR codebase composer 2 works just fine.

Ok, so local or global doesn’t matter, but where do I install composer? (Which directory)

The composer.json file located in /var/www/html/openemr does not list openemr/oe-module-faxsms

I’m guessing that gets added to the “require” section of the composer.json after composer is installed and I run; composer require "openemr/oe-module-faxsms:2.2.0 and it will also pull the file from git?

So it doesn’t matter where you install composer as long as it is accessible from your linux $PATH environment. I typically when doing a local install will run the installation directions from the same directory as my project. If I want to install it globally I install composer in my $HOME/bin directory.

Running the composer require will add the oe-module-faxsms entry into your composer.json. Make sure to run the composer require command inside the openemr installation folder. It will pull the file from git and any sub-dependencies.

@sjpadgett

Is the fax/sms module compatible with multi-site?

I am getting the following error, upon clicking the save button:

FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, 
client: 192.168.1.1, server: mydomain.net, 
request: "GET /interface/modules/custom_modules/oe-module-faxsms/interface/login/login.php?site=default HTTP/2.0", 
upstream: "fastcgi://unix:/path/to/php-fpm.sock:", host: "mydomain.net", 
referrer: "https://mydomain.net/interface/modules/custom_modules/oe-module-faxsms/setup.php"

But my office ID is not default.

I am working in my site, it ought to not be sending the information to the default site!

thanks Sandra

Actually, never mind. This looks like a redirect. It looks to be an nginx problem.

I will keep trying.

Ok, these are the rewrite rules for nginx that I have come up with so far for the fax module:

if (!-e $request_filename) {
  #other rewrite rules
  rewrite ... etc etc
  rewrite ^(.*/faxserver)$ /fax_serve.php?_FAX=$1 break;
  rewrite ^(.*/oe-module-faxsms)$ /index.php?_ACTION_COMMAND=$1 break;
}

With these rules, the fax module opens and seems to work. However, I am unable to enter the credentials.
could someone post what the credentials would look like in the table? i can just enter them directly into the tables to further test the module with nginx.

thanks

Credentials are encrypted and stored in table module_faxsms_credentials
So no goey that route.
Why can’t you save? Where are you entering credentials?

right!

I do get into the credentials entry window:

However, clicking the save button does nothing. I did enter my credentials. I cut them out from this image.

This is my error message:

"Primary script unknown" while reading response header from upstream, 
client: 192.168.1.1, server: mydomain.net, 
request: "GET /interface/modules/custom_modules/oe-module-faxsms/interface/login/login.php? site=default HTTP/2.0", 
upstream: "fastcgi://unix:/var/run/php-fpm.sock:", host: "mydomain.net", 
 referrer: "https://mydomain.net/interface/modules/custom_modules/oe-module-faxsms/setup.php"

The request tells me that my problem is a redirect problem. I am not passing some variable, hence my redirect rule above is missing some argument.

rewrite needs to be relative to directory.

Try:

location / {
  if (!-e $request_filename){
    rewrite ^(.*)$ /?_ACTION_COMMAND=$1 break;
  }
}

like this then?

location /oe-module-faxsms  {
    if (!-e $request_filename){
    rewrite ^(.*)$ /?_ACTION_COMMAND=$1 break;
}

}

that should work but my knowledge of nginx is old and limited. Much like me.:slight_smile:

what is the url that is sent when the save button is clicked?