From 2e331a0ca00ecd11d602630aa7e163545be64ec4 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Sat, 1 Aug 2015 19:26:49 +0200 Subject: [PATCH] add rtt java API. No jni yet --- java/common/org/linphone/core/LinphoneCall.java | 7 +++++++ .../org/linphone/core/LinphoneCallParams.java | 14 ++++++++++++++ .../org/linphone/core/LinphoneChatMessage.java | 8 ++++++++ .../org/linphone/core/LinphoneChatRoom.java | 15 +++++++++++++++ java/impl/org/linphone/core/LinphoneCallImpl.java | 4 ++++ .../org/linphone/core/LinphoneCallParamsImpl.java | 10 ++++++++++ .../linphone/core/LinphoneChatMessageImpl.java | 4 ++++ .../org/linphone/core/LinphoneChatRoomImpl.java | 8 ++++++++ 8 files changed, 70 insertions(+) diff --git a/java/common/org/linphone/core/LinphoneCall.java b/java/common/org/linphone/core/LinphoneCall.java index cd74b6d07..1d65abaff 100644 --- a/java/common/org/linphone/core/LinphoneCall.java +++ b/java/common/org/linphone/core/LinphoneCall.java @@ -359,5 +359,12 @@ public interface LinphoneCall { * @return A player */ public LinphonePlayer getPlayer(); + + /** + * Create a new chat room for messaging from a call if not already existing, else return existing one + * @return LinphoneChatRoom where messaging can take place. + */ + public LinphoneChatRoom getChatRoom() ; + } diff --git a/java/common/org/linphone/core/LinphoneCallParams.java b/java/common/org/linphone/core/LinphoneCallParams.java index fa827faa2..f0be37ac4 100644 --- a/java/common/org/linphone/core/LinphoneCallParams.java +++ b/java/common/org/linphone/core/LinphoneCallParams.java @@ -158,4 +158,18 @@ public interface LinphoneCallParams { **/ boolean videoMulticastEnabled(); + /** + * Use to enable real time text following rfc4103. + * If enabled, outgoing calls put a m=text line in SDP offer . + * @param yesno if yes, subsequent outgoing calls will propose rtt + * + **/ + void enableRealTimeText(boolean yesno); + /** + * Use to get real time text following rfc4103. + * @returns returns true if call rtt is activated. + **/ + boolean realTimeTextEnabled(); + + } diff --git a/java/common/org/linphone/core/LinphoneChatMessage.java b/java/common/org/linphone/core/LinphoneChatMessage.java index b80c3a070..c022be40c 100644 --- a/java/common/org/linphone/core/LinphoneChatMessage.java +++ b/java/common/org/linphone/core/LinphoneChatMessage.java @@ -227,4 +227,12 @@ public interface LinphoneChatMessage { * Set the callbacks associated with the LinphoneChatMessage. */ void setListener(LinphoneChatMessage.LinphoneChatMessageListener listener); + /** + * Fulfill a chat message char by char. Message linked to a Real Time Text Call send char in realtime following RFC 4103/T.140 + * To commit a message, use #linphone_chat_room_send_message + * @param[in] character T.140 char + * @throw LinphoneCoreExeption . + */ + void putChar(long charater) throws LinphoneCoreException; + } diff --git a/java/common/org/linphone/core/LinphoneChatRoom.java b/java/common/org/linphone/core/LinphoneChatRoom.java index f281b4bb6..9592e7269 100644 --- a/java/common/org/linphone/core/LinphoneChatRoom.java +++ b/java/common/org/linphone/core/LinphoneChatRoom.java @@ -144,4 +144,19 @@ public interface LinphoneChatRoom { * @param message */ void sendChatMessage(LinphoneChatMessage message); + + /** + * get Curent Call associated to this chatroom if any + * To commit a message, use #linphone_chat_room_send_message + * @returns LinphoneCall or NULL. + */ + public LinphoneCall getCall(); + /** + * When realtime text is enabled LinphoneCallParams.realTimeTextEnabled, LinphoneCoreListener.isComposingReceived is call every time a char is received from peer. + * At the end of remote typing a regular LinphoneChatMessage is received with committed data from LinphoneCoreListener.messageReceived . + * @returns RFC 4103/T.140 char + */ + long getChar(); + + } diff --git a/java/impl/org/linphone/core/LinphoneCallImpl.java b/java/impl/org/linphone/core/LinphoneCallImpl.java index de9e25364..af0875596 100644 --- a/java/impl/org/linphone/core/LinphoneCallImpl.java +++ b/java/impl/org/linphone/core/LinphoneCallImpl.java @@ -254,5 +254,9 @@ class LinphoneCallImpl implements LinphoneCall { public LinphonePlayer getPlayer() { return new LinphonePlayerImpl(getPlayer(nativePtr)); } + @Override + public LinphoneChatRoom getChatRoom() { + throw new RuntimeException("java binding not implemented yet"); + } } diff --git a/java/impl/org/linphone/core/LinphoneCallParamsImpl.java b/java/impl/org/linphone/core/LinphoneCallParamsImpl.java index c4b356fa7..0bdbc56c6 100644 --- a/java/impl/org/linphone/core/LinphoneCallParamsImpl.java +++ b/java/impl/org/linphone/core/LinphoneCallParamsImpl.java @@ -171,4 +171,14 @@ public class LinphoneCallParamsImpl implements LinphoneCallParams { public boolean videoMulticastEnabled() { return videoMulticastEnabled(nativePtr); } + + @Override + public void enableRealTimeText(boolean yesno) { + throw new RuntimeException("java binding not implemented yet"); + } + + @Override + public boolean realTimeTextEnabled() { + throw new RuntimeException("java binding not implemented yet"); + } } diff --git a/java/impl/org/linphone/core/LinphoneChatMessageImpl.java b/java/impl/org/linphone/core/LinphoneChatMessageImpl.java index 8665e4049..a55a8bd40 100644 --- a/java/impl/org/linphone/core/LinphoneChatMessageImpl.java +++ b/java/impl/org/linphone/core/LinphoneChatMessageImpl.java @@ -154,4 +154,8 @@ public class LinphoneChatMessageImpl implements LinphoneChatMessage { public void setListener(LinphoneChatMessageListener listener) { setListener(nativePtr, listener); } + @Override + public void putChar(long charater) throws LinphoneCoreException { + throw new RuntimeException("java binding not implemented yet"); + } } diff --git a/java/impl/org/linphone/core/LinphoneChatRoomImpl.java b/java/impl/org/linphone/core/LinphoneChatRoomImpl.java index 7cf1fdbf7..067c3eca3 100644 --- a/java/impl/org/linphone/core/LinphoneChatRoomImpl.java +++ b/java/impl/org/linphone/core/LinphoneChatRoomImpl.java @@ -174,4 +174,12 @@ class LinphoneChatRoomImpl implements LinphoneChatRoom { public void sendChatMessage(LinphoneChatMessage message) { sendChatMessage(nativePtr, message, ((LinphoneChatMessageImpl)message).getNativePtr()); } + @Override + public LinphoneCall getCall() { + throw new RuntimeException("java binding not implemented yet"); + } + @Override + public long getChar() { + throw new RuntimeException("java binding not implemented yet"); + } }