Android Twilio拨打电话
问题描述:
我想通过改变android HelloMonkey几天使用有效的userid来拨打电话,当我拨打电话时出现错误“拨打电话时账户SID不能为空” 我的代码就像Android Twilio拨打电话
public void connect(String phoneNumber) {
Map<String, String> parameters = new HashMap<String, String>();
parameters.put("PhoneNumber", phoneNumber);
if (device == null){
Log.w("", "Failed device == null");
}else{
Log.w("", "device != null");
}
connection = device.connect(parameters, null /* ConnectionListener */);
if (connection == null)
Log.w(TAG, "Failed to create new connection");
}
没有发现空
请帮助。 在此先感谢
答
而不是使用密钥名称作为“PhoneNumber”,使用“To”作为Map参数的关键。
public void connect(String phoneNumber) {
Map<String, String> parameters = new HashMap<String, String>();
parameters.put("To", phoneNumber);
connection = device.connect(parameters, null /* ConnectionListener */);
if (connection == null)
Log.w(TAG, "Failed to create new connection");
}