Code: Select all
SendMail('911', 'xxxxxxxxxx@vmobile.ca', 'Call from ' + CallInfo.Name + ' at ' + CallInfo.Number,
' on ' + CallInfo.DateTimeStr + ' in ' + CallInfo.City); // Josh Text
Code: Select all
SendMail('911', 'xxxxxxxxxx@vmobile.ca', 'Call from ' + CallInfo.Name + ' at ' + CallInfo.Number,
' on ' + CallInfo.DateTimeStr + ' in ' + CallInfo.City); // Josh Text
Code: Select all
/////////////////////////////////////////////////////////////////////////////
// Pushover.dws
//
// Sends a message using the Pushover.net service
//
// For information on using the Pushover API, please see:
// https://pushover.net/api
//
// THIS ACTION USES cURL. IF YOU DON'T HAVE IT INSTALLED, DOWNLOAD IT FROM:
// http://www.paehl.com/open_source/?download=curl_741_0_ssh2_ssl.zip&PHPSESSID=0923f37a6f42c3e53d8c5fcb1247a0fe
// (Or download a different version from elsewhere. You probably need a version including SSL.)
// Unzip it to a folder on your path or your Ascendis Caller ID Program Files folder.
//
// NOTE: A result of 0 from the cURL command does NOT mean Pushover sent the message.
//
// 2015-03-08 WTR - created
/////////////////////////////////////////////////////////////////////////////
//LANGUAGE=DWS
///////////////////////////////////////////////////////////////////////////
// CONFIGURATION
///////////////////////////////////////////////////////////////////////////
// set APP_TOKEN to your application token from Pushover
const APP_TOKEN = '<your Pushover application token>';
// set USER_KEY to your user key from Pushover
const USER_KEY = '<your Pushover user key>';
// change this to point to your certificate authority bundle file
// To create the file, download mk-ca-bundle.vbs from the Curl repository on GitHub:
// https://raw.github.com/bagder/curl/master/lib/mk-ca-bundle.vbs
// You may have to run it as an administrator.
//const SECURITY = '--cacert "C:\Path\to\ca-bundle.crt"';
// INSECURE ALTERNATIVE TO CERTIFICATE AUTHORIZATION
// WARNING: this is insecure because it disables security certificate validation
const SECURITY = '-k'; // INSECURE
// If TITLE is blank, your application name (on Pushover) will be used
const TITLE = 'Call Received';
//const TITLE = '';
var
message : String;
// change this to the desired message
message := 'Call from ' + CallInfo.Name + ' at ' + CallInfo.Number;
///////////////////////////////////////////////////////////////////////////
// CODE
// You shouldn't have to change anything beyond this point.
///////////////////////////////////////////////////////////////////////////
var title_arg : String;
if TITLE = '' then
title_arg := ''
else
title_arg := ' --form-string "title=' + TITLE + '"';
var curl_args: String;
curl_args := SECURITY +
' --form-string "token=' + APP_TOKEN + '"' +
' --form-string "user=' + USER_KEY + '"' +
title_arg +
' --form-string "message=' + message + '"' +
' https://api.pushover.net/1/messages.json';
LogActivity('Sending to curl: ' + curl_args);
var result: Integer;
result := RunWait('curl', curl_args);
LogActivity('Result of sending Pushover message=' + IntToStr(result));
if result <> 0 then
ShowMessage('Could not send Pushover message: error code ' + IntToStr(result));
Code: Select all
///////////////////////////////////////////////////////////////////////////
// CONFIGURATION
///////////////////////////////////////////////////////////////////////////
// set APP_TOKEN to your application token from Pushover
const APP_TOKEN = 'your Pushover application token - first user' , 'your Pushover application token - second user';
// set USER_KEY to your user key from Pushover
const USER_KEY = 'your Pushover user key - first user' , 'your Pushover user key - second user';
My attempts to understand it failed miserably, here are a couple of modification to the original script.As far as using Pushover, I looked at their API and successfully made an action send to it by using cURL to talk to their server. ("curl is a command line tool and library for transferring data with URL syntax..."; http://curl.haxx.se/)
Code: Select all
var title_arg : String;
if TITLE = '' then
title_arg := ''
else
title_arg := ' --form-string "title=' + TITLE + '"';
var curl_args: String;
curl_args := SECURITY +
' --form-string "token=' + APP_TOKEN + '"' +
' --form-string "user=' + USER_KEY + '"' +
title_arg +
' --form-string "message=' + message + '"' +
' https://api.pushover.net/1/messages.json' +
' --form-string "sounds=bike"' +
' https://api.pushover.net/1/sounds.json?token=(my Pushover application token #)';
Code: Select all
var
message : String;
sounds : String;
// change this to the desired message
message := 'Their is an Emerency Call from ' + CallInfo.Name + ' @ ' + CallInfo.Number + ' in ' + CallInfo.City;
sounds := 'bike';
///////////////////////////////////////////////////////////////////////////
// CODE
// You shouldn't have to change anything beyond this point.
///////////////////////////////////////////////////////////////////////////
var title_arg : String;
if TITLE = '' then
title_arg := ''
else
title_arg := ' --form-string "title=' + TITLE + '"';
var curl_args: String;
curl_args := SECURITY +
' --form-string "token=' + APP_TOKEN + '"' +
' --form-string "user=' + USER_KEY + '"' +
title_arg +
' --form-string "message=' + message + '"' +
' https://api.pushover.net/1/messages.json' +
' --form-string "sounds= ' + sounds + '"' +
' https://api.pushover.net/1/sounds.json?token=(my Pushover application token #)';
Code: Select all
var curl_args: String;
curl_args := SECURITY +
' --form-string "token=' + APP_TOKEN + '"' +
' --form-string "user=' + USER_KEY + '"' +
title_arg +
' --form-string "message=' + message + '"' +
' --form-string "sound=bike"' +
' https://api.pushover.net/1/messages.json';
Code: Select all
' --form-string "[parameter name]=[parameter value]"' +
An add other parameters are also very useful add ons. Thank you for all your time and effort you have done.If you add other parameters as shown at https://pushover.net/api you should only have to add another line before the "json" line:
Code:
' --form-string "[parameter name]=[parameter value]"' +