{"id":22729873,"url":"https://github.com/jhpyle/lstexttwilio","last_synced_at":"2025-07-22T08:32:55.599Z","repository":{"id":91864459,"uuid":"36316527","full_name":"jhpyle/lstexttwilio","owner":"jhpyle","description":null,"archived":false,"fork":false,"pushed_at":"2015-05-26T19:41:30.000Z","size":372,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-30T01:13:58.620Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jhpyle.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-26T18:46:01.000Z","updated_at":"2015-05-26T19:38:17.000Z","dependencies_parsed_at":"2023-03-13T06:00:56.336Z","dependency_job_id":null,"html_url":"https://github.com/jhpyle/lstexttwilio","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jhpyle/lstexttwilio","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhpyle%2Flstexttwilio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhpyle%2Flstexttwilio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhpyle%2Flstexttwilio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhpyle%2Flstexttwilio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jhpyle","download_url":"https://codeload.github.com/jhpyle/lstexttwilio/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhpyle%2Flstexttwilio/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266456245,"owners_count":23931383,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-10T18:12:13.170Z","updated_at":"2025-07-22T08:32:55.571Z","avatar_url":"https://github.com/jhpyle.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lstexttwilio\n\n# Twilio configuration\n\nSee twilio-screenshot.png for a summary of our Twilio configuration.  When a text message is received, Twilio passes the text message through http://docket.philalegal.org/data/message.php.\n\n## message.php\n\nThis is a short bit of PHP that converts a Twilio text message into an e-mail.  It sends an e-mail message to texts@text.jonathanpyle.com.  The MX record associated with text.jonathanpyle.com points to the docket.philalegal.org server.  The mail server on this machine, exim4, processes the e-mail.\n\n\t\u003c?php\n\t/**\n\t* This section ensures that Twilio gets a response.\n\t*/\n\theader('Content-type: text/xml');\n\techo '\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e';\n\techo '\u003cResponse\u003e\u003c/Response\u003e'; //Place the desired response (if any) here\n\t/**\n\t* This section actually sends the email.\n\t*/\n\t$to = \"texts@text.jonathanpyle.com\"; // Your email address\n\t$subject = \"Message from {$_REQUEST['From']} at {$_REQUEST['To']}\";\n\t$message = \"You have received a message from {$_REQUEST['From']}.\\n\\n\n\t{$_REQUEST['Body']}\";\n\tif ($_REQUEST['NumMedia'] \u003e 0){\n\t  $message .= \"\\n\\nLinks to attached files:\\n\";\n\t}\n\tfor ($x = 0; $x \u003c $_REQUEST['NumMedia']; $x++) {\n\t  $message .= \"\\n\".$_REQUEST['MediaUrl'.$x]; \n\t} \n\t$headers = \"From: jpyle@philalegal.org\"; // Who should it come from?\n\tmail($to, $subject, $message, $headers);\n\n## callreply.pl\n\nTwilio calls this script when someone calls our texting number.  This script instructs Twilio to play the audio file located at http://docket.philalegal.org/auto-reply.mp3 for the caller.  This mp3 file simply tells the caller that they need to call a different number.\n\n\t#!/usr/bin/perl\n\tuse strict;\n\tuse Carp;\n\tuse warnings;\n\tuse CGI qw/:standard/;\n\tmy $q = CGI-\u003enew();\n\n\tprint $q-\u003eheader(-type =\u003e 'application/xml', -expires =\u003e 'now');\n\tmy $string = \u003c\u003c'EOF';\n\t\u003c?xml version=\"1.0\" encoding=\"UTF-8\" ?\u003e\n\t\u003cResponse\u003e\n\t  \u003cPlay\u003ehttp://docket.philalegal.org/auto-reply.mp3\u003c/Play\u003e\n\t\u003c/Response\u003e\n\tEOF\n\tprint $string;\n\texit;\n\n## auto-reply.mp3\n\nThis mp3 file is referenced in callreply.pl, above.\n\n# E-mail server configuration for processing incoming text messages\n\nWhen the e-mail server at docket.philalegal.org receives an e-mail to the recipient \"texts,\" it pipes the e-mail through the script located at /usr/lib/cgi-bin/read-text.pl.\n\nThe exim4 configuration file, /etc/exim4/exim4.conf.template, contains the following lines:\n\n\t### router/100_exim4-config_domain_literal\n\t#################################\n\n\tcentral_filter:\n\t  driver = redirect\n\t  domains = +local_domains\n\t  file = /etc/exim4/textmessagefilter.txt\n\t  user = jpyle\n\t  group = jpyle\n\t  no_verify\n\t  allow_filter\n\t  allow_freeze\n\t  pipe_transport = address_pipe\n\n## textmessagefilter.txt\n\nThe file /etc/exim4/textmessagefilter.txt, which is referenced in the exim4 configuration above, is a short file with the following contents:\n\n\t#Exim filter\n\tif $local_part is \"texts\"\n\tthen\n\tpipe /usr/lib/cgi-bin/read-text.pl\n\tseen finish\n\tendif\n\n# Processing the e-mail containing the incoming text message\n\n## read-text.pl\n\nThis Perl script reads the e-mail containing the SMS/MMS message.  It MMS images into a single attached PDF file.  It uses an SMTP server located at 192.168.200.35 to send an e-mail to faxes@philalegal.org (a group mailbox) as well as the e-mail address of the case, as well as the e-mail address of the primary advocate in the case.\n\n# Sending text messages from the CMS\n\n## instruction-on-profile-page.html\n\nAdd this HTML as an instruction to the bottom of the Main Profile.  Make sure to check \"Format as HTML.\"\n\n## instruction-next-to-address.html\n\nAdd this HTML as an instruction in the tab block next to the address, where you want the user interface to appear.  Make sure to check \"Format as HTML.\"\n\n## send-text.pl\n\nThis script is run from an Ajax call from the Javascript code located in the HTML in instruction-next-to-address.html.  If this is going to run on a different server than the CMS web server, to get around the cross-site scripting restriction, you will need to configure the web server to allow the script to be called as though it is a local script.\n\nThe script sends the text message to Twilio and also sends it as an e-mail to the CMS.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjhpyle%2Flstexttwilio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjhpyle%2Flstexttwilio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjhpyle%2Flstexttwilio/lists"}