How to get the Incoming number from twilio third party API
<p>I had done lot of R&amp;D on getting the incoming number when calling is done from the Twilio number to the other Twilio number in the app using Twilio as a third party integration.</p>

<p>But i do not get anything regarding that incoming number, I got the call from the other Twilio number, device is listening to the incoming call, but could not able to identify the incoming number, for that I am using this method <code>connectionCall.IncomingParameterFromKey</code>, it only return me "From".</p>

<p>Below is the code for receiving the call in the app using Twilio integration.</p>

<pre><code>public class Call_Answer extends Activity implements OnClickListener{

String sub_sid="",sub_auth_token="",call_from="";
SharedPreferences sharedPref;
SharedPreferences.Editor prefEdit;
TextView callanswer_btn,callreject_btn;
private Connection connectionCall;
IncomingCall phone;
private Device device;

@Override
protected void onCreate(Bundle savedInstanceState) {
    // Method onCreate created by vk hooda on Oct 30, 2012
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    setContentView(R.layout.callanswer);


    sharedPrefValues();
    initializeView();

}

private void sharedPrefValues() {
    // Method sharedPrefValues created by vk hooda on Oct 31, 2012


    sharedPref=PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
    prefEdit=sharedPref.edit();
    sub_sid=sharedPref.getString(Constant_Variables.using_sub_sid,"");
    sub_auth_token=sharedPref.getString(Constant_Variables.using_sub_auth_token,"");
    call_from=sharedPref.getString(Constant_Variables.using_phone_number, "");

    //Initialize Calls
    phone=new IncomingCall(sub_sid,sub_auth_token,call_from,getApplicationContext());

    //phone=new IncomingCall(Constants.account_SID,Constants.account_Token,Constants.karl_number,getApplicationContext());

}

private void initializeView() {
    // Method initializeView created by vk hooda on Oct 30, 2012

    callanswer_btn=(TextView)findViewById(R.id.callanswer_btn);
    callreject_btn=(TextView)findViewById(R.id.callreject_btn);

    callanswer_btn.setOnClickListener(this);
    callreject_btn.setOnClickListener(this);
}

@Override
public void onNewIntent(Intent intent)
{
    super.onNewIntent(intent);
    setIntent(intent);
}

@Override
public void onResume()
{
    super.onResume();

    Intent intent = getIntent();
    Device device = intent.getParcelableExtra(Device.EXTRA_DEVICE);
    Connection connection = intent.getParcelableExtra(Device.EXTRA_CONNECTION);
    if (device != null &amp;&amp; connection != null) {
        intent.removeExtra(Device.EXTRA_DEVICE);
        intent.removeExtra(Device.EXTRA_CONNECTION);
        handleIncomingConnection(device, connection);

        //              ringingPhone(intent);

    }
}

public void handleIncomingConnection(Device inDevice, Connection inConnection)
{
    Log.i("Handle incoming call", "Device received incoming connection");
    connectionCall=inConnection;
    device=inDevice;
    if (connectionCall != null)
    {
        connectionCall.disconnect();
        connectionCall = inConnection;
//          connectionCall.reject();


        Log.i("Blocktimer.blocking_call",""+Blocktimer.blocking_call);

        if(Blocktimer.blocking_call == true)
        {
            connectionCall.reject();
            Blocktimer.blocking_call = false;
        }



        Log.i("connectionIIIIII",""+ connectionCall.IncomingParameterAccountSIDKey);
        Log.i("connectionIIIIII",""+ connectionCall.IncomingParameterAPIVersionKey);
        Log.i("connectionIIIIII",""+ connectionCall.IncomingParameterCallSIDKey);
        Log.i("connectionIIIIII",""+ connectionCall.IncomingParameterFromKey);
        Log.i("connectionIIIIII",""+ connectionCall.IncomingParameterToKey);
        Log.i("connectionIIIIII",""+ connectionCall.hashCode());
        Log.i("connectionIIIIII",""+ connectionCall.CONTENTS_FILE_DESCRIPTOR);
        Log.i("connectionIIIIII",""+ connectionCall.PARCELABLE_WRITE_RETURN_VALUE);
        Log.i("connectionIIIIII",""+ connectionCall.getState());
        Log.i("connectionIIIIII",""+ connectionCall.isIncoming());
        Log.i("connectionIIIIII",""+ connectionCall.isMuted());




        Log.v("Handling Incoming Call","Someone calling you.you have accepted it here.");
    }

}

public void onClick(View v) {
    // Method onClick created by vk hooda on Oct 30, 2012

    if(v==callanswer_btn)
    {

        if (connectionCall != null)
        { 
            connectionCall.accept();
            Log.i("connectionaccept",""+ connectionCall.getState());
            Log.v("calling answer","Conversation start.....");
        }
    }

    if(v==callreject_btn)
    {
        //connectionCall.disconnect();
        Log.v("calling disconnect","Conversation disconnect.....");

        if (connectionCall != null)
        { 
            connectionCall.disconnect();
            Log.i("connectionReject",""+ connectionCall.getState());
            connectionCall=null;

            Log.v("Disconnect","Disconnecting in finalize method");
        }
        if (device != null)
        {
            Log.v("Disconnect","Release in finalize method");
            device.release();
            device=null;
        }

        finish();
    }   
}
</code></pre>

<p>}</p>
