mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-19 03:58:08 +00:00
Merge branch 'master' of belledonne-communications.com:linphone-private
This commit is contained in:
commit
af3209cfd0
14 changed files with 110 additions and 36 deletions
|
|
@ -369,8 +369,8 @@ static void register_success(SalOp *op, bool_t registered){
|
|||
LinphoneCore *lc=(LinphoneCore *)sal_get_user_pointer(sal_op_get_sal(op));
|
||||
LinphoneProxyConfig *cfg=(LinphoneProxyConfig*)sal_op_get_user_pointer(op);
|
||||
char *msg;
|
||||
gstate_new_state(lc, GSTATE_REG_OK, NULL);
|
||||
cfg->registered=registered;
|
||||
gstate_new_state(lc, GSTATE_REG_OK, NULL);
|
||||
if (cfg->registered) msg=ms_strdup_printf(_("Registration on %s successful."),sal_op_get_proxy(op));
|
||||
else msg=ms_strdup_printf(_("Unregistration on %s done."),sal_op_get_proxy(op));
|
||||
if (lc->vtable.display_status)
|
||||
|
|
|
|||
|
|
@ -352,16 +352,38 @@ extern "C" void Java_org_linphone_core_LinphoneProxyConfigImpl_setIdentity(JNIEn
|
|||
linphone_proxy_config_set_identity((LinphoneProxyConfig*)proxyCfg,identity);
|
||||
env->ReleaseStringUTFChars(jidentity, identity);
|
||||
}
|
||||
extern "C" jstring Java_org_linphone_core_LinphoneProxyConfigImpl_getIdentity(JNIEnv* env,jobject thiz,jlong proxyCfg) {
|
||||
const char* identity = linphone_proxy_config_get_identity((LinphoneProxyConfig*)proxyCfg);
|
||||
if (identity) {
|
||||
return env->NewStringUTF(identity);
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
extern "C" int Java_org_linphone_core_LinphoneProxyConfigImpl_setProxy(JNIEnv* env,jobject thiz,jlong proxyCfg,jstring jproxy) {
|
||||
const char* proxy = env->GetStringUTFChars(jproxy, NULL);
|
||||
int err=linphone_proxy_config_set_server_addr((LinphoneProxyConfig*)proxyCfg,proxy);
|
||||
env->ReleaseStringUTFChars(jproxy, proxy);
|
||||
return err;
|
||||
}
|
||||
extern "C" jstring Java_org_linphone_core_LinphoneProxyConfigImpl_getProxy(JNIEnv* env,jobject thiz,jlong proxyCfg) {
|
||||
const char* proxy = linphone_proxy_config_get_addr((LinphoneProxyConfig*)proxyCfg);
|
||||
if (proxy) {
|
||||
return env->NewStringUTF(proxy);
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" void Java_org_linphone_core_LinphoneProxyConfigImpl_enableRegister(JNIEnv* env,jobject thiz,jlong proxyCfg,jboolean enableRegister) {
|
||||
linphone_proxy_config_enable_register((LinphoneProxyConfig*)proxyCfg,enableRegister);
|
||||
}
|
||||
extern "C" jboolean Java_org_linphone_core_LinphoneProxyConfigImpl_isRegistered(JNIEnv* env,jobject thiz,jlong proxyCfg) {
|
||||
return linphone_proxy_config_is_registered((LinphoneProxyConfig*)proxyCfg);
|
||||
}
|
||||
extern "C" jboolean Java_org_linphone_core_LinphoneProxyConfigImpl_isRegisterEnabled(JNIEnv* env,jobject thiz,jlong proxyCfg) {
|
||||
return linphone_proxy_config_register_enabled((LinphoneProxyConfig*)proxyCfg);
|
||||
}
|
||||
extern "C" void Java_org_linphone_core_LinphoneProxyConfigImpl_edit(JNIEnv* env,jobject thiz,jlong proxyCfg) {
|
||||
linphone_proxy_config_edit((LinphoneProxyConfig*)proxyCfg);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,39 +28,44 @@ public interface LinphoneCore {
|
|||
* linphone core states
|
||||
*/
|
||||
static public class GeneralState {
|
||||
/* states for GSTATE_GROUP_POWER */
|
||||
static GeneralState GSTATE_POWER_OFF = new GeneralState(0); /* initial state */
|
||||
static GeneralState GSTATE_POWER_STARTUP = new GeneralState(1);
|
||||
static GeneralState GSTATE_POWER_ON = new GeneralState(2);
|
||||
static GeneralState GSTATE_POWER_SHUTDOWN = new GeneralState(3);
|
||||
/* states for GSTATE_GROUP_REG */
|
||||
static GeneralState GSTATE_REG_NONE = new GeneralState(10); /* initial state */
|
||||
static GeneralState GSTATE_REG_OK = new GeneralState(11);
|
||||
static GeneralState GSTATE_REG_FAILED = new GeneralState(12);
|
||||
/* states for GSTATE_GROUP_CALL */
|
||||
static GeneralState GSTATE_CALL_IDLE = new GeneralState(20); /* initial state */
|
||||
static GeneralState GSTATE_CALL_OUT_INVITE = new GeneralState(21);
|
||||
static GeneralState GSTATE_CALL_OUT_CONNECTED = new GeneralState(22);
|
||||
static GeneralState GSTATE_CALL_IN_INVITE = new GeneralState(23);
|
||||
static GeneralState GSTATE_CALL_IN_CONNECTED = new GeneralState(24);
|
||||
static GeneralState GSTATE_CALL_END = new GeneralState(25);
|
||||
static GeneralState GSTATE_CALL_ERROR = new GeneralState(26);
|
||||
static GeneralState GSTATE_INVALID = new GeneralState(27);
|
||||
private final int mValue;
|
||||
static private Vector values = new Vector();
|
||||
|
||||
private GeneralState(int value) {
|
||||
mValue = value;
|
||||
values.addElement(this);
|
||||
}
|
||||
public static GeneralState fromInt(int value) {
|
||||
|
||||
for (int i=0; i<values.size();i++) {
|
||||
GeneralState state = (GeneralState) values.elementAt(i);
|
||||
if (state.mValue == value) return state;
|
||||
static private Vector values = new Vector();
|
||||
/* states for GSTATE_GROUP_POWER */
|
||||
static public GeneralState GSTATE_POWER_OFF = new GeneralState(0,"GSTATE_POWER_OFF"); /* initial state */
|
||||
static public GeneralState GSTATE_POWER_STARTUP = new GeneralState(1,"GSTATE_POWER_STARTUP");
|
||||
static public GeneralState GSTATE_POWER_ON = new GeneralState(2,"GSTATE_POWER_ON");
|
||||
static public GeneralState GSTATE_POWER_SHUTDOWN = new GeneralState(3,"GSTATE_POWER_SHUTDOWN");
|
||||
/* states for GSTATE_GROUP_REG */
|
||||
static public GeneralState GSTATE_REG_NONE = new GeneralState(10,"GSTATE_REG_NONE"); /* initial state */
|
||||
static public GeneralState GSTATE_REG_OK = new GeneralState(11,"GSTATE_REG_OK");
|
||||
static public GeneralState GSTATE_REG_FAILED = new GeneralState(12,"GSTATE_REG_FAILED");
|
||||
/* states for GSTATE_GROUP_CALL */
|
||||
static public GeneralState GSTATE_CALL_IDLE = new GeneralState(20,"GSTATE_CALL_IDLE"); /* initial state */
|
||||
static public GeneralState GSTATE_CALL_OUT_INVITE = new GeneralState(21,"GSTATE_CALL_OUT_INVITE");
|
||||
static public GeneralState GSTATE_CALL_OUT_CONNECTED = new GeneralState(22,"GSTATE_CALL_OUT_CONNECTED");
|
||||
static public GeneralState GSTATE_CALL_IN_INVITE = new GeneralState(23,"GSTATE_CALL_IN_INVITE");
|
||||
static public GeneralState GSTATE_CALL_IN_CONNECTED = new GeneralState(24,"GSTATE_CALL_IN_CONNECTED");
|
||||
static public GeneralState GSTATE_CALL_END = new GeneralState(25,"GSTATE_CALL_END");
|
||||
static public GeneralState GSTATE_CALL_ERROR = new GeneralState(26,"GSTATE_CALL_ERROR");
|
||||
static public GeneralState GSTATE_INVALID = new GeneralState(27,"GSTATE_INVALID");
|
||||
private final int mValue;
|
||||
private final String mStringValue;
|
||||
|
||||
private GeneralState(int value,String stringValue) {
|
||||
mValue = value;
|
||||
values.addElement(this);
|
||||
mStringValue=stringValue;
|
||||
}
|
||||
public static GeneralState fromInt(int value) {
|
||||
|
||||
for (int i=0; i<values.size();i++) {
|
||||
GeneralState state = (GeneralState) values.elementAt(i);
|
||||
if (state.mValue == value) return state;
|
||||
}
|
||||
throw new RuntimeException("state not found ["+value+"]");
|
||||
}
|
||||
public String toString() {
|
||||
return mStringValue;
|
||||
}
|
||||
throw new RuntimeException("sate not found ["+value+"]");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -46,7 +46,7 @@ abstract public class LinphoneCoreFactory {
|
|||
}
|
||||
return theLinphoneCoreFactory;
|
||||
}
|
||||
abstract public LinphoneAuthInfo createAuthInfo(String username,String password);
|
||||
abstract public LinphoneAuthInfo createAuthInfo(String username,String password, String realm);
|
||||
|
||||
abstract public LinphoneCore createLinphoneCore(LinphoneCoreListener listener, String userConfig,String factoryConfig,Object userdata) throws LinphoneCoreException;
|
||||
|
||||
47
java/j2me/org/linphone/core/LinphoneCoreException.java
Normal file
47
java/j2me/org/linphone/core/LinphoneCoreException.java
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
/*
|
||||
LinphoneCoreException.java
|
||||
Copyright (C) 2010 Belledonne Communications, Grenoble, France
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
package org.linphone.core;
|
||||
|
||||
|
||||
public class LinphoneCoreException extends Exception {
|
||||
Throwable mE;
|
||||
public LinphoneCoreException() {
|
||||
super();
|
||||
}
|
||||
|
||||
public LinphoneCoreException(String detailMessage) {
|
||||
super(detailMessage);
|
||||
|
||||
}
|
||||
public LinphoneCoreException(Throwable e) {
|
||||
mE = e;
|
||||
}
|
||||
|
||||
public LinphoneCoreException(String detailMessage,Throwable e) {
|
||||
super(detailMessage);
|
||||
mE = e;
|
||||
}
|
||||
|
||||
public void printStackTrace() {
|
||||
super.printStackTrace();
|
||||
mE.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -29,11 +29,11 @@ public class LinphoneCoreException extends Exception {
|
|||
}
|
||||
|
||||
public LinphoneCoreException(Throwable e) {
|
||||
super(e.getMessage());
|
||||
super(e);
|
||||
}
|
||||
|
||||
public LinphoneCoreException(String detailMessage,Throwable e) {
|
||||
super(detailMessage +" reason ["+e.getMessage()+"]");
|
||||
super(detailMessage,e);
|
||||
}
|
||||
|
||||
|
||||
Loading…
Add table
Reference in a new issue