In my application im using node.js with socketstream framework.Now i need to use tropo module to send an sms,receive an sms,make a call and answering an incoming call.I installed tropo-webapi using npm.i added this node code in server side.While running the below code i didn't get any output.i dont know how to link this file in tropo website and how to receive the sms and phone call.
exports.actions = function(req, res, ss) {
return{
sendMessage:function(){
var tropoAPI = require('tropo-webapi');
var tropo = new tropoAPI.TropoWebAPI();
tropo.call("+18197924547", null, null, null, null, null, "SMS", null, null,null);
tropo.say("HI How Are You!!");
},
makeCall:function(){
var tropoAPI = require('tropo-webapi');
var tropo = new tropoAPI.TropoWebAPI();
tropo.call("+18197924547");
tropo.say("Hi,how ary yoo!");
}
};
};
So you did not specify from which file is this snippet from but I got the feeling, it is from one under server/rpc/<yourfilename> where the Remote Procedure Calls are.
!!! NOTE THE <yourfilename>
The methods which you define are generated for the client in a way that he can trigger it trough the socket interfaces, let me write a snippet, I think you will understand:
- lets write into this file => client/code/app/app.js
ss.rpc('<yourfilename>.sendMessage','here comes params which is now a string');
To get a sense what this ss object is look into your client/code/app/entry.js you will see it.