Android Twilio make a call

霸气de小男生 提交于 2019-12-11 09:12:41

问题


I am trying to make a call by altering android HelloMonkey for a few days using valid userid, when i make a call i get an error "Account SID cannot be null when making a call" my code is like

    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");
}

nothing is found null

Please help. Thanks in advance


回答1:


Instead of using key name as "PhoneNumber", use "To" as key to the Map parameters.

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");
}

Twilio Client for android



来源:https://stackoverflow.com/questions/26472521/android-twilio-make-a-call

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!