Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
liblinphone
Commits
cd6dfcab
Commit
cd6dfcab
authored
Jan 22, 2016
by
Simon Morlat
Browse files
add java wrappers for new reachability methods
parent
c329b106
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
65 additions
and
19 deletions
+65
-19
coreapi/linphonecore_jni.cc
coreapi/linphonecore_jni.cc
+19
-0
java/common/org/linphone/core/LinphoneCore.java
java/common/org/linphone/core/LinphoneCore.java
+15
-0
java/impl/org/linphone/core/LinphoneCoreImpl.java
java/impl/org/linphone/core/LinphoneCoreImpl.java
+31
-19
No files found.
coreapi/linphonecore_jni.cc
View file @
cd6dfcab
...
...
@@ -6814,3 +6814,22 @@ extern "C" jint Java_org_linphone_core_LinphoneConferenceImpl_removeParticipant(
LinphoneAddress
*
addr
=
(
LinphoneAddress
*
)
env
->
GetLongField
(
uri
,
native_ptr_attr
);
return
linphone_conference_remove_participant
((
LinphoneConference
*
)
pconference
,
addr
);
}
/*
* Class: org_linphone_core_LinphoneCoreImpl
* Method: setSipNetworkReachable
* Signature: (JZ)V
*/
JNIEXPORT
void
JNICALL
Java_org_linphone_core_LinphoneCoreImpl_setSipNetworkReachable
(
JNIEnv
*
env
,
jobject
jobj
,
jlong
pcore
,
jboolean
reachable
){
linphone_core_set_sip_network_reachable
((
LinphoneCore
*
)
pcore
,
(
bool_t
)
reachable
);
}
/*
* Class: org_linphone_core_LinphoneCoreImpl
* Method: setMediaNetworkReachable
* Signature: (JZ)V
*/
JNIEXPORT
void
JNICALL
Java_org_linphone_core_LinphoneCoreImpl_setMediaNetworkReachable
(
JNIEnv
*
env
,
jobject
jobj
,
jlong
pcore
,
jboolean
reachable
){
linphone_core_set_media_network_reachable
((
LinphoneCore
*
)
pcore
,
(
bool_t
)
reachable
);
}
java/common/org/linphone/core/LinphoneCore.java
View file @
cd6dfcab
...
...
@@ -2253,4 +2253,19 @@ public interface LinphoneCore {
*/
public
int
getNortpTimeout
();
/**
* This method is called by the application to notify the linphone core library when the SIP network is reachable.
* This is for advanced usage, when SIP and RTP layers are required to use different interfaces.
* Most applications just need LinphoneCore.setNetworkReachable().
* @param isReachable whether SIP network is reachable.
*/
public
void
setSipNetworkReachable
(
boolean
isReachable
);
/**
* This method is called by the application to notify the linphone core library when the media (RTP) network is reachable.
* This is for advanced usage, when SIP and RTP layers are required to use different interfaces.
* Most applications just need LinphoneCore.setNetworkReachable().
* @param isReachable whether media network is reachable.
*/
public
void
setMediaNetworkReachable
(
boolean
isReachable
);
}
java/impl/org/linphone/core/LinphoneCoreImpl.java
View file @
cd6dfcab
...
...
@@ -257,7 +257,7 @@ class LinphoneCoreImpl implements LinphoneCore {
}
public
synchronized
void
removeProxyConfig
(
LinphoneProxyConfig
proxyCfg
)
{
isValid
();
removeProxyConfig
(
nativePtr
,
((
LinphoneProxyConfigImpl
)
proxyCfg
).
nativePtr
);
removeProxyConfig
(
nativePtr
,
((
LinphoneProxyConfigImpl
)
proxyCfg
).
nativePtr
);
}
public
synchronized
void
clearAuthInfos
()
{
isValid
();
...
...
@@ -319,7 +319,7 @@ class LinphoneCoreImpl implements LinphoneCore {
}
}
public
synchronized
void
setNetworkReachable
(
boolean
isReachable
)
{
setNetworkStateReachable
(
nativePtr
,
isReachable
);
setNetworkStateReachable
(
nativePtr
,
isReachable
);
}
public
synchronized
void
setPlaybackGain
(
float
gain
)
{
setPlaybackGain
(
nativePtr
,
gain
);
...
...
@@ -329,7 +329,7 @@ class LinphoneCoreImpl implements LinphoneCore {
return
getPlaybackGain
(
nativePtr
);
}
public
synchronized
void
muteMic
(
boolean
isMuted
)
{
muteMic
(
nativePtr
,
isMuted
);
muteMic
(
nativePtr
,
isMuted
);
}
public
synchronized
LinphoneAddress
interpretUrl
(
String
destination
)
throws
LinphoneCoreException
{
...
...
@@ -350,7 +350,7 @@ class LinphoneCoreImpl implements LinphoneCore {
}
public
synchronized
void
sendDtmf
(
char
number
)
{
sendDtmf
(
nativePtr
,
number
);
sendDtmf
(
nativePtr
,
number
);
}
public
synchronized
void
clearCallLogs
()
{
clearCallLogs
(
nativePtr
);
...
...
@@ -458,7 +458,7 @@ class LinphoneCoreImpl implements LinphoneCore {
}
public
synchronized
void
setFriendList
(
LinphoneFriendList
friendList
)
throws
LinphoneCoreException
{
setFriendList
(
nativePtr
,((
LinphoneFriendListImpl
)
friendList
).
nativePtr
);
setFriendList
(
nativePtr
,
((
LinphoneFriendListImpl
)
friendList
).
nativePtr
);
}
public
synchronized
LinphoneFriend
[]
getFriendList
()
{
...
...
@@ -467,7 +467,7 @@ class LinphoneCoreImpl implements LinphoneCore {
@SuppressWarnings
(
"deprecation"
)
public
synchronized
void
setPresenceInfo
(
int
minutes_away
,
String
alternative_contact
,
OnlineStatus
status
)
{
setPresenceInfo
(
nativePtr
,
minutes_away
,
alternative_contact
,
status
.
mValue
);
setPresenceInfo
(
nativePtr
,
minutes_away
,
alternative_contact
,
status
.
mValue
);
}
@SuppressWarnings
(
"deprecation"
)
...
...
@@ -475,7 +475,7 @@ class LinphoneCoreImpl implements LinphoneCore {
return
OnlineStatus
.
fromInt
(
getPresenceInfo
(
nativePtr
));
}
public
synchronized
void
setPresenceModel
(
PresenceModel
presence
)
{
setPresenceModel
(
nativePtr
,
((
PresenceModelImpl
)
presence
).
getNativePtr
());
setPresenceModel
(
nativePtr
,
((
PresenceModelImpl
)
presence
).
getNativePtr
());
}
public
synchronized
PresenceModel
getPresenceModel
()
{
return
(
PresenceModel
)
getPresenceModel
(
nativePtr
);
...
...
@@ -487,7 +487,7 @@ class LinphoneCoreImpl implements LinphoneCore {
return
new
LinphoneChatRoomImpl
(
getChatRoom
(
nativePtr
,
((
LinphoneAddressImpl
)
to
).
nativePtr
));
}
public
synchronized
void
setPreviewWindow
(
Object
w
)
{
setPreviewWindowId
(
nativePtr
,
w
);
setPreviewWindowId
(
nativePtr
,
w
);
}
public
synchronized
void
setVideoWindow
(
Object
w
)
{
setVideoWindowId
(
nativePtr
,
w
);
...
...
@@ -631,7 +631,7 @@ class LinphoneCoreImpl implements LinphoneCore {
}
public
synchronized
void
enableKeepAlive
(
boolean
enable
)
{
enableKeepAlive
(
nativePtr
,
enable
);
enableKeepAlive
(
nativePtr
,
enable
);
}
public
synchronized
boolean
isKeepAliveEnabled
()
{
...
...
@@ -1181,22 +1181,22 @@ class LinphoneCoreImpl implements LinphoneCore {
@Override
public
synchronized
LinphoneEvent
publish
(
LinphoneAddress
resource
,
String
eventname
,
int
expires
,
LinphoneContent
content
)
{
return
(
LinphoneEvent
)
publish
(
nativePtr
,
((
LinphoneAddressImpl
)
resource
).
nativePtr
,
eventname
,
expires
,
content
!=
null
?
content
.
getType
()
:
null
,
content
!=
null
?
content
.
getSubtype
()
:
null
,
content
!=
null
?
content
.
getData
()
:
null
,
content
!=
null
?
content
.
getEncoding
()
:
null
);
return
(
LinphoneEvent
)
publish
(
nativePtr
,
((
LinphoneAddressImpl
)
resource
).
nativePtr
,
eventname
,
expires
,
content
!=
null
?
content
.
getType
()
:
null
,
content
!=
null
?
content
.
getSubtype
()
:
null
,
content
!=
null
?
content
.
getData
()
:
null
,
content
!=
null
?
content
.
getEncoding
()
:
null
);
}
private
native
Object
createSubscribe
(
long
core
,
long
addr
,
String
event
,
int
expires
);
@Override
public
synchronized
LinphoneEvent
createSubscribe
(
LinphoneAddress
resource
,
String
event
,
int
expires
)
{
return
(
LinphoneEvent
)
createSubscribe
(
nativePtr
,
((
LinphoneAddressImpl
)
resource
).
nativePtr
,
event
,
expires
);
return
(
LinphoneEvent
)
createSubscribe
(
nativePtr
,
((
LinphoneAddressImpl
)
resource
).
nativePtr
,
event
,
expires
);
}
private
native
Object
createPublish
(
long
core
,
long
addr
,
String
event
,
int
expires
);
@Override
public
synchronized
LinphoneEvent
createPublish
(
LinphoneAddress
resource
,
String
event
,
int
expires
)
{
return
(
LinphoneEvent
)
createPublish
(
nativePtr
,
((
LinphoneAddressImpl
)
resource
).
nativePtr
,
event
,
expires
);
return
(
LinphoneEvent
)
createPublish
(
nativePtr
,
((
LinphoneAddressImpl
)
resource
).
nativePtr
,
event
,
expires
);
}
public
synchronized
void
setChatDatabasePath
(
String
path
)
{
...
...
@@ -1319,7 +1319,7 @@ class LinphoneCoreImpl implements LinphoneCore {
private
native
void
disableChat
(
long
ptr
,
int
denycode
);
@Override
public
synchronized
void
disableChat
(
Reason
denycode
)
{
disableChat
(
nativePtr
,
denycode
.
mValue
);
disableChat
(
nativePtr
,
denycode
.
mValue
);
}
private
native
void
enableChat
(
long
ptr
);
@Override
...
...
@@ -1339,7 +1339,7 @@ class LinphoneCoreImpl implements LinphoneCore {
private
native
void
setPayloadTypeBitrate
(
long
coreptr
,
long
payload_ptr
,
int
bitrate
);
@Override
public
synchronized
void
setPayloadTypeBitrate
(
PayloadType
pt
,
int
bitrate
)
{
setPayloadTypeBitrate
(
nativePtr
,
((
PayloadTypeImpl
)
pt
).
nativePtr
,
bitrate
);
setPayloadTypeBitrate
(
nativePtr
,
((
PayloadTypeImpl
)
pt
).
nativePtr
,
bitrate
);
}
private
native
int
getPayloadTypeBitrate
(
long
coreptr
,
long
payload_ptr
);
@Override
...
...
@@ -1378,12 +1378,12 @@ class LinphoneCoreImpl implements LinphoneCore {
private
native
void
setAudioJittcomp
(
long
ptr
,
int
value
);
@Override
public
synchronized
void
setAudioJittcomp
(
int
value
)
{
setAudioJittcomp
(
nativePtr
,
value
);
setAudioJittcomp
(
nativePtr
,
value
);
}
private
native
void
setVideoJittcomp
(
long
ptr
,
int
value
);
@Override
public
synchronized
void
setVideoJittcomp
(
int
value
)
{
setVideoJittcomp
(
nativePtr
,
value
);
setVideoJittcomp
(
nativePtr
,
value
);
}
private
native
void
setFileTransferServer
(
long
ptr
,
String
serverUrl
);
...
...
@@ -1423,7 +1423,7 @@ class LinphoneCoreImpl implements LinphoneCore {
private
native
void
setRemoteRingbackTone
(
long
nativePtr
,
String
file
);
@Override
public
void
setRemoteRingbackTone
(
String
file
)
{
setRemoteRingbackTone
(
nativePtr
,
file
);
setRemoteRingbackTone
(
nativePtr
,
file
);
}
private
native
String
getRemoteRingbackTone
(
long
nativePtr
);
@Override
...
...
@@ -1609,4 +1609,16 @@ class LinphoneCoreImpl implements LinphoneCore {
public
int
getNortpTimeout
(){
return
getNortpTimeout
(
nativePtr
);
}
private
native
void
setSipNetworkReachable
(
long
nativePtr
,
boolean
isReachable
);
@Override
public
void
setSipNetworkReachable
(
boolean
isReachable
)
{
setSipNetworkReachable
(
nativePtr
,
isReachable
);
}
private
native
void
setMediaNetworkReachable
(
long
nativePtr
,
boolean
isReachable
);
@Override
public
void
setMediaNetworkReachable
(
boolean
isReachable
)
{
setMediaNetworkReachable
(
nativePtr
,
isReachable
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment