From ea6e9190edad4c5743718f8a09b06c09e62aef9f Mon Sep 17 00:00:00 2001 From: Erhan Justice Date: Wed, 15 Oct 2014 18:14:29 -0700 Subject: [PATCH] Added support for nexmo SMS service --- push.cpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/push.cpp b/push.cpp index e3e14c7..a7c4a65 100755 --- a/push.cpp +++ b/push.cpp @@ -467,6 +467,33 @@ class CPushMod : public CModule params["notification[run_command]"] = options["message_uri"]; } } + else if (service == "nexmo") + { + if (options["username"] == "") + { + PutModule("Error: username (user key) not set"); + return; + } + if (options["secret"] == "") + { + PutModule("Error: secret (application token/key) not set"); + return; + } + + service_host = "rest.nexmo.com"; + service_url = "/sms/json"; + + params["api_secret"] = options["secret"]; + params["api_key"] = options["username"]; + params["from"] = message_title; + params["text"] = message_content; + + if (options["target"] != "") + { + params["to"] = options["target"]; + } + + } else if (service == "url") { if (options["message_uri"] == "")