diff --git a/.classpath b/.classpath index 609aa00eb..c38155c75 100644 --- a/.classpath +++ b/.classpath @@ -1,6 +1,7 @@ + diff --git a/.gitmodules b/.gitmodules index a1ba6ae43..4b9ab1166 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,15 @@ [submodule "msandroid"] - path = msandroid + path = submodules/msandroid url = gitosis@belledonne-communications.com:msandroid.git +[submodule "linphone"] + path = submodules/linphone + url = gitosis@belledonne-communications.com:linphone-private.git +[submodule "submodules/externals/osip"] + path = submodules/externals/osip + url = git://git.savannah.gnu.org/osip.git +[submodule "submodules/externals/exosip"] + path = submodules/externals/exosip + url = git://git.savannah.nongnu.org/exosip.git +[submodule "submodules/externals/gsm"] + path = submodules/externals/gsm + url = gitosis@belledonne-communications.com:gsm.git diff --git a/Android.mk b/Android.mk new file mode 100644 index 000000000..22ed03c14 --- /dev/null +++ b/Android.mk @@ -0,0 +1,20 @@ +root-dir:=$(call my-dir) + +include $(root-dir)/speex/Android.mk + +include $(root-dir)/gsm/Android.mk + +include $(root-dir)/eXosip/Android.mk + +include $(root-dir)/osip/Android.mk + +include $(root-dir)/../../linphone-android/linphone/oRTP/build/android/Android.mk + +include $(root-dir)/../../linphone-android/linphone/mediastreamer2/build/android/Android.mk + +include $(root-dir)/../../linphone-android/msandroid/Android.mk + +include $(root-dir)/../../linphone-android/linphone/build/android/Android.mk + + + diff --git a/AndroidManifest.xml b/AndroidManifest.xml index d1b0acf95..7538489e8 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -1,8 +1,8 @@ + android:versionCode="108" + android:versionName="1.08"> diff --git a/libs/armeabi/liblinphone.so b/libs/armeabi/liblinphone.so index a18908b89..0c4f6676a 100755 Binary files a/libs/armeabi/liblinphone.so and b/libs/armeabi/liblinphone.so differ diff --git a/msandroid b/msandroid deleted file mode 160000 index 534b59768..000000000 --- a/msandroid +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 534b597686e900f0f92786eede8bbac1ce85ff19 diff --git a/res/raw/linphonerc b/res/raw/linphonerc index 234fb1092..905235b83 100644 --- a/res/raw/linphonerc +++ b/res/raw/linphonerc @@ -7,7 +7,7 @@ mtu=0 [sip] sip_port=5060 guess_hostname=1 -contact=sip:jehanmonnier@unknown-host +contact=sip:unknown@unknown-host inc_timeout=15 use_info=0 use_ipv6=0 diff --git a/src/org/linphone/LinphoneActivity.java b/src/org/linphone/LinphoneActivity.java index 966646414..c2ec98354 100644 --- a/src/org/linphone/LinphoneActivity.java +++ b/src/org/linphone/LinphoneActivity.java @@ -82,6 +82,7 @@ public class LinphoneActivity extends TabActivity implements SensorEventListener List lSensorList = mSensorManager.getSensorList(Sensor.TYPE_PROXIMITY); if (lSensorList.size() >0) { mSensorManager.registerListener(this,lSensorList.get(0),SensorManager.SENSOR_DELAY_UI); + Log.i(LinphoneService.TAG, "Proximity sensor detected, registering"); } mAudioManager = ((AudioManager)getSystemService(Context.AUDIO_SERVICE)); @@ -220,11 +221,16 @@ public class LinphoneActivity extends TabActivity implements SensorEventListener } public void onSensorChanged(SensorEvent event) { + Log.d(LinphoneService.TAG, "Proximity sensor report ["+event.values[0]+"] , for max range ["+event.sensor.getMaximumRange()+"]"); if (LinphoneService.isready() == false) return; //nop nothing to do - if (LinphoneService.instance().getLinphoneCore().isIncall() && event.values[0] == 0) { + if (LinphoneService.instance().getLinphoneCore().isIncall() + && event.values[0] != event.sensor.getMaximumRange() + && event.values[0] < 3) { hideScreen(true); - } else if (mMainFrame.getVisibility() != View.VISIBLE && event.values[0] == 1) { + } else if (mMainFrame.getVisibility() != View.VISIBLE + && (event.values[0] == event.sensor.getMaximumRange() + || event.values[0] >=3)) { hideScreen(false); } } diff --git a/src/org/linphone/LinphoneService.java b/src/org/linphone/LinphoneService.java index 97542837d..0853abb1d 100644 --- a/src/org/linphone/LinphoneService.java +++ b/src/org/linphone/LinphoneService.java @@ -89,6 +89,11 @@ public class LinphoneService extends Service implements LinphoneCoreListener { mLinphoneCore.setSoftPlayLevel(3); + try { + initFromConf(); + } catch (LinphoneException e) { + Log.w(TAG, "no config ready yet"); + } TimerTask lTask = new TimerTask() { @Override public void run() { diff --git a/src/org/linphone/core/LinphoneAddress.java b/src/org/linphone/core/LinphoneAddress.java deleted file mode 100644 index 86271674c..000000000 --- a/src/org/linphone/core/LinphoneAddress.java +++ /dev/null @@ -1,46 +0,0 @@ -/* -LinphoneAddress.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 interface LinphoneAddress { - /** - * Human display name - * @return null if not set - */ - public String getDisplayName(); - /** - * userinfo - * @return null if not set - */ - public String getUserName(); - /** - * - * @return null if not set - */ - public String getDomain(); - /** - * set display name - * @param name - */ - public void setDisplayName(String name); - /** - * @return an URI version of the address that can be used to place a call using {@link LinphoneCore#invite(String)} - */ - public String toUri(); -} diff --git a/src/org/linphone/core/LinphoneAuthInfo.java b/src/org/linphone/core/LinphoneAuthInfo.java deleted file mode 100644 index 2a5dbaf2d..000000000 --- a/src/org/linphone/core/LinphoneAuthInfo.java +++ /dev/null @@ -1,25 +0,0 @@ -/* -LinphoneAuthInfo.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 interface LinphoneAuthInfo { - -} - - diff --git a/src/org/linphone/core/LinphoneCallLog.java b/src/org/linphone/core/LinphoneCallLog.java deleted file mode 100644 index 19d851a43..000000000 --- a/src/org/linphone/core/LinphoneCallLog.java +++ /dev/null @@ -1,31 +0,0 @@ -/* -LinPhoneCallLog.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 interface LinphoneCallLog { - public enum CallDirection { - CallOutgoing,Callincoming - } - - public LinphoneAddress getFrom(); - - public LinphoneAddress getTo (); - - public LinphoneCallLog.CallDirection getDirection(); -} diff --git a/src/org/linphone/core/LinphoneCore.java b/src/org/linphone/core/LinphoneCore.java deleted file mode 100644 index 8609e04e1..000000000 --- a/src/org/linphone/core/LinphoneCore.java +++ /dev/null @@ -1,177 +0,0 @@ -/* -LinphoneCore.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; - -import java.util.List; - - - -public interface LinphoneCore { - /* - * linphone core states - */ - public enum GeneralState { - /* states for GSTATE_GROUP_POWER */ - GSTATE_POWER_OFF(0), /* initial state */ - GSTATE_POWER_STARTUP(1), - GSTATE_POWER_ON(2), - GSTATE_POWER_SHUTDOWN(3), - /* states for GSTATE_GROUP_REG */ - GSTATE_REG_NONE(10), /* initial state */ - GSTATE_REG_OK(11), - GSTATE_REG_FAILED(12), - /* states for GSTATE_GROUP_CALL */ - GSTATE_CALL_IDLE(20), /* initial state */ - GSTATE_CALL_OUT_INVITE(21), - GSTATE_CALL_OUT_CONNECTED(22), - GSTATE_CALL_IN_INVITE(23), - GSTATE_CALL_IN_CONNECTED(24), - GSTATE_CALL_END(25), - GSTATE_CALL_ERROR(26), - GSTATE_INVALID(27); - private final int mValue; - - GeneralState(int value) { - mValue = value; - } - public static GeneralState fromInt(int value) { - for (GeneralState state: GeneralState.values()) { - if (state.mValue == value) return state; - } - throw new RuntimeException("sate not found ["+value+"]"); - } - } - - - /** - * @param identity sip uri sip:jehan@linphone.org - * @param proxy sip uri (sip:linphone.org) - * @param route optionnal sip usi (sip:linphone.org) - * @param register should be initiated - * @return - */ - public LinphoneProxyConfig createProxyConfig(String identity,String proxy,String route,boolean enableRegister) throws LinphoneCoreException; - /** - * clear all added proxy config - */ - public void clearProxyConfigs(); - - public void addProxyConfig(LinphoneProxyConfig proxyCfg) throws LinphoneCoreException; - - public void setDefaultProxyConfig(LinphoneProxyConfig proxyCfg); - - /** - * @return null if no default proxy config - */ - public LinphoneProxyConfig getDefaultProxyConfig() ; - - /** - * clear all the added auth info - */ - void clearAuthInfos(); - - void addAuthInfo(LinphoneAuthInfo info); - - public void invite(String uri); - - public void invite(LinphoneAddress to); - - public void terminateCall(); - /** - * get the remote address in case of in/out call - * @return null if no call engaged yet - */ - public LinphoneAddress getRemoteAddress(); - /** - * - * @return TRUE if there is a call running or pending. - */ - public boolean isIncall(); - /** - * - * @return Returns true if in incoming call is pending, ie waiting for being answered or declined. - */ - public boolean isInComingInvitePending(); - public void iterate(); - /** - * Accept an incoming call. - * - * Basically the application is notified of incoming calls within the - * {@link LinphoneCoreListener#inviteReceived(LinphoneCore, String)} listener. - * The application can later respond positively to the call using - * this method. - */ - public void acceptCall(); - - - /** - * @return a list of LinphoneCallLog - */ - public List getCallLogs(); - - /** - * This method is called by the application to notify the Linphone core library when network is reachable. - * Calling this method with true trigger Linphone to initiate a registration process for all proxy - * configuration with parameter register set to enable. - * This method disable the automatic registration mode. It means you must call this method after each network state changes - * @param network state - * - */ - public void setNetworkStateReachable(boolean isReachable); - /** - * destroy linphone core and free all underlying resources - */ - public void destroy(); - /** - * Allow to control play level before entering sound card: - * @param level in db - */ - public void setSoftPlayLevel(float gain); - /** - * get play level before entering sound card: - * @return level in db - */ - public float getSoftPlayLevel(); - /** - * Mutes or unmutes the local microphone. - * @param isMuted - */ - public void muteMic(boolean isMuted); - /** - * - * @return true is mic is muted - */ - public boolean isMicMuted(); - /** - * Build an address according to the current proxy config. In case destination is not a sip uri, the default proxy domain is automatically appended - * @param destination - * @return - * @throws If no LinphonrAddress can be built from destination - */ - public LinphoneAddress interpretUrl(String destination) throws LinphoneCoreException; - /** - * Initiate a dtmf signal if in call - * @param number - */ - public void sendDtmf(char number); - /** - * - */ - public void clearCallLogs(); -} diff --git a/src/org/linphone/core/LinphoneCoreException.java b/src/org/linphone/core/LinphoneCoreException.java deleted file mode 100644 index abec2943e..000000000 --- a/src/org/linphone/core/LinphoneCoreException.java +++ /dev/null @@ -1,43 +0,0 @@ -/* -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; - -@SuppressWarnings("serial") -public class LinphoneCoreException extends Exception { - - public LinphoneCoreException() { - // TODO Auto-generated constructor stub - } - - public LinphoneCoreException(String detailMessage) { - super(detailMessage); - // TODO Auto-generated constructor stub - } - - public LinphoneCoreException(Throwable throwable) { - super(throwable); - // TODO Auto-generated constructor stub - } - - public LinphoneCoreException(String detailMessage, Throwable throwable) { - super(detailMessage, throwable); - // TODO Auto-generated constructor stub - } - -} diff --git a/src/org/linphone/core/LinphoneCoreFactory.java b/src/org/linphone/core/LinphoneCoreFactory.java deleted file mode 100644 index 24315f6dd..000000000 --- a/src/org/linphone/core/LinphoneCoreFactory.java +++ /dev/null @@ -1,53 +0,0 @@ -/* -LinphoneCoreFactory.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; - -import java.io.File; -import java.io.IOException; - -public class LinphoneCoreFactory { - - static { - System.loadLibrary("linphone"); - } - static LinphoneCoreFactory theLinphoneCoreFactory = new LinphoneCoreFactory(); - - public static LinphoneCoreFactory instance() { - - return theLinphoneCoreFactory; - } - public LinphoneAuthInfo createAuthInfo(String username,String password) { - return new LinphoneAuthInfoImpl(username,password) ; - } - - public LinphoneCore createLinphoneCore(LinphoneCoreListener listener, File userConfig,File factoryConfig,Object userdata) throws IOException { - return new LinphoneCoreImpl(listener,userConfig,factoryConfig,userdata); - } - - public LinphoneAddress createLinphoneAddress(String username,String domain,String displayName) { - return new LinphoneAddressImpl(username,domain,displayName); - } - - /** - * Enable verbose traces - * @param enable - */ - public native void setDebugMode(boolean enable); - -} diff --git a/src/org/linphone/core/LinphoneCoreListener.java b/src/org/linphone/core/LinphoneCoreListener.java deleted file mode 100644 index f48f8a9eb..000000000 --- a/src/org/linphone/core/LinphoneCoreListener.java +++ /dev/null @@ -1,51 +0,0 @@ -/* -LinphoneCoreListener.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 interface LinphoneCoreListener { - - /**< Notifies the application that it should show up - * @return */ - public void show(LinphoneCore lc); - /**< Notifies incoming calls - * @return */ - public void inviteReceived(LinphoneCore lc,String from); - /**< Notify calls terminated by far end - * @return */ - public void byeReceived(LinphoneCore lc,String from); - /**< Ask the application some authentication information - * @return */ - public void authInfoRequested(LinphoneCore lc,String realm,String username); - /**< Callback that notifies various events with human readable text. - * @return */ - public void displayStatus(LinphoneCore lc,String message); - /**< Callback to display a message to the user - * @return */ - public void displayMessage(LinphoneCore lc,String message); - /** Callback to display a warning to the user - * @return */ - public void displayWarning(LinphoneCore lc,String message); - /** State notification callback - * @param state LinphoneCore.GeneralState - * @return - * */ - public void generalState(LinphoneCore lc,LinphoneCore.GeneralState state); -} diff --git a/src/org/linphone/core/LinphoneProxyConfig.java b/src/org/linphone/core/LinphoneProxyConfig.java deleted file mode 100644 index a7fe6b850..000000000 --- a/src/org/linphone/core/LinphoneProxyConfig.java +++ /dev/null @@ -1,71 +0,0 @@ -/* -LinphoneProxyConfig.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 interface LinphoneProxyConfig { - - /** - * Unregister proxy config a enable edition - */ - public void edit(); - /** - * Validate proxy config changes. Start registration in case - */ - public void done(); - /** - * sip user made by sip:username@domain - */ - public void setIdentity(String identity) throws LinphoneCoreException; - /** - * Set proxy uri, like sip:linphone.org:5060 - * @param proxyUri - * @throws LinphoneCoreException - */ - public void setProxy(String proxyUri) throws LinphoneCoreException; - /** - * Enable register for this proxy config. - * Register message is issued after call to {@link #done()} - * @param value - * @throws LinphoneCoreException - */ - public void enableRegister(boolean value) throws LinphoneCoreException; - /** - * normalize a human readable phone number into a basic string. 888-444-222 becomes 888444222 - * @param number - * @return - */ - public String normalizePhoneNumber(String number); - /** - * usefull function to automatically add internationnal prefix to e164 phone numbers - * @param prefix - */ - public void setDialPrefix(String prefix); - /** - * * Sets whether liblinphone should replace "+" by "00" in dialed numbers (passed to - * {@link LinphoneCore#invite(String)}). - * @param value default value is false - */ - public void setDialEscapePlus(boolean value); - - /** - * rget domain host name or ip - * @return may be null - */ - public String getDomain(); -} diff --git a/submodules/externals/exosip b/submodules/externals/exosip new file mode 160000 index 000000000..75d46b970 --- /dev/null +++ b/submodules/externals/exosip @@ -0,0 +1 @@ +Subproject commit 75d46b9700cbdd38d6ab9bd8ee6113887843457b diff --git a/submodules/externals/gsm b/submodules/externals/gsm new file mode 160000 index 000000000..405fb3856 --- /dev/null +++ b/submodules/externals/gsm @@ -0,0 +1 @@ +Subproject commit 405fb3856f0b9e902dcb159ec6a3409ba6e78476 diff --git a/submodules/externals/osip b/submodules/externals/osip new file mode 160000 index 000000000..e5f6e71ab --- /dev/null +++ b/submodules/externals/osip @@ -0,0 +1 @@ +Subproject commit e5f6e71ab72748b44745dfc3781f7ae284b5e0db