Commit 8c3fd2d4 authored by Simon Morlat's avatar Simon Morlat
Browse files

adapt java to modifications of info api

parent fbf909e3
......@@ -45,6 +45,7 @@ LOCAL_SRC_FILES := \
bellesip_sal/sal_op_registration.c \
bellesip_sal/sal_op_publish.c \
bellesip_sal/sal_op_info.c \
bellesip_sal/sal_op_events.c \
bellesip_sal/sal_sdp.c \
sal.c \
offeranswer.c \
......@@ -54,7 +55,8 @@ LOCAL_SRC_FILES := \
ec-calibrator.c \
linphone_tunnel_config.c \
message_storage.c \
info.c
info.c \
event.c
ifndef LINPHONE_VERSION
LINPHONE_VERSION = "Devel"
......
......@@ -250,7 +250,7 @@ public class TutorialBuddyStatus implements LinphoneCoreListener {
}
@Override
public void infoReceived(LinphoneCore lc, LinphoneInfoMessage info) {
public void infoReceived(LinphoneCore lc, LinphoneCall call, LinphoneInfoMessage info) {
// TODO Auto-generated method stub
}
......
......@@ -172,7 +172,7 @@ public class TutorialChatRoom implements LinphoneCoreListener, LinphoneChatMessa
}
@Override
public void infoReceived(LinphoneCore lc, LinphoneInfoMessage info) {
public void infoReceived(LinphoneCore lc, LinphoneCall call, LinphoneInfoMessage info) {
// TODO Auto-generated method stub
}
......
......@@ -176,7 +176,7 @@ public class TutorialHelloWorld implements LinphoneCoreListener {
}
@Override
public void infoReceived(LinphoneCore lc, LinphoneInfoMessage info) {
public void infoReceived(LinphoneCore lc, LinphoneCall call, LinphoneInfoMessage info) {
// TODO Auto-generated method stub
}
......
......@@ -207,7 +207,7 @@ public class TutorialRegistration implements LinphoneCoreListener {
}
@Override
public void infoReceived(LinphoneCore lc, LinphoneInfoMessage info) {
public void infoReceived(LinphoneCore lc, LinphoneCall call, LinphoneInfoMessage info) {
// TODO Auto-generated method stub
}
......
......@@ -197,7 +197,8 @@ public:
textReceivedId = env->GetMethodID(listenerClass,"textReceived","(Lorg/linphone/core/LinphoneCore;Lorg/linphone/core/LinphoneChatRoom;Lorg/linphone/core/LinphoneAddress;Ljava/lang/String;)V");
messageReceivedId = env->GetMethodID(listenerClass,"messageReceived","(Lorg/linphone/core/LinphoneCore;Lorg/linphone/core/LinphoneChatRoom;Lorg/linphone/core/LinphoneChatMessage;)V");
dtmfReceivedId = env->GetMethodID(listenerClass,"dtmfReceived","(Lorg/linphone/core/LinphoneCore;Lorg/linphone/core/LinphoneCall;I)V");
infoReceivedId = env->GetMethodID(listenerClass,"infoReceived","(Lorg/linphone/core/LinphoneCore;Lorg/linphone/core/LinphoneInfoMessage;)V");
infoReceivedId = env->GetMethodID(listenerClass,"infoReceived",
"(Lorg/linphone/core/LinphoneCore;Lorg/linphone/core/LinphoneCall;Lorg/linphone/core/LinphoneInfoMessage;)V");
proxyClass = (jclass)env->NewGlobalRef(env->FindClass("org/linphone/core/LinphoneProxyConfigImpl"));
proxyCtrId = env->GetMethodID(proxyClass,"<init>", "(J)V");
......@@ -536,7 +537,7 @@ public:
,env->CallStaticObjectMethod(lcData->callStateClass,lcData->callStateFromIntId,(jint)remote_call_state)
);
}
static void infoReceived(LinphoneCore *lc, const LinphoneInfoMessage *info){
static void infoReceived(LinphoneCore *lc, LinphoneCall*call, const LinphoneInfoMessage *info){
JNIEnv *env = 0;
jint result = jvm->AttachCurrentThread(&env,NULL);
jobject jcall;
......@@ -549,6 +550,7 @@ public:
env->CallVoidMethod(lcData->listener
,lcData->infoReceivedId
,lcData->core
,lcData->getCall(env,call)
,env->NewObject(lcData->infoMessageClass,lcData->infoMessageCtor,(jlong)copy_info)
);
}
......@@ -606,8 +608,8 @@ JNIEXPORT jlong JNICALL Java_org_linphone_core_LinphoneCoreImpl_createInfoMessag
return (jlong) linphone_core_create_info_message((LinphoneCore*)lcptr);
}
JNIEXPORT jint JNICALL Java_org_linphone_core_LinphoneCoreImpl_sendInfoMessage(JNIEnv *env, jobject jobj, jlong lcptr, jlong infoptr, jlong addrptr){
return linphone_core_send_info_message((LinphoneCore*)lcptr,(LinphoneInfoMessage*)infoptr,(LinphoneAddress*)addrptr);
JNIEXPORT jint JNICALL Java_org_linphone_core_LinphoneCallImpl_sendInfoMessage(JNIEnv *env, jobject jobj, jlong callptr, jlong infoptr){
return linphone_call_send_info_message((LinphoneCall*)callptr,(LinphoneInfoMessage*)infoptr);
}
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setPrimaryContact(JNIEnv* env, jobject thiz, jlong lc, jstring jdisplayname, jstring jusername) {
......@@ -2696,16 +2698,6 @@ JNIEXPORT jstring JNICALL Java_org_linphone_core_LinphoneInfoMessageImpl_getHead
return ret ? env->NewStringUTF(ret) : NULL;
}
/*
* Class: org_linphone_core_LinphoneInfoMessageImpl
* Method: getFrom
* Signature: (J)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_org_linphone_core_LinphoneInfoMessageImpl_getFrom(JNIEnv *env , jobject jobj, jlong infoptr){
const char *from=linphone_info_message_get_from((LinphoneInfoMessage*)infoptr);
return from ? env->NewStringUTF(from) : NULL;
}
/*
* Class: org_linphone_core_LinphoneInfoMessageImpl
* Method: delete
......
......@@ -298,4 +298,9 @@ public interface LinphoneCall {
* @return the call state of the new call performed by the referee to the refer target.
*/
State getTransferState();
/**
* Send an info message to remote peer.
*/
void sendInfoMessage(LinphoneInfoMessage msg);
}
......@@ -1262,16 +1262,10 @@ public interface LinphoneCore {
/**
* Create an empty INFO message.
* It can later be sent using {@link LinphoneCore.sendInfoMessage() }.
* It can later be sent using {@link LinphoneCall.sendInfoMessage() }.
* @return the new info message.
*/
public LinphoneInfoMessage createInfoMessage();
/**
* Send an INFO message to specified destination.
* @param info the info message
* @param dest the destination sip address.
*/
public void sendInfoMessage(LinphoneInfoMessage info, LinphoneAddress dest);
}
......@@ -130,7 +130,7 @@ public interface LinphoneCoreListener {
* @param lc the LinphoneCore.
* @param info the info message
*/
void infoReceived(LinphoneCore lc, LinphoneInfoMessage info);
void infoReceived(LinphoneCore lc, LinphoneCall call, LinphoneInfoMessage info);
/**< @Deprecated Notifies the application that it should show up
* @return */
......
......@@ -2,6 +2,7 @@ package org.linphone.core;
/**
* The LinphoneInfoMessage represents an informational message (INFO) to be transmitted or received by the LinphoneCore.
* It can be created with {@link LinphoneCore.createInfoMessage() }.
* @author smorlat
*
*/
......@@ -28,9 +29,4 @@ public interface LinphoneInfoMessage {
* @return the header's value
*/
String getHeader(String name);
/**
* Get the origin of the info message as a string URI.
* @return origin of the message.
*/
String getFrom();
}
......@@ -212,4 +212,9 @@ class LinphoneCallImpl implements LinphoneCall {
public State getTransferState() {
return State.fromInt(getTransferState(nativePtr));
}
private native int sendInfoMessage(long callPtr, long msgptr);
@Override
public void sendInfoMessage(LinphoneInfoMessage msg) {
sendInfoMessage(nativePtr,((LinphoneInfoMessageImpl)msg).nativePtr);
}
}
......@@ -954,9 +954,4 @@ class LinphoneCoreImpl implements LinphoneCore {
public LinphoneInfoMessage createInfoMessage() {
return new LinphoneInfoMessageImpl(createInfoMessage(nativePtr));
}
private native int sendInfoMessage(long corePtr, long infoptr, long destptr);
@Override
public void sendInfoMessage(LinphoneInfoMessage info, LinphoneAddress dest) {
sendInfoMessage(nativePtr,((LinphoneInfoMessageImpl)info).nativePtr, ((LinphoneAddressImpl)dest).nativePtr);
}
}
......@@ -33,12 +33,6 @@ public class LinphoneInfoMessageImpl implements LinphoneInfoMessage {
public String getHeader(String name) {
return getHeader(nativePtr,name);
}
private native String getFrom(long nativePtr);
@Override
public String getFrom() {
return getFrom(nativePtr);
}
private native void delete(long nativePtr);
protected void finalize(){
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment