- 浏览: 2564483 次
- 性别:
- 来自: 成都
-
文章分类
最新评论
-
nation:
你好,在部署Mesos+Spark的运行环境时,出现一个现象, ...
Spark(4)Deal with Mesos -
sillycat:
AMAZON Relatedhttps://www.godad ...
AMAZON API Gateway(2)Client Side SSL with NGINX -
sillycat:
sudo usermod -aG docker ec2-use ...
Docker and VirtualBox(1)Set up Shared Disk for Virtual Box -
sillycat:
Every Half an Hour30 * * * * /u ...
Build Home NAS(3)Data Redundancy -
sillycat:
3 List the Cron Job I Have>c ...
Build Home NAS(3)Data Redundancy
Ad Solution SMS(1)Open Source Message Send
Clone the Project First
> git clone https://github.com/typpo/textbelt
Check my ENV
> node --version && npm --version
v8.10.0
3.5.2
Directly call their official website
> curl -X POST http://textbelt.com/text -d number=512785xxx -d message="I try this message for free from Textbelt" -d key=7dfdff2fc1c926f2cc92757c7c70c2bbe1175fddclHnjkAvAqpCIBatP8y8sBh8G
{"success":false,"error":"Out of quota","quotaRemaining":0}
Run the Service On my Local
> npm install
Adjust some information in the configuration file
> vi lib/config.js
Start the Service
> node server/app.js
It is not working with an exception
> curl -X POST http://localhost:9090/text -d number=5127xxxxx -d "message=I sent this message for free with my VPS"
{"success":false,"message":"No carrier specified"}
Install the dependency
> sudo apt-get install mutt
Install Redis as well
https://redis.io/topics/quickstart
> wget http://download.redis.io/redis-stable.tar.gz
> tar zxvf redis-stable.tar.gz
> mv redis-stable ~/tool/
> sudo ln -s /home/carl/tool/redis-stable /opt/redis
Not stable, some limitation.
There is a website, ClickSend
https://developers.clicksend.com/guides/
https://developers.clicksend.com/docs/rest/v3/
Another website Twilio
https://www.twilio.com/docs/sms/quickstart/java
I will choose JAVA
> java -version
java version "1.8.0_161"
https://www.twilio.com/docs/libraries/java#using-without-a-build-automation-tool
https://www.twilio.com/docs/sms/quickstart/java?code-sample=code-send-an-sms-using-twilio-with-java&code-language=Java&code-sdk-version=7.x#receive-and-reply-to-inbound-sms-messages
Here is my Sender Testing:
package com.lapro.notificationservice;
import com.twilio.Twilio;
import com.twilio.rest.api.v2010.account.Message;
import com.twilio.type.PhoneNumber;
public class DemoApp {
// Find your Account Sid and Token at twilio.com/user/account
public static final String ACCOUNT_SID = "AC23341969xxxxxxxx";
public static final String AUTH_TOKEN = "cc8c2b0cxxxxxxxxx";
public static void main(String[] args) {
Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
Message message = Message.creator(new PhoneNumber("+15127852053"), new PhoneNumber("+17372041315"),
"Hello from simple example, t1").create();
System.out.println(message.getSid());
}
}
Here is my Receiver Test, it is a web hook which accept http request and response.
package com.lapro.notificationservice;
import static spark.Spark.get;
import static spark.Spark.post;
import lombok.extern.slf4j.Slf4j;
//import com.twilio.twiml.MessagingResponse;
//import com.twilio.twiml.messaging.Body;
//import com.twilio.twiml.messaging.Message;
@Slf4j
public class DemoSparkApp {
public static void main(String[] args) {
get("/", (req, res) -> "Hello Web");
post("/sms", (req, res) -> {
log.info("request is " + req.body());
System.out.println("request2 is " + req.body());
//res.type("application/xml");
//Body body = new Body.Builder("The Robots are coming! Head for the hills!").build();
//Message sms = new Message.Builder().body(body).build();
//MessagingResponse twiml = new MessagingResponse.Builder().message(sms).build();
//return twiml.toXml();
return null;
//ToCountry=US&
//ToState=TX&
//SmsMessageSid=SMfdbd3309edc31160449ad423f619bdd9&
//NumMedia=0&
//ToCity=&
//FromZip=78705&SmsSid=SMfdbd3309edc31160449ad423f619bdd9&
//FromState=TX&SmsStatus=received&
//FromCity=AUSTIN&
//Body=Hello&
//FromCountry=US&To=%2B17372041315&ToZip=&NumSegments=1&
//MessageSid=SMfdbd3309edc31160449ad423f619bdd9&
//AccountSid=AC23341969f7046783c4bc48f4b449b485&From=%2B15127852053&ApiVersion=2010-04-01
});
}
}
And here is the dependency in pom.xml, it is using spark framework (Java WEB Framework)
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.lapro</groupId>
<artifactId>notification-service</artifactId>
<version>1.0.0</version>
<name>Notification Service</name>
<description>Notification Service SMS</description>
<properties>
<orika.version>1.5.1</orika.version>
</properties>
<dependencies>
<dependency>
<groupId>com.twilio.sdk</groupId>
<artifactId>twilio</artifactId>
<version>7.36.2</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.6</version>
</dependency>
<dependency>
<groupId>com.sparkjava</groupId>
<artifactId>spark-core</artifactId>
<version>2.8.0</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.26</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptors>
<descriptor>deployment/release/assembly.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-snapshots</id>
<url>http://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<url>http://repo.spring.io/milestone</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-snapshots</id>
<url>http://repo.spring.io/snapshot</url>
</pluginRepository>
<pluginRepository>
<id>spring-milestones</id>
<url>http://repo.spring.io/milestone</url>
</pluginRepository>
</pluginRepositories>
</project>
How I test that is I download a ngrok tool
https://dashboard.ngrok.com/auth
> sudo cp ~/Downloads/ngrok /usr/local/bin/
> ngrok authtoken 7AQtga8dF9ppBfSxxxxxxxxxx
> ngrok http 4567
It will start a proxy and I can use that as public URL to configure in twilo
Here is how I configure the WEB Hook
For one number number, [Configure] —> [Messaging]
I put my ngrok URL in Webhook as http://0exxxxxx.ngrok.io/sms
References:
https://www.twilio.com/docs/sms/quickstart/python
https://www.twilio.com/docs/sms/tutorials/how-to-receive-and-reply-java
https://www.nexmo.com/pricing
https://github.com/aaronpk/Google-Voice-PHP-API
https://github.com/aaronpk/Google-Voice-PHP-API/blob/master/GoogleVoice.php
https://stackoverflow.com/questions/1668619/is-there-a-google-voice-api
https://stackoverflow.com/questions/16057903/api-services-for-receiving-sms-text-messaging-online
https://github.com/typpo/textbelt
https://stackoverflow.com/questions/2475658/sms-gateway-in-usa
https://textbelt.com/
https://www.clicksend.com/us/pricing/us/
https://lowendbox.com/blog/how-to-send-sms-messages-from-your-vps-using-textbelt/
Clone the Project First
> git clone https://github.com/typpo/textbelt
Check my ENV
> node --version && npm --version
v8.10.0
3.5.2
Directly call their official website
> curl -X POST http://textbelt.com/text -d number=512785xxx -d message="I try this message for free from Textbelt" -d key=7dfdff2fc1c926f2cc92757c7c70c2bbe1175fddclHnjkAvAqpCIBatP8y8sBh8G
{"success":false,"error":"Out of quota","quotaRemaining":0}
Run the Service On my Local
> npm install
Adjust some information in the configuration file
> vi lib/config.js
Start the Service
> node server/app.js
It is not working with an exception
> curl -X POST http://localhost:9090/text -d number=5127xxxxx -d "message=I sent this message for free with my VPS"
{"success":false,"message":"No carrier specified"}
Install the dependency
> sudo apt-get install mutt
Install Redis as well
https://redis.io/topics/quickstart
> wget http://download.redis.io/redis-stable.tar.gz
> tar zxvf redis-stable.tar.gz
> mv redis-stable ~/tool/
> sudo ln -s /home/carl/tool/redis-stable /opt/redis
Not stable, some limitation.
There is a website, ClickSend
https://developers.clicksend.com/guides/
https://developers.clicksend.com/docs/rest/v3/
Another website Twilio
https://www.twilio.com/docs/sms/quickstart/java
I will choose JAVA
> java -version
java version "1.8.0_161"
https://www.twilio.com/docs/libraries/java#using-without-a-build-automation-tool
https://www.twilio.com/docs/sms/quickstart/java?code-sample=code-send-an-sms-using-twilio-with-java&code-language=Java&code-sdk-version=7.x#receive-and-reply-to-inbound-sms-messages
Here is my Sender Testing:
package com.lapro.notificationservice;
import com.twilio.Twilio;
import com.twilio.rest.api.v2010.account.Message;
import com.twilio.type.PhoneNumber;
public class DemoApp {
// Find your Account Sid and Token at twilio.com/user/account
public static final String ACCOUNT_SID = "AC23341969xxxxxxxx";
public static final String AUTH_TOKEN = "cc8c2b0cxxxxxxxxx";
public static void main(String[] args) {
Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
Message message = Message.creator(new PhoneNumber("+15127852053"), new PhoneNumber("+17372041315"),
"Hello from simple example, t1").create();
System.out.println(message.getSid());
}
}
Here is my Receiver Test, it is a web hook which accept http request and response.
package com.lapro.notificationservice;
import static spark.Spark.get;
import static spark.Spark.post;
import lombok.extern.slf4j.Slf4j;
//import com.twilio.twiml.MessagingResponse;
//import com.twilio.twiml.messaging.Body;
//import com.twilio.twiml.messaging.Message;
@Slf4j
public class DemoSparkApp {
public static void main(String[] args) {
get("/", (req, res) -> "Hello Web");
post("/sms", (req, res) -> {
log.info("request is " + req.body());
System.out.println("request2 is " + req.body());
//res.type("application/xml");
//Body body = new Body.Builder("The Robots are coming! Head for the hills!").build();
//Message sms = new Message.Builder().body(body).build();
//MessagingResponse twiml = new MessagingResponse.Builder().message(sms).build();
//return twiml.toXml();
return null;
//ToCountry=US&
//ToState=TX&
//SmsMessageSid=SMfdbd3309edc31160449ad423f619bdd9&
//NumMedia=0&
//ToCity=&
//FromZip=78705&SmsSid=SMfdbd3309edc31160449ad423f619bdd9&
//FromState=TX&SmsStatus=received&
//FromCity=AUSTIN&
//Body=Hello&
//FromCountry=US&To=%2B17372041315&ToZip=&NumSegments=1&
//MessageSid=SMfdbd3309edc31160449ad423f619bdd9&
//AccountSid=AC23341969f7046783c4bc48f4b449b485&From=%2B15127852053&ApiVersion=2010-04-01
});
}
}
And here is the dependency in pom.xml, it is using spark framework (Java WEB Framework)
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.lapro</groupId>
<artifactId>notification-service</artifactId>
<version>1.0.0</version>
<name>Notification Service</name>
<description>Notification Service SMS</description>
<properties>
<orika.version>1.5.1</orika.version>
</properties>
<dependencies>
<dependency>
<groupId>com.twilio.sdk</groupId>
<artifactId>twilio</artifactId>
<version>7.36.2</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.6</version>
</dependency>
<dependency>
<groupId>com.sparkjava</groupId>
<artifactId>spark-core</artifactId>
<version>2.8.0</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.26</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptors>
<descriptor>deployment/release/assembly.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-snapshots</id>
<url>http://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<url>http://repo.spring.io/milestone</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-snapshots</id>
<url>http://repo.spring.io/snapshot</url>
</pluginRepository>
<pluginRepository>
<id>spring-milestones</id>
<url>http://repo.spring.io/milestone</url>
</pluginRepository>
</pluginRepositories>
</project>
How I test that is I download a ngrok tool
https://dashboard.ngrok.com/auth
> sudo cp ~/Downloads/ngrok /usr/local/bin/
> ngrok authtoken 7AQtga8dF9ppBfSxxxxxxxxxx
> ngrok http 4567
It will start a proxy and I can use that as public URL to configure in twilo
Here is how I configure the WEB Hook
For one number number, [Configure] —> [Messaging]
I put my ngrok URL in Webhook as http://0exxxxxx.ngrok.io/sms
References:
https://www.twilio.com/docs/sms/quickstart/python
https://www.twilio.com/docs/sms/tutorials/how-to-receive-and-reply-java
https://www.nexmo.com/pricing
https://github.com/aaronpk/Google-Voice-PHP-API
https://github.com/aaronpk/Google-Voice-PHP-API/blob/master/GoogleVoice.php
https://stackoverflow.com/questions/1668619/is-there-a-google-voice-api
https://stackoverflow.com/questions/16057903/api-services-for-receiving-sms-text-messaging-online
https://github.com/typpo/textbelt
https://stackoverflow.com/questions/2475658/sms-gateway-in-usa
https://textbelt.com/
https://www.clicksend.com/us/pricing/us/
https://lowendbox.com/blog/how-to-send-sms-messages-from-your-vps-using-textbelt/
发表评论
-
Update Site will come soon
2021-06-02 04:10 1688I am still keep notes my tech n ... -
Stop Update Here
2020-04-28 09:00 325I will stop update here, and mo ... -
NodeJS12 and Zlib
2020-04-01 07:44 486NodeJS12 and Zlib It works as ... -
Docker Swarm 2020(2)Docker Swarm and Portainer
2020-03-31 23:18 375Docker Swarm 2020(2)Docker Swar ... -
Docker Swarm 2020(1)Simply Install and Use Swarm
2020-03-31 07:58 376Docker Swarm 2020(1)Simply Inst ... -
Traefik 2020(1)Introduction and Installation
2020-03-29 13:52 345Traefik 2020(1)Introduction and ... -
Portainer 2020(4)Deploy Nginx and Others
2020-03-20 12:06 436Portainer 2020(4)Deploy Nginx a ... -
Private Registry 2020(1)No auth in registry Nginx AUTH for UI
2020-03-18 00:56 446Private Registry 2020(1)No auth ... -
Docker Compose 2020(1)Installation and Basic
2020-03-15 08:10 382Docker Compose 2020(1)Installat ... -
VPN Server 2020(2)Docker on CentOS in Ubuntu
2020-03-02 08:04 469VPN Server 2020(2)Docker on Cen ... -
Buffer in NodeJS 12 and NodeJS 8
2020-02-25 06:43 396Buffer in NodeJS 12 and NodeJS ... -
NodeJS ENV Similar to JENV and PyENV
2020-02-25 05:14 491NodeJS ENV Similar to JENV and ... -
Prometheus HA 2020(3)AlertManager Cluster
2020-02-24 01:47 433Prometheus HA 2020(3)AlertManag ... -
Serverless with NodeJS and TencentCloud 2020(5)CRON and Settings
2020-02-24 01:46 342Serverless with NodeJS and Tenc ... -
GraphQL 2019(3)Connect to MySQL
2020-02-24 01:48 257GraphQL 2019(3)Connect to MySQL ... -
GraphQL 2019(2)GraphQL and Deploy to Tencent Cloud
2020-02-24 01:48 458GraphQL 2019(2)GraphQL and Depl ... -
GraphQL 2019(1)Apollo Basic
2020-02-19 01:36 333GraphQL 2019(1)Apollo Basic Cl ... -
Serverless with NodeJS and TencentCloud 2020(4)Multiple Handlers and Running wit
2020-02-19 01:19 318Serverless with NodeJS and Tenc ... -
Serverless with NodeJS and TencentCloud 2020(3)Build Tree and Traverse Tree
2020-02-19 01:19 326Serverless with NodeJS and Tenc ... -
Serverless with NodeJS and TencentCloud 2020(2)Trigger SCF in SCF
2020-02-19 01:18 303Serverless with NodeJS and Tenc ...
相关推荐
WLAN驱动程序的设计需要支持多种操作模式,包括自组织网络模式(Ad-Hoc)、基础设施模式(Infrastructure)、网格网络模式(Mesh)、无线分配系统(WDS)、虚拟接入点(Virtual Access Point, VAP)、虚拟接口以及...
标题中的“new ADC drivers_between_AD7768sourcecode_ad7768_”暗示了这是一个关于新型ADC(Analog-to-Digital Converter)驱动程序的项目,特别关注于AD7768芯片与FPGA(Field-Programmable Gate Array)之间的...
标题“AD_ad7768_ad7768驱动代码_AD7768-4程序_AD7768-1的FPGA驱动程序”揭示了我们讨论的主题是关于AD7768系列模拟数字转换器(ADC)的驱动程序开发,特别是针对AD7768-1型号的单通道24位版本,以及可能涉及到的AD...
A/D模数转换模块源代码,代码使用了8通道一起检测,在AVR单片机上调试成功
BuggyAutoSAR is an open-source, playful implementation of the Adaptive AUTOSAR platform.
开源stm32+AD9851做的DDS,25M带宽
1. **初始化过程**:在STM32上驱动AD5660的第一步是初始化I2C或SPI接口,因为AD5660支持这两种通信协议。在`AD5660.c`中,会有一个初始化函数,如`AD5660_Init()`, 这个函数通常会配置GPIO引脚、初始化I2C或SPI总线...
Ad Block plus for Android的源码。放在这里分享是因为国外服务器下载比较慢。
### OpenRTB动态原生广告API规范版本1.2知识点详解 #### 一、概述 **OpenRTB(Open Real-Time Bidding)**是互联网广告领域内的一种开放式协议标准,旨在促进广告库存的实时竞价过程。它由IAB(Interactive ...
《AD7760与AD7762 FPGA设计实例解析》 在现代电子系统设计中,高精度的模拟数字转换器(ADC)扮演着至关重要的角色。AD公司的AD7760和AD7762是两款高性能的模数转换器,广泛应用于医疗设备、工业自动化以及测量系统...
AD(AD9280)和DA(AD9708) FPGA读写Verilog设计源码Quartus工程文件,AD芯片选用AD9280,DA芯片选用AD9708,,FPGA型号Cyclone4E系列中的EP4CE10F17C8,Quartus版本18.0。 module hs_ad_da( input sys_clk , //系统...
在这个场景下,"android ad-hoc source code"可能是指一个针对Android 2.2(Froyo)版本实现的源代码,用于支持或改进设备间的ad-hoc网络连接功能。 Android 2.2 Froyo是Android操作系统的一个重要版本,它在2010年...
在信息技术领域,尤其是在企业网络管理中,Active Directory(AD)和Systems Management Server(SMS)是两大关键组件。本方案针对江苏电力公司的网络架构,详细阐述了AD和SMS 2003的部署策略,以实现高效、安全和...
标题中的“AD域结合CA与802.1X结合的多个参考文档”是指将活动目录(Active Directory, AD)与证书颁发机构(Certificate Authority, CA)与802.1X认证技术相结合,用于强化网络访问控制。这种集成方案在企业环境...
"zxl.zip_ad_current source"这个压缩包文件包含了两个关键性的资源:`zxl.PcbLib` 和 `zxl.SchLib`,它们是针对AD(Altium Designer)软件的封装库文件,用于电路板(PCB)和电路原理图(Schematic)的设计。...
OpenFOAM-v1812-AD 该存储库包含OpenFOAM-v1812源代码,这些源代码通过正向和反向模式下的自动区分(AD)来区分。安装OpenFOAM-v1812-AD的安装与OpenFOAM-v1812的安装类似。 需要首先安装所有必备组件,获取OpenFOAM...
标题中的“ad8232_ad8232stm32_ad8232程序_AD8232_AD8232stm32代”暗示了我们正在讨论一个基于AD8232心电图(ECG)检测芯片与STM32微控制器的集成应用项目。AD8232是一款高性能、低功耗的心率监测集成电路,适用于...
在本文中,我们将深入探讨如何使用STM32微控制器通过SPI接口驱动AD7192和AD7190模数转换器(ADC)。这两个器件是ADI公司出品的高精度、低功耗的24位Σ-Δ型ADC,常用于工业自动化、医疗设备和数据采集系统等应用。 ...
为了适应不同的电源设计,AD7768的电源需求灵活,AVDD1为5.0V,AVDD2为2.25V至5.0V,IOVDD为2.5V至3.3V或者1.8V。这样的电源适应性使得AD7768可以在多种不同的系统中使用。 AD7768提供了多种功耗、速度和带宽模式,...
在Android 3.0之后,系统原生支持OMA DRM 1.0,而2.0版本的实现可以参考AOSP(Android Open Source Project)源代码,这使得开发者和制造商能够为移动设备构建符合标准的DRM解决方案,确保内容的安全性和合法使用。...