Skip to content
Snippets Groups Projects
Commit d5c17f56 authored by Emeric Vigier's avatar Emeric Vigier
Browse files

#15046: make outgoing call from java UI

parent c411ce3b
No related branches found
No related tags found
No related merge requests found
......@@ -44,12 +44,74 @@ as that of the covered work.
android:layout_alignParentTop="true"
android:onClick="onClick"
android:text="init" />
<TextView
android:id="@+id/textAccountID"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/buttonInit"
android:text="AccountID"
android:ems="10" />
<EditText
android:id="@+id/editAccountID"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_toRightOf="@+id/textAccountID"
android:layout_below="@+id/buttonInit"
android:ems="10" />
<TextView
android:id="@+id/textCallID"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/editAccountID"
android:text="callID"
android:ems="10" />
<EditText
android:id="@+id/editCallID"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_toRightOf="@+id/textCallID"
android:layout_below="@+id/editAccountID"
android:ems="10" />
<TextView
android:id="@+id/textTo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/editCallID"
android:text="to"
android:ems="10" />
<EditText
android:id="@+id/editTo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_toRightOf="@+id/textTo"
android:layout_below="@+id/editCallID"
android:ems="10" />
<Button
android:id="@+id/buttonCall"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/editTo"
android:onClick="onClick"
android:text="placeCall" />
<TextView
android:id="@+id/callVoid_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/buttonInit"
android:layout_below="@+id/buttonCall"
android:text="callVoidText" />
<Button
......
......@@ -47,4 +47,5 @@ public class ManagerImpl {
public static native void setSipLogLevel(String level);
public static native String getJniString();
public static native void initN(String config_file);
public static native void placeCall(String accountID, String callID, String to);
}
......@@ -50,6 +50,7 @@ import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.TextView;
import com.savoirfairelinux.sflphone.R;
......@@ -277,6 +278,31 @@ public class SFLPhoneHome extends Activity implements ActionBar.TabListener, OnC
public void onClick(View view)
{
switch (view.getId()) {
case R.id.buttonCall:
EditText editText = (EditText) findViewById(R.id.editAccountID);
String accountID = editText.getText().toString();
if (accountID == null) {
Log.e(TAG, "accountID is " + accountID);
break;
}
editText = (EditText) findViewById(R.id.editCallID);
String callID = editText.getText().toString();
if (callID == null) {
Log.e(TAG, "callID is " + callID);
break;
}
editText = (EditText) findViewById(R.id.editTo);
String to = editText.getText().toString();
if (to == null) {
Log.e(TAG, "to string is " + to);
break;
}
Log.d(TAG, "ManagerImpl.placeCall(" + accountID + ", " + callID + ", " + to + ");");
ManagerImpl.placeCall(accountID, callID, to);
break;
case R.id.buttonInit:
ManagerImpl.initN("");
break;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment