// Path: libs/voice/src/main/java/com/africastalking/voice/CallResponse.java
// public final class CallResponse {
//     public String status;
//     public String phoneNumber;
//     public String errorMessage;
// 
//     @Override
//     public String toString() {
//         return new Gson().toJson(this);
//     }
// }
// 
// Path: libs/voice/src/main/java/com/africastalking/voice/QueuedCallsResponse.java
// public final class QueuedCallsResponse {
//     public String phoneNumber;
//     public String queueName;
//     public int numCalls;
// 
//     @Override
//     public String toString() {
//         return new Gson().toJson(this);
//     }
// }


import com.africastalking.voice.CallResponse;
import com.africastalking.voice.QueuedCallsResponse;
import retrofit2.Call;
import retrofit2.Response;
import java.io.IOException;
     * Initiate phone call
     * @param to Phone number to call
     * @param from Number from which to initiate the call
     * @return {@link com.africastalking.voice.CallResponse CallResponse}
     * @throws IOException
     */
    public CallResponse call(String to, String from) throws IOException {
        checkPhoneNumber(to);
        Call<CallResponse> call = voice.call(mUsername, to, from);
        Response<CallResponse> resp = call.execute();
        if (!resp.isSuccessful()) {
            throw new IOException(resp.errorBody().string());
        }
        return resp.body();
    }

    public CallResponse call(String to) throws IOException {
        return call(to, "");
    }


    /**
     * Initiate phone call
     * @param to Phone number to call
     * @param from Number from which to initiate the call
     * @param callback {@link com.africastalking.Callback Callback}
     */
    public void call(String to, String from, final Callback<CallResponse> callback) {
        try {
            checkPhoneNumber(to);
// Path: libs/voice/src/main/java/com/africastalking/voice/CallResponse.java
// public final class CallResponse {
//     public String status;
//     public String phoneNumber;
//     public String errorMessage;
// 
//     @Override
//     public String toString() {
//         return new Gson().toJson(this);
//     }
// }
// 
// Path: libs/voice/src/main/java/com/africastalking/voice/QueuedCallsResponse.java
// public final class QueuedCallsResponse {
//     public String phoneNumber;
//     public String queueName;
//     public int numCalls;
// 
//     @Override
//     public String toString() {
//         return new Gson().toJson(this);
//     }
// }


// Path: libs/voice/src/main/java/com/africastalking/VoiceService.java
import com.africastalking.voice.CallResponse;
import com.africastalking.voice.QueuedCallsResponse;
import retrofit2.Call;
import retrofit2.Response;
import java.io.IOException;

     * Initiate phone call
     * @param to Phone number to call
     * @param from Number from which to initiate the call
     * @return {@link com.africastalking.voice.CallResponse CallResponse}
     * @throws IOException
     */
    public CallResponse call(String to, String from) throws IOException {
        checkPhoneNumber(to);
        Call<CallResponse> call = voice.call(mUsername, to, from);
        Response<CallResponse> resp = call.execute();
        if (!resp.isSuccessful()) {
            throw new IOException(resp.errorBody().string());
        }
        return resp.body();
    }

    public CallResponse call(String to) throws IOException {
        return call(to, "");
    }


    /**
     * Initiate phone call
     * @param to Phone number to call
     * @param from Number from which to initiate the call
     * @param callback {@link com.africastalking.Callback Callback}
     */
    public void call(String to, String from, final Callback<CallResponse> callback) {
        try {
            checkPhoneNumber(to);
            Call<CallResponse> call = voice.call(mUsername, to, from);