Skip to content
Snippets Groups Projects
Commit 7b151705 authored by Alexandre Lision's avatar Alexandre Lision
Browse files

Fix daemon callbacks

Callbacks weren't properly transmited to java layer. Problem was in swig's descriptions
of these callbacks not being properly channeled to java and instead being emitted in stub declaration.

Refs #53478
parent 96a1ef0d
No related branches found
No related tags found
No related merge requests found
......@@ -249,7 +249,7 @@ else
echo "Bootstraping"
pushd ../../../
echo $PWD
./configure.sh
./configure.sh --with-opensl --without-dbus
cd sflphone/daemon
echo "Building"
make $MAKEFLAGS
......
......@@ -35,7 +35,7 @@
#
# Make sure that:
# Download android_ndk_
# Download android_ndk_
# android_sdk_
# Install java runtime engine, ant
# Required dependencies
......@@ -47,6 +47,7 @@ export ANDROID_SDK=$HOME/android-buildtools/sdk
export ANDROID_HOME=$HOME/android-buildtools/sdk
export GENYMOTION_HOME=$HOME/android-buildtools/genymotion
export ANDROID_NDK_ROOT=$ANDROID_NDK
export ANDROID_ABI=armeabi-v7a
ANDROID_SDK_TOOLS=$ANDROID_SDK/tools
......@@ -68,7 +69,7 @@ ANDROID_TEST_PACKAGE=org.sflphone.tests
ANDROID_TEST_RUNNNER=android.test.InstrumentationTestRunner
print_help() {
echo "Init sflphone-android test server, run test suite
echo "Init sflphone-android test server, run test suite
Options:
-h Print this help message
-i Init test server environment (should be run only once)
......@@ -103,7 +104,7 @@ launch_emulator() {
echo "Waiting for device ..."
adb wait-for-device
# adb push launch-sflphone.sh /data/data
# adb shell sh /data/data/launch-sflphone.sh
}
......@@ -122,36 +123,10 @@ build_sflphone_android() {
echo "----------------- Cleaning git tree"
git checkout master
git pull
# get rid of any local modifications to git submodule
git submodule update
pushd jni/sflphone
git checkout master
git pull
echo "----------------- Daemon setup"
cd daemon/libs
./compile_pjsip.sh -a
cd ..
./autogen.sh
./configure-android.sh
popd
cd sflphone-android
./make-swig.sh
cd jni/
echo "----------------- Build JNI related libraries"
# ndk-build clean
$ANDROID_NDK/ndk-build -j4
cd ..
echo "----------------- Build Java application"
ant update project -p .
ant clean
ant debug
# echo "Upload sflphone on the virtual device"
#adb install -r $ANDROID_SFLPHONE_BIN
# ./adb-push-sflphone.sh
cd ..
./compile
}
build_sflphone_test_suite() {
......
......@@ -11,7 +11,7 @@
<sourceFolder url="file://$MODULE_DIR$/gen" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="true" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="jdk" jdkName="Android API 19 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="libs" level="project" />
<orderEntry type="module" module-name="sflphone-android" />
......
......@@ -63,7 +63,7 @@ public:
%}
%feature("director") CallManagerCallback;
%feature("director") Callback;
bool sflph_call_place(const std::string& account_id, const std::string& call_id, const std::string& to);
bool sflph_call_refuse(const std::string& call_id);
......
......@@ -117,13 +117,13 @@ bool sflph_config_check_hostname_certificate(const std::string& host, const std:
class ConfigurationCallback {
public:
virtual ~ConfigurationCallback();
void configOnVolumeChange(const std::string& device, int value);
void configOnAccountsChange(void);
void configOnHistoryChange(void);
void configOnStunStatusFail(const std::string& account_id);
void configOnRegistrationStateChange(const std::string& account_id, int state);
void configOnSipRegistrationStateChange(const std::string& account_id, const std::string& state, int code);
void configOnError(int alert);
std::vector<int32_t> configGetHardwareAudioFormat(void);
virtual void configOnVolumeChange(const std::string& device, int value);
virtual void configOnAccountsChange(void);
virtual void configOnHistoryChange(void);
virtual void configOnStunStatusFail(const std::string& account_id);
virtual void configOnRegistrationStateChange(const std::string& account_id, int state);
virtual void configOnSipRegistrationStateChange(const std::string& account_id, const std::string& state, int code);
virtual void configOnError(int alert);
virtual std::vector<int32_t> configGetHardwareAudioFormat(void);
};
......@@ -33,14 +33,6 @@
#include "sflphone.h"
%}
/**
* Initializes libsflphone.
*
* @param ev_handlers Event handlers
* @param flags Flags to customize this initialization
* @returns 0 if successful or a negative error code
*/
int sflph_init(struct sflph_ev_handlers* ev_handlers, int flags);
/**
* Finalizes libsflphone, freeing any resource allocated by the library.
......
......@@ -11,10 +11,9 @@
<sourceFolder url="file://$MODULE_DIR$/gen" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="jdk" jdkName="Android API 19 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="libs" level="project" />
<orderEntry type="module" module-name="sflphone-android" />
</component>
</module>
......@@ -34,6 +34,7 @@ public class CallManagerCallBack extends Callback {
public CallManagerCallBack(SipService context) {
super();
mService = context;
}
......
......@@ -34,6 +34,7 @@ public class ConfigurationManagerCallback extends ConfigurationCallback {
static public final String ACCOUNT_STATE_CHANGED = "account-state-changed";
public ConfigurationManagerCallback(SipService context) {
super();
mService = context;
}
......@@ -89,14 +90,13 @@ public class ConfigurationManagerCallback extends ConfigurationCallback {
strState = "NUMBER_OF_STATES";
break;
}
sendAccountStateChangedMessage(accoundID, strState, 0);
}
@Override
public void configOnSipRegistrationStateChange(String account_id, String state, int code) {
Log.d(TAG, "configOnSipRegistrationStateChange : (" + account_id);
}
@Override
......@@ -105,7 +105,6 @@ public class ConfigurationManagerCallback extends ConfigurationCallback {
}
private void sendAccountStateChangedMessage(String accoundID, String state, int code) {
Log.i(TAG, "sendAccountStateChangedMessage");
Intent intent = new Intent(ACCOUNT_STATE_CHANGED);
intent.putExtra("Account", accoundID);
intent.putExtra("state", state);
......
......@@ -50,8 +50,6 @@ public class SipService extends Service {
private SipServiceExecutor mExecutor;
private static HandlerThread executorThread;
private Handler handler = new Handler();
private static int POLLING_TIMEOUT = 500;
private Runnable pollEvents = new Runnable() {
......@@ -61,8 +59,6 @@ public class SipService extends Service {
handler.postDelayed(this, POLLING_TIMEOUT);
}
};
private CallManagerCallBack callManagerCallBack;
private ConfigurationManagerCallback configurationManagerCallback;
private boolean isPjSipStackStarted = false;
protected SipNotifications mNotificationManager;
......@@ -70,8 +66,8 @@ public class SipService extends Service {
protected MediaManager mMediaManager;
private HashMap<String, Conference> mConferences = new HashMap<String, Conference>();
private ConfigurationCallback conf;
private CallManagerCallBack call;
private ConfigurationManagerCallback configurationCallback;
private CallManagerCallBack callManagerCallBack;
public HashMap<String, Conference> getConferences() {
return mConferences;
......@@ -257,9 +253,9 @@ public class SipService extends Service {
isPjSipStackStarted = false;
}
conf = new ConfigurationCallback();
call = new CallManagerCallBack(this);
SFLPhoneservice.init(conf, call);
configurationCallback = new ConfigurationManagerCallback(this);
callManagerCallBack = new CallManagerCallBack(this);
SFLPhoneservice.init(configurationCallback, callManagerCallBack);
handler.postDelayed(pollEvents, POLLING_TIMEOUT);
Log.i(TAG, "PjSIPStack started");
}
......
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