1

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

Abin
  • 540
  • 4
  • 15

1 Answers1

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

Citrus
  • 11
  • 2