Skip to content

Commit

Permalink
Rool back
Browse files Browse the repository at this point in the history
  • Loading branch information
devjva committed Feb 27, 2020
1 parent b1a50b5 commit 4eced46
Show file tree
Hide file tree
Showing 41 changed files with 490 additions and 747 deletions.
61 changes: 1 addition & 60 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,62 +1,3 @@
Based on https://github.com/sezerkorkmaz/cordova-plugin-sip

(Now working on mobile network)


```
var sipManager = {
register: function () {
cordova.plugins.sip.login('Extension', 'Password', 'IP Address:Port', function (e) {
if (e == 'RegistrationSuccess') {
console.log(e);
sipManager.listen();
} else {
alert("Registration Failed!");
}
}, function (e) { console.log(e) })
},
call: function () {
cordova.plugins.sip.call('sip:111@192.168.1.111:5060', '203', sipManager.events, sipManager.events)
},
listen: function () {
cordova.plugins.sip.listenCall(sipManager.events, sipManager.events);
},
hangup: function () {
cordova.plugins.sip.hangup(function (e) { console.log(e) }, function (e) { console.log(e) })
},
updateRegister: function () {
cordova.plugins.sip.updateRegister(function (e) { console.log(e) }, function (e) { console.log(e) })
},
getRemoteContact: function () {
return cordova.plugins.sip.getRemoteContact(function (e) { return(e) }, function (e) { return.log(e) })
},
events: function (e) {
console.log(e);
if (e == 'Incoming') {
var r = confirm("Incoming Call");
if (r == true) {
cordova.plugins.sip.accept(true, sipManager.events, sipManager.events);
} else {
}
}
if (e == 'Connected') {
alert("Connected!");
sipManager.listen();
}
if (e == 'Error') {
alert("Call Error!");
sipManager.listen();
}
if (e == 'End') {
alert("Call End!");
sipManager.listen();
}
}
}
Now working on mobile network*
52 changes: 0 additions & 52 deletions package.json

This file was deleted.

37 changes: 32 additions & 5 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,41 @@
<source-file src="src/android/res/raw/ringback.wav" target-dir="res/raw" />
<source-file src="src/android/res/raw/toy_mono.wav" target-dir="res/raw" />
<source-file src="src/android/res/raw/rootca.pem" target-dir="res/raw" />

<source-file src="src/android/libs/linphone.jar" target-dir="libs" />
<source-file src="src/android/libs/armeabi/liblinphone-armeabi.so" target-dir="libs/armeabi" />
<source-file src="src/android/libs/armeabi-v7a/libffmpeg-linphone-arm.so" target-dir="libs/armeabi-v7a" />

<source-file src="src/android/libs/arm64-v8a/libbctoolbox-arm64-v8a.so" target-dir="libs/arm64-v8a" />
<source-file src="src/android/libs/arm64-v8a/libbctoolbox-tester-arm64-v8a.so" target-dir="libs/arm64-v8a" />
<source-file src="src/android/libs/arm64-v8a/libgnustl_shared.so" target-dir="libs/arm64-v8a" />
<source-file src="src/android/libs/arm64-v8a/liblinphone-arm64-v8a.so" target-dir="libs/arm64-v8a" />
<source-file src="src/android/libs/arm64-v8a/liblinphonetester-arm64-v8a.so" target-dir="libs/arm64-v8a" />
<source-file src="src/android/libs/arm64-v8a/libmediastreamer_base-arm64-v8a.so" target-dir="libs/arm64-v8a" />
<source-file src="src/android/libs/arm64-v8a/libmediastreamer_voip-arm64-v8a.so" target-dir="libs/arm64-v8a" />
<source-file src="src/android/libs/arm64-v8a/libmssilk.so" target-dir="libs/arm64-v8a" />
<source-file src="src/android/libs/arm64-v8a/libmswebrtc.so" target-dir="libs/arm64-v8a" />
<source-file src="src/android/libs/arm64-v8a/libortp-arm64-v8a.so" target-dir="libs/arm64-v8a" />

<source-file src="src/android/libs/armeabi-v7a/libbctoolbox-armeabi-v7a.so" target-dir="libs/armeabi-v7a" />
<source-file src="src/android/libs/armeabi-v7a/libbctoolbox-tester-armeabi-v7a.so" target-dir="libs/armeabi-v7a" />
<source-file src="src/android/libs/armeabi-v7a/libgnustl_shared.so" target-dir="libs/armeabi-v7a" />
<source-file src="src/android/libs/armeabi-v7a/liblinphone-armeabi-v7a.so" target-dir="libs/armeabi-v7a" />
<source-file src="src/android/libs/x86/libffmpeg-linphone-x86.so" target-dir="libs/x86" />
<source-file src="src/android/libs/armeabi-v7a/liblinphonetester-armeabi-v7a.so" target-dir="libs/armeabi-v7a" />
<source-file src="src/android/libs/armeabi-v7a/libmediastreamer_base-armeabi-v7a.so" target-dir="libs/armeabi-v7a" />
<source-file src="src/android/libs/armeabi-v7a/libmediastreamer_voip-armeabi-v7a.so" target-dir="libs/armeabi-v7a" />
<source-file src="src/android/libs/armeabi-v7a/libmssilk.so" target-dir="libs/armeabi-v7a" />
<source-file src="src/android/libs/armeabi-v7a/libmswebrtc.so" target-dir="libs/armeabi-v7a" />
<source-file src="src/android/libs/armeabi-v7a/libortp-armeabi-v7a.so" target-dir="libs/armeabi-v7a" />

<source-file src="src/android/libs/x86/libbctoolbox-tester-x86.so" target-dir="libs/x86" />
<source-file src="src/android/libs/x86/libbctoolbox-x86.so" target-dir="libs/x86" />
<source-file src="src/android/libs/x86/libgnustl_shared.so" target-dir="libs/x86" />
<source-file src="src/android/libs/x86/liblinphonetester-x86.so" target-dir="libs/x86" />
<source-file src="src/android/libs/x86/liblinphone-x86.so" target-dir="libs/x86" />
<source-file src="src/android/libs/x86/libmediastreamer_base-x86.so" target-dir="libs/x86" />
<source-file src="src/android/libs/x86/libmediastreamer_voip-x86.so" target-dir="libs/x86" />
<source-file src="src/android/libs/x86/libmssilk.so" target-dir="libs/x86" />
<source-file src="src/android/libs/x86/libmswebrtc.so" target-dir="libs/x86" />
<source-file src="src/android/libs/x86/libortp-x86.so" target-dir="libs/x86" />

<js-module src="www/cordova-plugins-sip.js" name="linphone">
<merges target="cordova.plugins.sip" />
Expand All @@ -50,8 +79,6 @@
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.READ_PRIVILEGED_PHONE_STATE" />
</config-file>
<config-file target="AndroidManifest.xml" parent="/manifest/application">
<activity android:name="com.sip.linphone.LinphoneMiniActivity" android:theme="@android:style/Theme.Black.NoTitleBar" />
Expand Down
Binary file not shown.
Binary file not shown.
Binary file added src/android/libs/arm64-v8a/libgnustl_shared.so
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added src/android/libs/arm64-v8a/libmssilk.so
Binary file not shown.
Binary file added src/android/libs/arm64-v8a/libmswebrtc.so
Binary file not shown.
Binary file added src/android/libs/arm64-v8a/libortp-arm64-v8a.so
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added src/android/libs/armeabi-v7a/libgnustl_shared.so
Binary file not shown.
Binary file modified src/android/libs/armeabi-v7a/liblinphone-armeabi-v7a.so
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added src/android/libs/armeabi-v7a/libmssilk.so
Binary file not shown.
Binary file added src/android/libs/armeabi-v7a/libmswebrtc.so
Binary file not shown.
Binary file not shown.
Binary file modified src/android/libs/linphone.jar
Binary file not shown.
Binary file added src/android/libs/x86/libbctoolbox-tester-x86.so
Binary file not shown.
Binary file added src/android/libs/x86/libbctoolbox-x86.so
Binary file not shown.
Binary file removed src/android/libs/x86/libffmpeg-linphone-x86.so
Binary file not shown.
Binary file added src/android/libs/x86/libgnustl_shared.so
Binary file not shown.
Binary file modified src/android/libs/x86/liblinphone-x86.so
Binary file not shown.
Binary file added src/android/libs/x86/liblinphonetester-x86.so
Binary file not shown.
Binary file added src/android/libs/x86/libmediastreamer_base-x86.so
Binary file not shown.
Binary file added src/android/libs/x86/libmediastreamer_voip-x86.so
Binary file not shown.
Binary file added src/android/libs/x86/libmssilk.so
Binary file not shown.
Binary file added src/android/libs/x86/libmswebrtc.so
Binary file not shown.
Binary file added src/android/libs/x86/libortp-x86.so
Binary file not shown.
4 changes: 0 additions & 4 deletions src/android/res/raw/linphonerc_default
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,3 @@ push_notification=1
[tunnel]
host=
port=443

[sound]
playback_gain_db=15

58 changes: 2 additions & 56 deletions src/android/src/Linphone.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@
import org.linphone.core.LinphoneCore;
import org.linphone.core.LinphoneProxyConfig;
import org.linphone.mediastream.Log;
import org.linphone.core.LinphoneCall;
import org.linphone.core.LinphoneCall.State;
import org.linphone.core.LinphoneCallParams;
import org.linphone.core.LinphoneCallStats;

import java.util.Timer;

Expand Down Expand Up @@ -203,34 +199,6 @@ public void run() {
});
return true;
}
else if (action.equals("updateRegister")) {

cordova.getThreadPool().execute(new Runnable() {
public void run() {
try {
updateRegister(callbackContext);

} catch (Exception e) {
Log.d("login error", e.getMessage());
}
}
});
return true;
}
else if (action.equals("getRemoteContact")) {

cordova.getThreadPool().execute(new Runnable() {
public void run() {
try {
getRemoteContact(callbackContext);

} catch (Exception e) {
Log.d("login error", e.getMessage());
}
}
});
return true;
}
return false;
}

Expand Down Expand Up @@ -342,34 +310,12 @@ public static synchronized void sendDtmf(final String number, final CallbackCont
try {
Log.d("sendDtmf");
mLinphoneManager.sendDtmf(number.charAt(0));
Log.d("sendDtmf sukses", number);
callbackContext.success();
} catch (Exception e) {
Log.d("sendDtmf error", e.getMessage());
callbackContext.error(e.getMessage());
}
}

public static synchronized void updateRegister(final CallbackContext callbackContext) {
try {
Log.d("Update Register");
mLinphoneManager.getLc().refreshRegisters();
callbackContext.success();
} catch (Exception e) {
Log.d("Update Error", e.getMessage());
callbackContext.error(e.getMessage());
}
}


public static synchronized void getRemoteContact (final CallbackContext callbackContext) {
try {
Log.d("Get Remote Contact");
LinphoneCall call = mLinphoneManager.getLc().getCurrentCall();
callbackContext.success(call.getRemoteContact().split("@")[0].split(":")[1]);
} catch (Exception e) {
Log.d("Update Error", e.getMessage());
callbackContext.success('0');
}
}

}
}
Loading

0 comments on commit 4eced46

Please sign in to comment.