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

Use new API in SipService

Still some issues about static/virtual declarations of methods for
Callback and ConfigurationCallback generated files.
parent 9c450ae8
Branches
Tags
No related merge requests found
Showing
with 239 additions and 305 deletions
...@@ -2,30 +2,19 @@ ...@@ -2,30 +2,19 @@
<module type="JAVA_MODULE" version="4"> <module type="JAVA_MODULE" version="4">
<component name="FacetManager"> <component name="FacetManager">
<facet type="android" name="Android"> <facet type="android" name="Android">
<configuration> <configuration />
<option name="PACK_TEST_CODE" value="true" />
<option name="UPDATE_PROPERTY_FILES" value="true" />
</configuration>
</facet> </facet>
</component> </component>
<component name="NewModuleRootManager" inherit-compiler-output="true"> <component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output /> <exclude-output />
<content url="file://$MODULE_DIR$"> <content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/gen" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/gen" isTestSource="false" generated="true" /> <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="true" />
</content> </content>
<orderEntry type="inheritedJdk" /> <orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="SFLPhone" scope="PROVIDED" /> <orderEntry type="library" name="libs" level="project" />
<orderEntry type="module-library" exported=""> <orderEntry type="module" module-name="sflphone-android" />
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/../libs/robotium-solo-5.0.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
</component> </component>
</module> </module>
revision.txt
builddate.txt
builder.txt
env.txt
2014-08-07
tmatth@bodega
719259d
...@@ -32,32 +32,32 @@ ...@@ -32,32 +32,32 @@
#include "sflphone.h" #include "sflphone.h"
class CallManagerCallback { class Callback {
public: public:
virtual ~CallManagerCallback() {} virtual ~Callback() {}
static void callOnStateChange(const std::string& call_id, const std::string& state){} virtual void callOnStateChange(const std::string& call_id, const std::string& state){}
static void callOnTransferFail(void){} virtual void callOnTransferFail(void){}
static void callOnTransferSuccess(void){} virtual void callOnTransferSuccess(void){}
static void callOnRecordPlaybackStopped(const std::string& path){} virtual void callOnRecordPlaybackStopped(const std::string& path){}
static void callOnVoiceMailNotify(const std::string& call_id, int nd_msg){} virtual void callOnVoiceMailNotify(const std::string& call_id, int nd_msg){}
static void callOnIncomingMessage(const std::string& id, const std::string& from, const std::string& msg){} virtual void callOnIncomingMessage(const std::string& id, const std::string& from, const std::string& msg){}
static void callOnIncomingCall(const std::string& account_id, const std::string& call_id, const std::string& from){} virtual void callOnIncomingCall(const std::string& account_id, const std::string& call_id, const std::string& from){}
static void callOnRecordPlaybackFilepath(const std::string& id, const std::string& filename){} virtual void callOnRecordPlaybackFilepath(const std::string& id, const std::string& filename){}
static void callOnConferenceCreated(const std::string& conf_id){} virtual void callOnConferenceCreated(const std::string& conf_id){}
static void callOnConferenceChanged(const std::string& conf_id, const std::string& state){} virtual void callOnConferenceChanged(const std::string& conf_id, const std::string& state){}
static void callOnUpdatePlaybackScale(const std::string& filepath, int position, int scale){} virtual void callOnUpdatePlaybackScale(const std::string& filepath, int position, int scale){}
static void callOnConferenceRemove(const std::string& conf_id){} virtual void callOnConferenceRemove(const std::string& conf_id){}
static void callOnNewCall(const std::string& account_id, const std::string& call_id, const std::string& to){} virtual void callOnNewCall(const std::string& account_id, const std::string& call_id, const std::string& to){}
static void callOnSipCallStateChange(const std::string& call_id, const std::string& state, int code){} virtual void callOnSipCallStateChange(const std::string& call_id, const std::string& state, int code){}
static void callOnRecordStateChange(const std::string& call_id, int state){} virtual void callOnRecordStateChange(const std::string& call_id, int state){}
static void callOnSecureSdesOn(const std::string& call_id){} virtual void callOnSecureSdesOn(const std::string& call_id){}
static void callOnSecureSdesOff(const std::string& call_id){} virtual void callOnSecureSdesOff(const std::string& call_id){}
static void callOnSecureZrtpOn(const std::string& call_id, const std::string& cipher){} virtual void callOnSecureZrtpOn(const std::string& call_id, const std::string& cipher){}
static void callOnSecureZrtpOff(const std::string& call_id){} virtual void callOnSecureZrtpOff(const std::string& call_id){}
static void callOnShowSas(const std::string& call_id, const std::string& sas, int verified){} virtual void callOnShowSas(const std::string& call_id, const std::string& sas, int verified){}
static void callOnZrtpNotSuppOther(const std::string& call_id){} virtual void callOnZrtpNotSuppOther(const std::string& call_id){}
static void callOnZrtpNegotiationFail(const std::string& call_id, const std::string& reason, const std::string& severity){} virtual void callOnZrtpNegotiationFail(const std::string& call_id, const std::string& reason, const std::string& severity){}
static void callOnRtcpReceiveReport(const std::string& call_id, const std::map<std::string, int>& stats){} virtual void callOnRtcpReceiveReport(const std::string& call_id, const std::map<std::string, int>& stats){}
}; };
...@@ -107,30 +107,30 @@ void sflph_call_request_go_clear(const std::string& call_id); ...@@ -107,30 +107,30 @@ void sflph_call_request_go_clear(const std::string& call_id);
void sflph_call_accept_enrollment(const std::string& call_id, bool accepted); void sflph_call_accept_enrollment(const std::string& call_id, bool accepted);
void sflph_call_send_text_message(const std::string& call_id, const std::string& message); void sflph_call_send_text_message(const std::string& call_id, const std::string& message);
class CallManagerCallback { class Callback {
public: public:
virtual ~CallManagerCallback(); virtual ~Callback();
static void callOnStateChange(const std::string& call_id, const std::string& state); virtual void callOnStateChange(const std::string& call_id, const std::string& state);
static void callOnTransferFail(void); virtual void callOnTransferFail(void);
static void callOnTransferSuccess(void); virtual void callOnTransferSuccess(void);
static void callOnRecordPlaybackStopped(const std::string& path); virtual void callOnRecordPlaybackStopped(const std::string& path);
static void callOnVoiceMailNotify(const std::string& call_id, int nd_msg); virtual void callOnVoiceMailNotify(const std::string& call_id, int nd_msg);
static void callOnIncomingMessage(const std::string& id, const std::string& from, const std::string& msg); virtual void callOnIncomingMessage(const std::string& id, const std::string& from, const std::string& msg);
static void callOnIncomingCall(const std::string& account_id, const std::string& call_id, const std::string& from); virtual void callOnIncomingCall(const std::string& account_id, const std::string& call_id, const std::string& from);
static void callOnRecordPlaybackFilepath(const std::string& id, const std::string& filename); virtual void callOnRecordPlaybackFilepath(const std::string& id, const std::string& filename);
static void callOnConferenceCreated(const std::string& conf_id); virtual void callOnConferenceCreated(const std::string& conf_id);
static void callOnConferenceChanged(const std::string& conf_id, const std::string& state); virtual void callOnConferenceChanged(const std::string& conf_id, const std::string& state);
static void callOnUpdatePlaybackScale(const std::string& filepath, int position, int scale); virtual void callOnUpdatePlaybackScale(const std::string& filepath, int position, int scale);
static void callOnConferenceRemove(const std::string& conf_id); virtual void callOnConferenceRemove(const std::string& conf_id);
static void callOnNewCall(const std::string& account_id, const std::string& call_id, const std::string& to); virtual void callOnNewCall(const std::string& account_id, const std::string& call_id, const std::string& to);
static void callOnSipCallStateChange(const std::string& call_id, const std::string& state, int code); virtual void callOnSipCallStateChange(const std::string& call_id, const std::string& state, int code);
static void callOnRecordStateChange(const std::string& call_id, int state); virtual void callOnRecordStateChange(const std::string& call_id, int state);
static void callOnSecureSdesOn(const std::string& call_id); virtual void callOnSecureSdesOn(const std::string& call_id);
static void callOnSecureSdesOff(const std::string& call_id); virtual void callOnSecureSdesOff(const std::string& call_id);
static void callOnSecureZrtpOn(const std::string& call_id, const std::string& cipher); virtual void callOnSecureZrtpOn(const std::string& call_id, const std::string& cipher);
static void callOnSecureZrtpOff(const std::string& call_id); virtual void callOnSecureZrtpOff(const std::string& call_id);
static void callOnShowSas(const std::string& call_id, const std::string& sas, int verified); virtual void callOnShowSas(const std::string& call_id, const std::string& sas, int verified);
static void callOnZrtpNotSuppOther(const std::string& call_id); virtual void callOnZrtpNotSuppOther(const std::string& call_id);
static void callOnZrtpNegotiationFail(const std::string& call_id, const std::string& reason, const std::string& severity); virtual void callOnZrtpNegotiationFail(const std::string& call_id, const std::string& reason, const std::string& severity);
static void callOnRtcpReceiveReport(const std::string& call_id, const std::map<std::string, int>& stats); virtual void callOnRtcpReceiveReport(const std::string& call_id, const std::map<std::string, int>& stats);
}; };
...@@ -33,14 +33,14 @@ ...@@ -33,14 +33,14 @@
class ConfigurationCallback { class ConfigurationCallback {
public: public:
virtual ~ConfigurationCallback(){} virtual ~ConfigurationCallback(){}
static void configOnVolumeChange(const std::string& device, int value){} virtual void configOnVolumeChange(const std::string& device, int value){}
static void configOnAccountsChange(void){} virtual void configOnAccountsChange(void){}
static void configOnHistoryChange(void){} virtual void configOnHistoryChange(void){}
static void configOnStunStatusFail(const std::string& account_id){} virtual void configOnStunStatusFail(const std::string& account_id){}
static void configOnRegistrationStateChange(const std::string& account_id, int state){} virtual void configOnRegistrationStateChange(const std::string& account_id, int state){}
static void configOnSipRegistrationStateChange(const std::string& account_id, const std::string& state, int code){} virtual void configOnSipRegistrationStateChange(const std::string& account_id, const std::string& state, int code){}
static void configOnError(int alert){} virtual void configOnError(int alert){}
virtual std::vector<int32_t> configGetHardwareAudioFormat(void){}
}; };
%} %}
...@@ -117,13 +117,13 @@ bool sflph_config_check_hostname_certificate(const std::string& host, const std: ...@@ -117,13 +117,13 @@ bool sflph_config_check_hostname_certificate(const std::string& host, const std:
class ConfigurationCallback { class ConfigurationCallback {
public: public:
virtual ~ConfigurationCallback(); virtual ~ConfigurationCallback();
static void configOnVolumeChange(const std::string& device, int value); void configOnVolumeChange(const std::string& device, int value);
static void configOnAccountsChange(void); void configOnAccountsChange(void);
static void configOnHistoryChange(void); void configOnHistoryChange(void);
static void configOnStunStatusFail(const std::string& account_id); void configOnStunStatusFail(const std::string& account_id);
static void configOnRegistrationStateChange(const std::string& account_id, int state); void configOnRegistrationStateChange(const std::string& account_id, int state);
static void configOnSipRegistrationStateChange(const std::string& account_id, const std::string& state, int code); void configOnSipRegistrationStateChange(const std::string& account_id, const std::string& state, int code);
static void configOnError(int alert); void configOnError(int alert);
std::vector<int32_t> configGetHardwareAudioFormat(void);
}; };
...@@ -87,33 +87,33 @@ namespace std { ...@@ -87,33 +87,33 @@ namespace std {
/* some functions that need to be declared in *_wrap.cpp /* some functions that need to be declared in *_wrap.cpp
* that are not declared elsewhere in the c++ code * that are not declared elsewhere in the c++ code
*/ */
void init(ConfigurationCallback* conf_cb, CallManagerCallback* call_cb) { void init(ConfigurationCallback* conf_cb, Callback* call_cb) {
// Call event handlers // Call event handlers
sflph_call_ev_handlers callEvHandlers = { sflph_call_ev_handlers callEvHandlers = {
CallManagerCallback::callOnStateChange, Callback::callOnStateChange,
CallManagerCallback::callOnTransferFail, Callback::callOnTransferFail,
CallManagerCallback::callOnTransferSuccess, Callback::callOnTransferSuccess,
CallManagerCallback::callOnRecordPlaybackStopped, Callback::callOnRecordPlaybackStopped,
CallManagerCallback::callOnVoiceMailNotify, Callback::callOnVoiceMailNotify,
CallManagerCallback::callOnIncomingMessage, Callback::callOnIncomingMessage,
CallManagerCallback::callOnIncomingCall, Callback::callOnIncomingCall,
CallManagerCallback::callOnRecordPlaybackFilepath, Callback::callOnRecordPlaybackFilepath,
CallManagerCallback::callOnConferenceCreated, Callback::callOnConferenceCreated,
CallManagerCallback::callOnConferenceChanged, Callback::callOnConferenceChanged,
CallManagerCallback::callOnUpdatePlaybackScale, Callback::callOnUpdatePlaybackScale,
CallManagerCallback::callOnConferenceRemove, Callback::callOnConferenceRemove,
CallManagerCallback::callOnNewCall, Callback::callOnNewCall,
CallManagerCallback::callOnSipCallStateChange, Callback::callOnSipCallStateChange,
CallManagerCallback::callOnRecordStateChange, Callback::callOnRecordStateChange,
CallManagerCallback::callOnSecureSdesOn, Callback::callOnSecureSdesOn,
CallManagerCallback::callOnSecureSdesOff, Callback::callOnSecureSdesOff,
CallManagerCallback::callOnSecureZrtpOn, Callback::callOnSecureZrtpOn,
CallManagerCallback::callOnSecureZrtpOff, Callback::callOnSecureZrtpOff,
CallManagerCallback::callOnShowSas, Callback::callOnShowSas,
CallManagerCallback::callOnZrtpNotSuppOther, Callback::callOnZrtpNotSuppOther,
CallManagerCallback::callOnZrtpNegotiationFail, Callback::callOnZrtpNegotiationFail,
CallManagerCallback::callOnRtcpReceiveReport, Callback::callOnRtcpReceiveReport,
}; };
// Configuration event handlers // Configuration event handlers
...@@ -125,19 +125,14 @@ void init(ConfigurationCallback* conf_cb, CallManagerCallback* call_cb) { ...@@ -125,19 +125,14 @@ void init(ConfigurationCallback* conf_cb, CallManagerCallback* call_cb) {
ConfigurationCallback::configOnRegistrationStateChange, ConfigurationCallback::configOnRegistrationStateChange,
ConfigurationCallback::configOnSipRegistrationStateChange, ConfigurationCallback::configOnSipRegistrationStateChange,
ConfigurationCallback::configOnError, ConfigurationCallback::configOnError,
ConfigurationCallback::configGetHardwareAudioFormat,
}; };
// All event handlers // All event handlers
sflph_ev_handlers evHandlers; sflph_ev_handlers evHandlers = {};
memset(std::addressof(evHandlers), 0, sizeof(evHandlers));
evHandlers.call_ev_handlers = callEvHandlers; evHandlers.call_ev_handlers = callEvHandlers;
evHandlers.config_ev_handlers = configEvHandlers; evHandlers.config_ev_handlers = configEvHandlers;
sflph_init(&evHandlers, 0); sflph_init(&evHandlers, 0);
} }
%} %}
......
...@@ -30,8 +30,9 @@ ...@@ -30,8 +30,9 @@
/* %nodefaultctor ManagerImpl; /* %nodefaultctor ManagerImpl;
%nodefaultdtor ManagerImpl; */ %nodefaultdtor ManagerImpl; */
%header %{ %header %{
#include "sflphone.h" #include "sflphone.h"
%}
/** /**
* Initializes libsflphone. * Initializes libsflphone.
* *
...@@ -50,7 +51,3 @@ void sflph_fini(void); ...@@ -50,7 +51,3 @@ void sflph_fini(void);
* Poll for SIP/IAX events * Poll for SIP/IAX events
*/ */
void sflph_poll_events(void); void sflph_poll_events(void);
%}
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<sourceFolder url="file://$MODULE_DIR$/gen" isTestSource="false" generated="true" /> <sourceFolder url="file://$MODULE_DIR$/gen" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content> </content>
<orderEntry type="jdk" jdkName="Android API 19 Platform" jdkType="Android SDK" /> <orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="libs" level="project" /> <orderEntry type="library" name="libs" level="project" />
</component> </component>
......
...@@ -110,7 +110,7 @@ public class SecureSipCall extends SipCall { ...@@ -110,7 +110,7 @@ public class SecureSipCall extends SipCall {
} }
}; };
public void sasConfirmedByZrtpLayer(boolean verified) { public void sasConfirmedByZrtpLayer(int verified) {
// Not used // Not used
} }
......
...@@ -3,13 +3,11 @@ package org.sflphone.service; ...@@ -3,13 +3,11 @@ package org.sflphone.service;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.util.Log; import android.util.Log;
import org.sflphone.account.AccountDetailSrtp;
import org.sflphone.client.CallActivity; import org.sflphone.client.CallActivity;
import org.sflphone.model.*; import org.sflphone.model.*;
import org.sflphone.utils.SwigNativeConverter; import org.sflphone.utils.SwigNativeConverter;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Iterator;
import java.util.Map; import java.util.Map;
public class CallManagerCallBack extends Callback { public class CallManagerCallBack extends Callback {
...@@ -39,7 +37,7 @@ public class CallManagerCallBack extends Callback { ...@@ -39,7 +37,7 @@ public class CallManagerCallBack extends Callback {
} }
@Override @Override
public void on_call_state_changed(String callID, String newState) { public void callOnStateChange(String callID, String newState) {
Log.d(TAG, "on_call_state_changed : (" + callID + ", " + newState + ")"); Log.d(TAG, "on_call_state_changed : (" + callID + ", " + newState + ")");
Conference toUpdate = mService.findConference(callID); Conference toUpdate = mService.findConference(callID);
...@@ -79,7 +77,7 @@ public class CallManagerCallBack extends Callback { ...@@ -79,7 +77,7 @@ public class CallManagerCallBack extends Callback {
} else if (newState.equals("FAILURE")) { } else if (newState.equals("FAILURE")) {
toUpdate.setCallState(callID, SipCall.state.CALL_STATE_FAILURE); toUpdate.setCallState(callID, SipCall.state.CALL_STATE_FAILURE);
mService.getConferences().remove(toUpdate.getId()); mService.getConferences().remove(toUpdate.getId());
mService.getCallManagerJNI().hangUp(callID); SFLPhoneservice.sflph_call_hang_up(callID);
} else if (newState.equals("HOLD")) { } else if (newState.equals("HOLD")) {
toUpdate.setCallState(callID, SipCall.state.CALL_STATE_HOLD); toUpdate.setCallState(callID, SipCall.state.CALL_STATE_HOLD);
} else if (newState.equals("UNHOLD")) { } else if (newState.equals("UNHOLD")) {
...@@ -91,12 +89,12 @@ public class CallManagerCallBack extends Callback { ...@@ -91,12 +89,12 @@ public class CallManagerCallBack extends Callback {
@Override @Override
public void on_incoming_call(String accountID, String callID, String from) { public void callOnIncomingCall(String accountID, String callID, String from) {
Log.d(TAG, "on_incoming_call(" + accountID + ", " + callID + ", " + from + ")"); Log.d(TAG, "on_incoming_call(" + accountID + ", " + callID + ", " + from + ")");
try { try {
StringMap details = mService.getConfigurationManagerJNI().getAccountDetails(accountID); StringMap details = SFLPhoneservice.sflph_config_get_account_details(accountID);
VectMap credentials = mService.getConfigurationManagerJNI().getCredentials(accountID); VectMap credentials = SFLPhoneservice.sflph_config_get_credentials(accountID);
Account acc = new Account(accountID, SwigNativeConverter.convertAccountToNative(details), SwigNativeConverter.convertCredentialsToNative(credentials)); Account acc = new Account(accountID, SwigNativeConverter.convertAccountToNative(details), SwigNativeConverter.convertCredentialsToNative(credentials));
Bundle args = new Bundle(); Bundle args = new Bundle();
...@@ -137,26 +135,20 @@ public class CallManagerCallBack extends Callback { ...@@ -137,26 +135,20 @@ public class CallManagerCallBack extends Callback {
} }
@Override @Override
public void on_transfer_state_changed(String result) { public void callOnConferenceCreated(final String confID) {
Log.w(TAG, "TRANSFER STATE CHANGED:" + result);
}
@Override
public void on_conference_created(final String confID) {
Log.w(TAG, "CONFERENCE CREATED:" + confID); Log.w(TAG, "CONFERENCE CREATED:" + confID);
Intent intent = new Intent(CONF_CREATED); Intent intent = new Intent(CONF_CREATED);
Conference created = new Conference(confID); Conference created = new Conference(confID);
StringVect all_participants = mService.getCallManagerJNI().getParticipantList(confID); StringVect all_participants = SFLPhoneservice.sflph_call_get_participant_list(confID);
Log.w(TAG, "all_participants:" + all_participants.size()); Log.w(TAG, "all_participants:" + all_participants.size());
for (int i = 0; i < all_participants.size(); ++i) { for (int i = 0; i < all_participants.size(); ++i) {
if (mService.getConferences().get(all_participants.get(i)) != null) { if (mService.getConferences().get(all_participants.get(i)) != null) {
created.addParticipant(mService.getConferences().get(all_participants.get(i)).getCallById(all_participants.get(i))); created.addParticipant(mService.getConferences().get(all_participants.get(i)).getCallById(all_participants.get(i)));
mService.getConferences().remove(all_participants.get(i)); mService.getConferences().remove(all_participants.get(i));
} else { } else {
Iterator<Map.Entry<String, Conference>> it = mService.getConferences().entrySet().iterator(); for (Map.Entry<String, Conference> stringConferenceEntry : mService.getConferences().entrySet()) {
while (it.hasNext()) { Conference tmp = stringConferenceEntry.getValue();
Conference tmp = it.next().getValue();
for (SipCall c : tmp.getParticipants()) { for (SipCall c : tmp.getParticipants()) {
if (c.getCallId().contentEquals(all_participants.get(i))) { if (c.getCallId().contentEquals(all_participants.get(i))) {
created.addParticipant(c); created.addParticipant(c);
...@@ -173,7 +165,7 @@ public class CallManagerCallBack extends Callback { ...@@ -173,7 +165,7 @@ public class CallManagerCallBack extends Callback {
} }
@Override @Override
public void on_incoming_message(String ID, String from, String msg) { public void callOnIncomingMessage(String ID, String from, String msg) {
Log.w(TAG, "on_incoming_message:" + msg); Log.w(TAG, "on_incoming_message:" + msg);
Intent intent = new Intent(INCOMING_TEXT); Intent intent = new Intent(INCOMING_TEXT);
intent.putExtra("CallID", ID); intent.putExtra("CallID", ID);
...@@ -184,9 +176,8 @@ public class CallManagerCallBack extends Callback { ...@@ -184,9 +176,8 @@ public class CallManagerCallBack extends Callback {
mService.getConferences().get(ID).addSipMessage(new SipMessage(true, msg)); mService.getConferences().get(ID).addSipMessage(new SipMessage(true, msg));
intent.putExtra("conference", mService.getConferences().get(ID)); intent.putExtra("conference", mService.getConferences().get(ID));
} else { } else {
Iterator<Map.Entry<String, Conference>> it = mService.getConferences().entrySet().iterator(); for (Map.Entry<String, Conference> stringConferenceEntry : mService.getConferences().entrySet()) {
while (it.hasNext()) { Conference tmp = stringConferenceEntry.getValue();
Conference tmp = it.next().getValue();
for (SipCall c : tmp.getParticipants()) { for (SipCall c : tmp.getParticipants()) {
if (c.getCallId().contentEquals(ID)) { if (c.getCallId().contentEquals(ID)) {
mService.getConferences().get(tmp.getId()).addSipMessage(new SipMessage(true, msg)); mService.getConferences().get(tmp.getId()).addSipMessage(new SipMessage(true, msg));
...@@ -200,7 +191,7 @@ public class CallManagerCallBack extends Callback { ...@@ -200,7 +191,7 @@ public class CallManagerCallBack extends Callback {
} }
@Override @Override
public void on_conference_removed(String confID) { public void callOnConferenceRemove(String confID) {
Log.i(TAG, "on_conference_removed:"); Log.i(TAG, "on_conference_removed:");
Intent intent = new Intent(CONF_REMOVED); Intent intent = new Intent(CONF_REMOVED);
intent.putExtra("confID", confID); intent.putExtra("confID", confID);
...@@ -216,7 +207,7 @@ public class CallManagerCallBack extends Callback { ...@@ -216,7 +207,7 @@ public class CallManagerCallBack extends Callback {
} }
@Override @Override
public void on_conference_state_changed(String confID, String state) { public void callOnConferenceChanged(String confID, String state) {
Log.i(TAG, "on_conference_state_changed:"); Log.i(TAG, "on_conference_state_changed:");
Intent intent = new Intent(CONF_CHANGED); Intent intent = new Intent(CONF_CHANGED);
intent.putExtra("confID", confID); intent.putExtra("confID", confID);
...@@ -229,13 +220,13 @@ public class CallManagerCallBack extends Callback { ...@@ -229,13 +220,13 @@ public class CallManagerCallBack extends Callback {
Conference toModify = mService.getConferences().get(confID); Conference toModify = mService.getConferences().get(confID);
toModify.setCallState(confID, state); toModify.setCallState(confID, state);
ArrayList<String> newParticipants = SwigNativeConverter.convertSwigToNative(mService.getCallManagerJNI().getParticipantList(intent.getStringExtra("confID"))); ArrayList<String> newParticipants = SwigNativeConverter.convertSwigToNative(SFLPhoneservice.sflph_call_get_participant_list(intent.getStringExtra("confID")));
if (toModify.getParticipants().size() < newParticipants.size()) { if (toModify.getParticipants().size() < newParticipants.size()) {
// We need to add the new participant to the conf // We need to add the new participant to the conf
for (int i = 0; i < newParticipants.size(); ++i) { for (String newParticipant : newParticipants) {
if (toModify.getCallById(newParticipants.get(i)) == null) { if (toModify.getCallById(newParticipant) == null) {
mService.addCallToConference(toModify.getId(), newParticipants.get(i)); mService.addCallToConference(toModify.getId(), newParticipant);
} }
} }
} else if (toModify.getParticipants().size() > newParticipants.size()) { } else if (toModify.getParticipants().size() > newParticipants.size()) {
...@@ -252,15 +243,15 @@ public class CallManagerCallBack extends Callback { ...@@ -252,15 +243,15 @@ public class CallManagerCallBack extends Callback {
} }
@Override @Override
public void on_record_playback_filepath(String id, String filename) { public void callOnRecordPlaybackFilepath(String id, String filename) {
Intent intent = new Intent(RECORD_STATE_CHANGED); Intent intent = new Intent();
intent.putExtra("callID", id); intent.putExtra("callID", id);
intent.putExtra("file", filename); intent.putExtra("file", filename);
mService.sendBroadcast(intent); mService.sendBroadcast(intent);
} }
@Override @Override
public void on_secure_sdes_on(String callID) { public void callOnSecureSdesOn(String callID) {
Log.i(TAG, "on_secure_sdes_on"); Log.i(TAG, "on_secure_sdes_on");
SecureSipCall call = (SecureSipCall) mService.getCallById(callID); SecureSipCall call = (SecureSipCall) mService.getCallById(callID);
call.setInitialized(); call.setInitialized();
...@@ -268,7 +259,7 @@ public class CallManagerCallBack extends Callback { ...@@ -268,7 +259,7 @@ public class CallManagerCallBack extends Callback {
} }
@Override @Override
public void on_secure_sdes_off(String callID) { public void callOnSecureSdesOff(String callID) {
Log.i(TAG, "on_secure_sdes_off"); Log.i(TAG, "on_secure_sdes_off");
SecureSipCall call = (SecureSipCall) mService.getCallById(callID); SecureSipCall call = (SecureSipCall) mService.getCallById(callID);
call.setInitialized(); call.setInitialized();
...@@ -276,7 +267,7 @@ public class CallManagerCallBack extends Callback { ...@@ -276,7 +267,7 @@ public class CallManagerCallBack extends Callback {
} }
@Override @Override
public void on_secure_zrtp_on(String callID, String cipher) { public void callOnSecureZrtpOn(String callID, String cipher) {
Log.i(TAG, "on_secure_zrtp_on"); Log.i(TAG, "on_secure_zrtp_on");
Intent intent = new Intent(ZRTP_ON); Intent intent = new Intent(ZRTP_ON);
SecureSipCall call = (SecureSipCall) mService.getCallById(callID); SecureSipCall call = (SecureSipCall) mService.getCallById(callID);
...@@ -288,7 +279,7 @@ public class CallManagerCallBack extends Callback { ...@@ -288,7 +279,7 @@ public class CallManagerCallBack extends Callback {
} }
@Override @Override
public void on_secure_zrtp_off(String callID) { public void callOnSecureZrtpOff(String callID) {
Log.i(TAG, "on_secure_zrtp_off"); Log.i(TAG, "on_secure_zrtp_off");
Intent intent = new Intent(ZRTP_OFF); Intent intent = new Intent(ZRTP_OFF);
intent.putExtra("callID", callID); intent.putExtra("callID", callID);
...@@ -304,7 +295,7 @@ public class CallManagerCallBack extends Callback { ...@@ -304,7 +295,7 @@ public class CallManagerCallBack extends Callback {
} }
@Override @Override
public void on_show_sas(String callID, String sas, boolean verified) { public void callOnShowSas(String callID, String sas, int verified) {
Log.i(TAG, "on_show_sas:" + sas); Log.i(TAG, "on_show_sas:" + sas);
Intent intent = new Intent(DISPLAY_SAS); Intent intent = new Intent(DISPLAY_SAS);
SecureSipCall call = (SecureSipCall) mService.getCallById(callID); SecureSipCall call = (SecureSipCall) mService.getCallById(callID);
...@@ -319,7 +310,7 @@ public class CallManagerCallBack extends Callback { ...@@ -319,7 +310,7 @@ public class CallManagerCallBack extends Callback {
} }
@Override @Override
public void on_zrtp_not_supported(String callID) { public void callOnZrtpNotSuppOther(String callID) {
Log.i(TAG, "on_zrtp_not_supported"); Log.i(TAG, "on_zrtp_not_supported");
Intent intent = new Intent(ZRTP_NOT_SUPPORTED); Intent intent = new Intent(ZRTP_NOT_SUPPORTED);
SecureSipCall call = (SecureSipCall) mService.getCallById(callID); SecureSipCall call = (SecureSipCall) mService.getCallById(callID);
...@@ -331,7 +322,7 @@ public class CallManagerCallBack extends Callback { ...@@ -331,7 +322,7 @@ public class CallManagerCallBack extends Callback {
} }
@Override @Override
public void on_zrtp_negociation_failed(String callID, String reason, String severity) { public void callOnZrtpNegotiationFail(String callID, String reason, String severity) {
Log.i(TAG, "on_zrtp_negociation_failed"); Log.i(TAG, "on_zrtp_negociation_failed");
Intent intent = new Intent(ZRTP_NEGOTIATION_FAILED); Intent intent = new Intent(ZRTP_NEGOTIATION_FAILED);
SecureSipCall call = (SecureSipCall) mService.getCallById(callID); SecureSipCall call = (SecureSipCall) mService.getCallById(callID);
...@@ -343,7 +334,7 @@ public class CallManagerCallBack extends Callback { ...@@ -343,7 +334,7 @@ public class CallManagerCallBack extends Callback {
} }
@Override @Override
public void on_rtcp_report_received(String callID, IntegerMap stats) { public void callOnRtcpReceiveReport(String callID, IntegerMap stats) {
Log.i(TAG, "on_rtcp_report_received"); Log.i(TAG, "on_rtcp_report_received");
Intent intent = new Intent(RTCP_REPORT_RECEIVED); Intent intent = new Intent(RTCP_REPORT_RECEIVED);
mService.sendBroadcast(intent); mService.sendBroadcast(intent);
......
...@@ -23,10 +23,12 @@ ...@@ -23,10 +23,12 @@
package org.sflphone.service; package org.sflphone.service;
import android.content.Intent; import android.content.Intent;
import android.util.Log;
public class ConfigurationManagerCallback extends ConfigurationCallback { public class ConfigurationManagerCallback extends ConfigurationCallback {
private SipService mService; private SipService mService;
private static final String TAG = "ConfigurationManagerCallback";
static public final String ACCOUNTS_CHANGED = "accounts-changed"; static public final String ACCOUNTS_CHANGED = "accounts-changed";
static public final String ACCOUNT_STATE_CHANGED = "account-state-changed"; static public final String ACCOUNT_STATE_CHANGED = "account-state-changed";
...@@ -36,12 +38,24 @@ public class ConfigurationManagerCallback extends ConfigurationCallback { ...@@ -36,12 +38,24 @@ public class ConfigurationManagerCallback extends ConfigurationCallback {
} }
@Override @Override
public void on_accounts_changed() { public void configOnVolumeChange(String device, int value) {
sendAccountsChangedMessage(); super.configOnVolumeChange(device, value);
} }
@Override @Override
public void on_account_state_changed(String accoundID, int state) { public void configOnAccountsChange() {
super.configOnAccountsChange();
Intent intent = new Intent(ACCOUNTS_CHANGED);
mService.sendBroadcast(intent);
}
@Override
public void configOnStunStatusFail(String account_id) {
Log.d(TAG, "configOnStunStatusFail : (" + account_id);
}
@Override
public void configOnRegistrationStateChange(String accoundID, int state) {
String strState = ""; String strState = "";
switch (state){ switch (state){
case 0: case 0:
...@@ -77,15 +91,20 @@ public class ConfigurationManagerCallback extends ConfigurationCallback { ...@@ -77,15 +91,20 @@ public class ConfigurationManagerCallback extends ConfigurationCallback {
} }
sendAccountsStateChangedMessage(accoundID, strState, 0); sendAccountStateChangedMessage(accoundID, strState, 0);
} }
@Override @Override
public void on_account_state_changed_with_code(String accoundID, String state, int code) { public void configOnSipRegistrationStateChange(String account_id, String state, int code) {
// sendAccountsStateChangedMessage(accoundID, state, code); Log.d(TAG, "configOnSipRegistrationStateChange : (" + account_id);
} }
private void sendAccountsStateChangedMessage(String accoundID, String state, int code) { @Override
public void configOnError(int alert) {
Log.d(TAG, "configOnError : (" + alert);
}
private void sendAccountStateChangedMessage(String accoundID, String state, int code) {
Intent intent = new Intent(ACCOUNT_STATE_CHANGED); Intent intent = new Intent(ACCOUNT_STATE_CHANGED);
intent.putExtra("Account", accoundID); intent.putExtra("Account", accoundID);
intent.putExtra("state", state); intent.putExtra("state", state);
...@@ -93,12 +112,7 @@ public class ConfigurationManagerCallback extends ConfigurationCallback { ...@@ -93,12 +112,7 @@ public class ConfigurationManagerCallback extends ConfigurationCallback {
mService.sendBroadcast(intent); mService.sendBroadcast(intent);
} }
private void sendAccountsChangedMessage() { public IntVect configGetHardwareAudioFormat(){
Intent intent = new Intent(ACCOUNTS_CHANGED);
mService.sendBroadcast(intent);
}
public IntVect get_hardware_audio_format(){
IntVect result = new IntVect(); IntVect result = new IntVect();
OpenSlParams audioParams = OpenSlParams.createInstance(mService); OpenSlParams audioParams = OpenSlParams.createInstance(mService);
......
...@@ -27,7 +27,6 @@ interface ISipService { ...@@ -27,7 +27,6 @@ interface ISipService {
void setAudioPlugin(in String callID); void setAudioPlugin(in String callID);
String getCurrentAudioOutputPlugin(); String getCurrentAudioOutputPlugin();
List getAudioCodecList(in String accountID); List getAudioCodecList(in String accountID);
String getCurrentAudioCodecName(in String callID);
void setActiveCodecList(in List codecs, in String accountID); void setActiveCodecList(in List codecs, in String accountID);
Map getRingtoneList(); Map getRingtoneList();
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment