No sms are sent with twilio / No se envian sms con twilio


(system) #1

arielimlauer wrote on Thursday, November 17, 2016:

No sms are sent with twilio.
I followed the instructions at http://www.open-emr.org/wiki/index.php/Short_Message_Service and downloaded the files and updated globals.inc and cro_sms_reminder from https://github.com/fkasmani/oemrtwilio/tree / Master / openemr but messages are not sent. When running the sms send http://192.168.2.201/openemr/modules/sms_email_reminder/cron_sms_notification.php the screen is blank without any message. i have xamp con openemr 4.2.2 para winddows
I look forward to your help, thank you very much!

No se envian sms con twilio.
He seguido las instrucciones de http://www.open-emr.org/wiki/index.php/Short_Message_Service y he descargado los archivos y actualizado globals.inc y cro_sms_reminder desde oemrtwilio/openemr at master · fkasmani/oemrtwilio · GitHub pero no se envian los mensajes. Al correr el cron de envio de sms http://192.168.2.201/openemr/modules/sms_email_reminder/cron_sms_notification.php queda la pantalla en blanco sin ningun mensaje. Uso xamp con openemr 4.2.2 para windows
Espero su ayuda, muchas gracias!


(system) #2

cmswest wrote on Thursday, November 17, 2016:

have you looked in the error logs? maybe it’s located in this spot? \xampp\apache\logs\error.log


(system) #3

arielimlauer wrote on Thursday, November 17, 2016:

Hello!
Log says:
[Thu Nov 17 20:22:56.324892 2016] [:error] [pid 3144:tid 1612] [client ::1:50234] PHP Warning: include_once(/var/www/openemr/interface/globals.php): failed to open stream: No such file or directory in C:\xampp\htdocs\openemr\modules\sms_email_reminder\cron_sms_notification.php on line 20
[Thu Nov 17 20:22:56.324892 2016] [:error] [pid 3144:tid 1612] [client ::1:50234] PHP Warning: include_once(): Failed opening ‘/var/www/openemr/interface/globals.php’ for inclusion (include_path=’\xampp\php\PEAR’) in C:\xampp\htdocs\openemr\modules\sms_email_reminder\cron_sms_notification.php on line 20
[Thu Nov 17 20:22:56.325892 2016] [:error] [pid 3144:tid 1612] [client ::1:50234] PHP Warning: include_once(/var/www/openemr/modules/sms_email_reminder/cron_functions.php): failed to open stream: No such file or directory in C:\xampp\htdocs\openemr\modules\sms_email_reminder\cron_sms_notification.php on line 21
[Thu Nov 17 20:22:56.325892 2016] [:error] [pid 3144:tid 1612] [client ::1:50234] PHP Warning: include_once(): Failed opening ‘/var/www/openemr/modules/sms_email_reminder/cron_functions.php’ for inclusion (include_path=’\xampp\php\PEAR’) in C:\xampp\htdocs\openemr\modules\sms_email_reminder\cron_sms_notification.php on line 21
[Thu Nov 17 20:22:56.325892 2016] [:error] [pid 3144:tid 1612] [client ::1:50234] PHP Fatal error: Call to undefined function cron_getNotificationData() in C:\xampp\htdocs\openemr\modules\sms_email_reminder\cron_sms_notification.php on line 36
[Thu Nov 17 20:23:01.571387 2016] [:error] [pid 3144:tid 1616] [client ::1:50235] SQL Error with statement:could not disconnect from mysql server link==>C:\xampp\htdocs\openemr\modules\sms_email_reminder\cron_email_notification.php at 78:sqlClose


(system) #4

cmswest wrote on Friday, November 18, 2016:

oh, the guide is for linux that’s why the files aren’t found on your xampp. you can probably hack a solution but you’ll need cron running, checkout cygwin and crontab, http://stackoverflow.com/questions/707184/how-do-you-run-a-crontab-in-cygwin-on-windows#707220


(system) #5

arielimlauer wrote on Friday, November 18, 2016:

thank you very much!!! I’m getting closer and closer to this one working !!
Now it is only this error when trying to use cron_sms_notification, the error says in the web browser “Error in SMS authorization! (ERR: 108, Invalid or missing api_id)”
Any ideas?
I have the 3 complete fields in twilio of Twilio Account Sid, Twilio Auth Token and
Twilio From name.
Do you have to put the same data in a file? Any other ideas?
Many thanks again!


(system) #6

cmswest wrote on Friday, November 18, 2016:

here’s a recent post, http://stackoverflow.com/questions/40671032/twilio-how-to-avoid-verification-of-number-in-twilio-api


(system) #7

arielimlauer wrote on Saturday, November 19, 2016:

Something is still wrong, even if you leave all the fields empty in the notification -> Twilio (Twilio Account Sid, Twilio Auth Token and Twilio From name) the same error “Error in SMS authorization!” Appears (ERR: 108, Invalid or missing api_id). . Do not put any additional settings in some of the files modified in global.inc or cron_sms_notification or add something in the database?
regards


(system) #8

cmswest wrote on Sunday, November 20, 2016:

let’s back up, do you have a twilio directory under modules/sms_email_reminder/? there should be quite a few files in there that do the twilio stuff


(system) #9

arielimlauer wrote on Sunday, November 20, 2016:

Yes, I copied all the files from oemrtwilio/openemr at master · fkasmani/oemrtwilio · GitHub. I have a twilio directory where there are many files and folders. But as I say before, even if you have all fields empty in notification-> Twilio, the error 108 of missing or invalid api_id still appears


(system) #10

cmswest wrote on Monday, November 21, 2016:

that’s a clickatell error message, looking at the code more closely it appears that twilio wasn’t brought into 4.2, hopefully can pull something together based on Brady’s code review here, http://github.com/bradymiller/openemr/commit/eb676a4665b95a7743e3eeabf0d85f17ef8b1676


(system) #11

arielimlauer wrote on Monday, November 21, 2016:

I have all the files listed on that link. I insist that somewhere something must be configured to not check with clickatell if it is not used. The only change I made looking at the link you sent me, is that the Twilio folder must be copied to library. It is the last post in the link you passed me make that clarification.


(system) #12

arielimlauer wrote on Monday, November 21, 2016:

in apache/log:
[Mon Nov 21 11:23:57.403168 2016] [:error] [pid 3708:tid 1624] [client 192.168.2.202:45298] PHP Deprecated: mysql_query(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in C:\xampp\htdocs\openemr\modules\sms_email_reminder\cron_sms_notification.php on line 41
[Mon Nov 21 11:23:57.403168 2016] [:error] [pid 3708:tid 1624] [client 192.168.2.202:45298] PHP Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\openemr\modules\sms_email_reminder\cron_sms_notification.php on line 42


(system) #13

arielimlauer wrote on Monday, November 21, 2016:

// object for sms
global $mysms;
$sql=“select * from globals where gl_name in (‘TWILIO_ACCOUNT_SID’,‘TWILIO_AUTHTOKEN’,‘TWILIO_FROM’)”;
$q=mysql_query($sql);
while($r=mysql_fetch_assoc($q)){
if($r[‘gl_name’]==‘TWILIO_ACCOUNT_SID’)
$AccountSid=$r[‘gl_value’];
if($r[‘gl_name’]==‘TWILIO_AUTHTOKEN’)
$AuthToken=$r[‘gl_value’];
if($r[‘gl_name’]==‘TWILIO_FROM’)
$from=$r[‘gl_value’];
}
if($AccountSid)
{
include_once(“C:/xampp/htdocs/openemr/modules/sms_email_reminder/sendnotifications.php”);
}else
if( $db_email_msg[‘sms_gateway_type’]==‘CLICKATELL’ )
{
include_once(“C:/xampp/htdocs/openemr/modules/sms_email_reminder/sms_clickatell.php”);

}else if($db_email_msg[‘sms_gateway_type’]==‘TMB4’)
{
include_once(“C:/xampp/htdocs/openemr/modules/sms_email_reminder/sms_tmb4.php”);
}


(system) #14

arielimlauer wrote on Monday, November 21, 2016:

but the question is, in that version if it works smoothly Twilio?
I think it’s easier to lose version which function effectively Twilio to be with version 4.2.2 and investigate the oriden the problem I have.
Regards!


(system) #15

cmswest wrote on Monday, November 21, 2016:

retry with these files, you’ll have to set values in Globals->Notifications for the newly named globals, and the message goes on line 101 of the cron_sms file


(system) #16

arielimlauer wrote on Monday, November 21, 2016:

Yesss! Stephen’re a genius! Those were apparently the correct files. I can finally see the message in the browser !!! So I guess I should be failing some of sending message or some other configuration because even the message is not sent, but rather the outlook has improved. When you have your results tell them and how finally stay.
I hope to resolve it quickly. Just need to be send sms.
Thanks for the help.


0 DEBUG :: user=sms username
Total 1 Records Found ----- DEBUG :cron_sms: found patient = Ariel DEBUG :: checkdate=2016-11-22, app_date=2016-11-22 11:45:00, apptime=1479811500 remain_hour=12 – CRON_TIME=0

ERROR: could not disconnect from mysql server link
C:\xampp\htdocs\openemr\modules\sms_email_reminder\cron_sms_notification.php at 127:sqlClose


(system) #17

cmswest wrote on Tuesday, November 22, 2016:

what are your values for these fields?
SMS Notification Hours
enable twilio
Twilio From name (should be the twilio phone #, you probably shouldn’t post it), i followed this https://www.twilio.com/docs/api/rest/test-credentials


(system) #18

arielimlauer wrote on Tuesday, November 22, 2016:

Good day!

These are the data I have completed in notifications -> Twilio. Twilio Account Sid and Twilio Auth Token data are the “LIVE Credentials” of Twilio. Is “Twilio From Name” the magic number I found in a tutorial, or should I have another magic number provided by Twilio to not use my real number?
The current situation is that sms messages are left in a queue and are not sent.

Thank you very much


(system) #19

cmswest wrote on Tuesday, November 22, 2016:

try this please, 15005550006


(system) #20

arielimlauer wrote on Tuesday, November 22, 2016:

0 DEBUG :: user=sms username
Total 2 Records Found ----- DEBUG :cron_sms: found patient = Ariel DEBUG :: checkdate=2016-11-22, app_date=2016-11-22 11:45:00, apptime=1479811500 remain_hour=-5 – CRON_TIME=0 ----- DEBUG :cron_sms: found patient = Fernanda DEBUG :: checkdate=2016-11-22, app_date=2016-11-22 13:15:00, apptime=1479816900 remain_hour=-4 – CRON_TIME=0

ERROR: could not disconnect from mysql server link

C:\xampp\htdocs\openemr\modules\sms_email_reminder\cron_sms_notification.php at 127:sqlClose