在我的应用程序中,我使用node.js与socketstream framework.Now,我需要使用tropo模块发送短信,接收短信,打电话和回答来电。我安装tropo-webapi使用npm.i。我添加此节点代码在服务器side.While运行以下代码,我没有得到任何输出。
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!");
}
};
};发布于 2013-02-27 02:28:10
所以你没有指定这个代码片段来自哪个文件,但是我有感觉,它来自server/rpc/<yourfilename>下的远程过程调用所在的文件。
!!!请注意<yourfilename>
你定义的方法是为客户端生成的,他可以通过套接字接口触发它,让我来写一段代码,我想你会理解的:
client/code/app/app.js 写入此文件
ss.rpc('<yourfilename>.sendMessage','here comes params which is now a string');要了解这个ss对象是什么,请查看您的client/code/app/entry.js,您将看到它。
https://stackoverflow.com/questions/14768130
复制相似问题