Skip to content

Commit

Permalink
Add support for incoming call pre-checking
Browse files Browse the repository at this point in the history
  • Loading branch information
DoubangoTelecom committed Sep 6, 2018
1 parent 40459d2 commit bf37f78
Show file tree
Hide file tree
Showing 14 changed files with 35 additions and 8 deletions.
14 changes: 7 additions & 7 deletions android-ngn-stack/android-ngn-stack.iml
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,20 @@
<sourceFolder url="file://$MODULE_DIR$/assets" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/bundles" />
Expand Down
Binary file modified android-ngn-stack/libs/armeabi-v7a/libplugin_audio_opensles.so
Binary file not shown.
Binary file modified android-ngn-stack/libs/armeabi-v7a/libtinyWRAP.so
Binary file not shown.
Binary file modified android-ngn-stack/libs/armeabi-v7a/libtinyWRAP_neon.so
Binary file not shown.
Binary file modified android-ngn-stack/libs/armeabi/libplugin_audio_opensles.so
Binary file not shown.
Binary file modified android-ngn-stack/libs/armeabi/libtinyWRAP.so
Binary file not shown.
Binary file modified android-ngn-stack/libs/x86/libplugin_audio_opensles.so
Binary file not shown.
Binary file modified android-ngn-stack/libs/x86/libtinyWRAP.so
Binary file not shown.
2 changes: 1 addition & 1 deletion android-ngn-stack/src/org/doubango/ngn/NgnEngine.java
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ protected NgnEngine(){
SipStack.setCodecPriority(tdav_codec_id_t.tdav_codec_id_theora, prio++);
SipStack.setCodecPriority(tdav_codec_id_t.tdav_codec_id_h263, prio++);
SipStack.setCodecPriority(tdav_codec_id_t.tdav_codec_id_h261, prio++);

// Profile
MediaSessionMgr.defaultsSetProfile(tmedia_profile_t.valueOf(configurationService.getString(
NgnConfigurationEntry.MEDIA_PROFILE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -947,6 +947,21 @@ else if ((sessionType == twrap_media_type_t.twrap_media_audio) ||
}
break;

case tsip_i_prechecking:
// This means we're the server side (receiving the call)
// << TODO(dmi): add here some code to check whether to continue processing the call or not >>
if (session == null) { // must be null
if ((session = e.takeCallSessionOwnership()) == null){
Log.e(TAG,"Failed to take MSRP session ownership");
return -1;
}
//session.reject(); // terminate the call
session.accept(); // send ringing message and continue processing the call

session.delete(); // **must**
}
break;

case tsip_ao_request:
// For backward compatibility keep both "RINGING" and "SIP_RESPONSE"
if (code == 180 && session != null){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,14 @@ public static int defaultsGetNoiseSuppLevel() {
return tinyWRAPJNI.MediaSessionMgr_defaultsGetNoiseSuppLevel();
}

public static boolean defaultsSetConditionalRingingEnabled(boolean _cond_ringing_enabled) {
return tinyWRAPJNI.MediaSessionMgr_defaultsSetConditionalRingingEnabled(_cond_ringing_enabled);
}

public static boolean defaultsGetConditionalRingingEnabled() {
return tinyWRAPJNI.MediaSessionMgr_defaultsGetConditionalRingingEnabled();
}

public static boolean defaultsSet100relEnabled(boolean _100rel_enabled) {
return tinyWRAPJNI.MediaSessionMgr_defaultsSet100relEnabled(_100rel_enabled);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public interface tinyWRAPConstants {
public final static int tsip_event_code_dialog_request_outgoing = 802;
public final static int tsip_event_code_dialog_request_cancelled = 803;
public final static int tsip_event_code_dialog_request_sent = 804;
public final static int tsip_event_code_dialog_request_prechecking = 805;
public final static int tsip_event_code_dialog_connecting = 900;
public final static int tsip_event_code_dialog_connected = 901;
public final static int tsip_event_code_dialog_terminating = 902;
Expand Down
2 changes: 2 additions & 0 deletions android-ngn-stack/src/org/doubango/tinyWRAP/tinyWRAPJNI.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ public class tinyWRAPJNI {
public final static native boolean MediaSessionMgr_defaultsGetNoiseSuppEnabled();
public final static native boolean MediaSessionMgr_defaultsSetNoiseSuppLevel(int jarg1);
public final static native int MediaSessionMgr_defaultsGetNoiseSuppLevel();
public final static native boolean MediaSessionMgr_defaultsSetConditionalRingingEnabled(boolean jarg1);
public final static native boolean MediaSessionMgr_defaultsGetConditionalRingingEnabled();
public final static native boolean MediaSessionMgr_defaultsSet100relEnabled(boolean jarg1);
public final static native boolean MediaSessionMgr_defaultsGet100relEnabled();
public final static native boolean MediaSessionMgr_defaultsSetScreenSize(int jarg1, int jarg2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

public enum tsip_invite_event_type_t {
tsip_i_newcall,
tsip_i_prechecking,
tsip_i_request,
tsip_ao_request,
tsip_o_ect_trying,
Expand Down

0 comments on commit bf37f78

Please sign in to comment.