Bind proxyconfig properties and update registration tutorial.
This commit is contained in:
parent
c31f00dc84
commit
8bd2c5055e
2 changed files with 17 additions and 7 deletions
|
@ -18,6 +18,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
*/
|
||||
package org.linphone.core;
|
||||
|
||||
import org.linphone.core.LinphoneCore.RegistrationState;
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -25,6 +27,10 @@ package org.linphone.core;
|
|||
class LinphoneProxyConfigImpl implements LinphoneProxyConfig {
|
||||
|
||||
protected final long nativePtr;
|
||||
|
||||
private native int getState(long nativePtr);
|
||||
private native void setExpires(long nativePtr, int delay);
|
||||
|
||||
boolean ownPtr = false;
|
||||
protected LinphoneProxyConfigImpl(String identity,String proxy,String route, boolean enableRegister) throws LinphoneCoreException {
|
||||
nativePtr = newLinphoneProxyConfig();
|
||||
|
@ -121,4 +127,11 @@ class LinphoneProxyConfigImpl implements LinphoneProxyConfig {
|
|||
throw new LinphoneCoreException("cannot set route ["+routeUri+"]");
|
||||
}
|
||||
}
|
||||
public RegistrationState getState() {
|
||||
return RegistrationState.fromInt(getState(nativePtr));
|
||||
}
|
||||
|
||||
public void setExpires(int delay) {
|
||||
setExpires(nativePtr, delay);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,6 +42,7 @@ public class TutorialRegistrationActivity extends TutorialHelloWorldActivity {
|
|||
private TutorialRegistration tutorial;
|
||||
private Button buttonCall;
|
||||
private Handler mHandler = new Handler();
|
||||
private TextView outputText;
|
||||
|
||||
|
||||
@Override
|
||||
|
@ -55,7 +56,7 @@ public class TutorialRegistrationActivity extends TutorialHelloWorldActivity {
|
|||
sipPasswordWidget.setText(defaultSipPassword);
|
||||
|
||||
// Output text to the outputText widget
|
||||
final TextView outputText = (TextView) findViewById(R.id.OutputText);
|
||||
outputText = (TextView) findViewById(R.id.OutputText);
|
||||
final TutorialNotifier notifier = new AndroidTutorialNotifier(mHandler, outputText);
|
||||
|
||||
|
||||
|
@ -66,6 +67,7 @@ public class TutorialRegistrationActivity extends TutorialHelloWorldActivity {
|
|||
|
||||
// Assign call action to call button
|
||||
buttonCall = (Button) findViewById(R.id.CallButton);
|
||||
buttonCall.setText("Register");
|
||||
buttonCall.setOnClickListener(new View.OnClickListener() {
|
||||
public void onClick(View v) {
|
||||
TutorialLaunchingThread thread = new TutorialLaunchingThread();
|
||||
|
@ -74,7 +76,6 @@ public class TutorialRegistrationActivity extends TutorialHelloWorldActivity {
|
|||
}
|
||||
});
|
||||
|
||||
// Assign stop action to stop button
|
||||
Button buttonStop = (Button) findViewById(R.id.ButtonStop);
|
||||
buttonStop.setOnClickListener(new View.OnClickListener() {
|
||||
public void onClick(View v) {
|
||||
|
@ -92,13 +93,9 @@ public class TutorialRegistrationActivity extends TutorialHelloWorldActivity {
|
|||
tutorial.launchTutorial(
|
||||
sipAddressWidget.getText().toString(),
|
||||
sipPasswordWidget.getText().toString());
|
||||
mHandler.post(new Runnable() {
|
||||
public void run() {
|
||||
buttonCall.setEnabled(true);
|
||||
}
|
||||
});
|
||||
} catch (LinphoneCoreException e) {
|
||||
e.printStackTrace();
|
||||
outputText.setText(e.getMessage() +"\n"+outputText.getText());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue