Hi
i am Trying to use Twilio Java API in rules. This API works fine through Netbeans but i am not sure how to include this in openremote rules. i tried it as follows in a separate rules file. The file gets included with no errors when controller starts; however when the rule gets triggered, i am getting errors (attached). Any help would be greatly appreciated.
I have included the Twilio library in the openremote libraries folder that has all the .jar files
This API allows making automated phone calls and playing recorded messages.
I am using controller 2.6 beta 3 on Raspberry pi java version
java version "1.8.0_65"
________________________________________________________________________________________________________________________
package org.openremote.controller.protocol
global org.openremote.controller.statuscache.CommandFacade execute;
global org.openremote.controller.statuscache.SwitchFacade switches;
import org.openremote.controller.protocol.Event;
import java.net.URI;
import java.net.URISyntaxException;
import com.twilio.Twilio;
import com.twilio.rest.api.v2010.account.Call;
import com.twilio.type.PhoneNumber;
//********Phone call Breach detected*************************************************
rule "Call breach detected on"
when
Event( source == "breachdetected", value == "on" )
then
//package trial.phone.twilio.nb8;
/**
*
* @author s
*/
final String ACCOUNT_SID = "AC18a6479ce27720a20b7";
final String AUTH_TOKEN = "8b987f8ca";
Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
Call call = Call.creator(new PhoneNumber(to), new PhoneNumber(from),
System.out.println(call.getSid());
end
__________________________________________________________________________________________________________________________