forked from mirrors/linphone-iphone
Add JNI callback for messageReceivedUnableToDecrypted
This commit is contained in:
parent
c61c5e1339
commit
3342ccf4ab
7 changed files with 205 additions and 136 deletions
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
TutorialBuddyStatus
|
||||
Copyright (C) 2010 Belledonne Communications SARL
|
||||
Copyright (C) 2010 Belledonne Communications SARL
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
|
|
@ -48,7 +48,7 @@ import org.linphone.core.PublishState;
|
|||
import org.linphone.core.SubscriptionState;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* This program is a _very_ simple usage example of liblinphone,
|
||||
* demonstrating how to initiate SIP subscriptions and receive notifications
|
||||
* from a sip uri identity passed from the command line.
|
||||
|
|
@ -123,9 +123,9 @@ public class TutorialBuddyStatus implements LinphoneCoreListener {
|
|||
// Create tutorial object
|
||||
TutorialBuddyStatus tutorial = new TutorialBuddyStatus();
|
||||
try {
|
||||
// takes sip uri identity from the command line arguments
|
||||
// takes sip uri identity from the command line arguments
|
||||
String userSipAddress = args[1];
|
||||
|
||||
|
||||
// takes sip uri identity from the command line arguments
|
||||
String mySipAddress = args.length>1?args[1]:null;
|
||||
// takes password from the command line arguments
|
||||
|
|
@ -183,10 +183,10 @@ public class TutorialBuddyStatus implements LinphoneCoreListener {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// configure this friend to emit SUBSCRIBE message after being added to LinphoneCore
|
||||
lf.enableSubscribes(true);
|
||||
|
||||
|
||||
// accept incoming subscription request for this friend
|
||||
lf.setIncSubscribePolicy(SubscribePolicy.SPAccept);
|
||||
try {
|
||||
|
|
@ -196,11 +196,11 @@ public class TutorialBuddyStatus implements LinphoneCoreListener {
|
|||
write("Error while adding friend " + lf.getAddress().getUserName() + " to linphone");
|
||||
return;
|
||||
}
|
||||
|
||||
// set my status to online
|
||||
|
||||
// set my status to online
|
||||
lc.setPresenceInfo(0, null, OnlineStatus.Online);
|
||||
|
||||
|
||||
|
||||
|
||||
// main loop for receiving notifications and doing background linphonecore work
|
||||
running = true;
|
||||
while (running) {
|
||||
|
|
@ -219,8 +219,8 @@ public class TutorialBuddyStatus implements LinphoneCoreListener {
|
|||
// just to make sure new status is initiate message is issued
|
||||
lc.iterate();
|
||||
|
||||
|
||||
lf.edit(); // start editing friend
|
||||
|
||||
lf.edit(); // start editing friend
|
||||
lf.enableSubscribes(false); // disable subscription for this friend
|
||||
lf.done(); // commit changes triggering an UNSUBSCRIBE message
|
||||
lc.iterate(); // just to make sure unsubscribe message is issued
|
||||
|
|
@ -247,65 +247,70 @@ public class TutorialBuddyStatus implements LinphoneCoreListener {
|
|||
@Override
|
||||
public void messageReceived(LinphoneCore lc, LinphoneChatRoom cr, LinphoneChatMessage message) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void messageReceivedUnableToDecrypted(LinphoneCore lc, LinphoneChatRoom cr, LinphoneChatMessage message) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void transferState(LinphoneCore lc, LinphoneCall call,
|
||||
State new_call_state) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void infoReceived(LinphoneCore lc, LinphoneCall call, LinphoneInfoMessage info) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void subscriptionStateChanged(LinphoneCore lc, LinphoneEvent ev,
|
||||
SubscriptionState state) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void notifyReceived(LinphoneCore lc, LinphoneEvent ev,
|
||||
String eventName, LinphoneContent content) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void publishStateChanged(LinphoneCore lc, LinphoneEvent ev,
|
||||
PublishState state) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void isComposingReceived(LinphoneCore lc, LinphoneChatRoom cr) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configuringStatus(LinphoneCore lc,
|
||||
RemoteProvisioningState state, String message) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void authInfoRequested(LinphoneCore lc, String realm,
|
||||
String username, String domain) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void authenticationRequested(LinphoneCore lc,
|
||||
public void authenticationRequested(LinphoneCore lc,
|
||||
LinphoneAuthInfo authInfo, LinphoneCore.AuthMethod method) {
|
||||
// TODO Auto-generated method stub
|
||||
}
|
||||
|
|
@ -314,14 +319,14 @@ public class TutorialBuddyStatus implements LinphoneCoreListener {
|
|||
public void fileTransferProgressIndication(LinphoneCore lc,
|
||||
LinphoneChatMessage message, LinphoneContent content, int progress) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fileTransferRecv(LinphoneCore lc, LinphoneChatMessage message,
|
||||
LinphoneContent content, byte[] buffer, int size) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -334,16 +339,16 @@ public class TutorialBuddyStatus implements LinphoneCoreListener {
|
|||
@Override
|
||||
public void uploadProgressIndication(LinphoneCore lc, int offset, int total) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void uploadStateChanged(LinphoneCore lc,
|
||||
LogCollectionUploadState state, String info) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void friendListCreated(LinphoneCore lc, LinphoneFriendList list) {
|
||||
// TODO Auto-generated method stub
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
TutorialChatRoom.java
|
||||
Copyright (C) 2010 Belledonne Communications SARL
|
||||
Copyright (C) 2010 Belledonne Communications SARL
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
|
|
@ -55,7 +55,7 @@ import org.linphone.core.SubscriptionState;
|
|||
*
|
||||
* ex chatroom sip:jehan@sip.linphone.org
|
||||
* just takes a sip-uri as first argument and attempts to call it.
|
||||
*
|
||||
*
|
||||
* Ported from chatroom.c
|
||||
*
|
||||
* @author Guillaume Beraudo
|
||||
|
|
@ -74,8 +74,8 @@ public class TutorialChatRoom implements LinphoneCoreListener, LinphoneChatMessa
|
|||
this.TutorialNotifier = new TutorialNotifier();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public void show(LinphoneCore lc) {}
|
||||
public void byeReceived(LinphoneCore lc, String from) {}
|
||||
public void authInfoRequested(LinphoneCore lc, String realm, String username, String domain) {}
|
||||
|
|
@ -94,15 +94,15 @@ public class TutorialChatRoom implements LinphoneCoreListener, LinphoneChatMessa
|
|||
public void notifyReceived(LinphoneCore lc, LinphoneCall call, LinphoneAddress from, byte[] event){}
|
||||
public void dtmfReceived(LinphoneCore lc, LinphoneCall call, int dtmf) {}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
// Check tutorial was called with the right number of arguments
|
||||
// Takes the sip uri identity from the command line arguments
|
||||
if (args.length != 1) {
|
||||
throw new IllegalArgumentException("Bad number of arguments");
|
||||
}
|
||||
|
||||
|
||||
// Create tutorial object
|
||||
TutorialChatRoom tutorial = new TutorialChatRoom();
|
||||
try {
|
||||
|
|
@ -113,10 +113,10 @@ public class TutorialChatRoom implements LinphoneCoreListener, LinphoneChatMessa
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public void launchTutorial(String destinationSipAddress) throws LinphoneCoreException {
|
||||
|
||||
|
||||
// First instantiate the core Linphone object given only a listener.
|
||||
// The listener will react to events in Linphone core.
|
||||
LinphoneCore lc = LinphoneCoreFactory.instance().createLinphoneCore(this, null);
|
||||
|
|
@ -124,11 +124,11 @@ public class TutorialChatRoom implements LinphoneCoreListener, LinphoneChatMessa
|
|||
try {
|
||||
// Next step is to create a chat room
|
||||
LinphoneChatRoom chatRoom = lc.getOrCreateChatRoom(destinationSipAddress);
|
||||
|
||||
|
||||
// Send message
|
||||
LinphoneChatMessage chatMessage = chatRoom.createLinphoneChatMessage("Hello world");
|
||||
chatRoom.sendMessage(chatMessage, this);
|
||||
|
||||
|
||||
// main loop for receiving notifications and doing background linphonecore work
|
||||
running = true;
|
||||
while (running) {
|
||||
|
|
@ -154,7 +154,7 @@ public class TutorialChatRoom implements LinphoneCoreListener, LinphoneChatMessa
|
|||
running=false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void write(String s) {
|
||||
TutorialNotifier.notify(s);
|
||||
}
|
||||
|
|
@ -165,6 +165,11 @@ public class TutorialChatRoom implements LinphoneCoreListener, LinphoneChatMessa
|
|||
write("Message [" + message.getText() + "] received from [" + message.getFrom().asString() + "]");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void messageReceivedUnableToDecrypted(LinphoneCore lc, LinphoneChatRoom cr, LinphoneChatMessage message) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLinphoneChatMessageStateChanged(LinphoneChatMessage msg,
|
||||
org.linphone.core.LinphoneChatMessage.State state) {
|
||||
|
|
@ -175,34 +180,34 @@ public class TutorialChatRoom implements LinphoneCoreListener, LinphoneChatMessa
|
|||
public void transferState(LinphoneCore lc, LinphoneCall call,
|
||||
State new_call_state) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void infoReceived(LinphoneCore lc, LinphoneCall call, LinphoneInfoMessage info) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void subscriptionStateChanged(LinphoneCore lc, LinphoneEvent ev,
|
||||
SubscriptionState state) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void notifyReceived(LinphoneCore lc, LinphoneEvent ev,
|
||||
String eventName, LinphoneContent content) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void publishStateChanged(LinphoneCore lc, LinphoneEvent ev,
|
||||
PublishState state) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -217,21 +222,21 @@ public class TutorialChatRoom implements LinphoneCoreListener, LinphoneChatMessa
|
|||
public void configuringStatus(LinphoneCore lc,
|
||||
RemoteProvisioningState state, String message) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fileTransferProgressIndication(LinphoneCore lc,
|
||||
LinphoneChatMessage message, LinphoneContent content, int progress) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fileTransferRecv(LinphoneCore lc, LinphoneChatMessage message,
|
||||
LinphoneContent content, byte[] buffer, int size) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -244,17 +249,17 @@ public class TutorialChatRoom implements LinphoneCoreListener, LinphoneChatMessa
|
|||
@Override
|
||||
public void uploadProgressIndication(LinphoneCore lc, int offset, int total) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void uploadStateChanged(LinphoneCore lc,
|
||||
LogCollectionUploadState state, String info) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void friendListCreated(LinphoneCore lc, LinphoneFriendList list) {
|
||||
// TODO Auto-generated method stub
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
TutorialHelloWorld.java
|
||||
Copyright (C) 2010 Belledonne Communications SARL
|
||||
Copyright (C) 2010 Belledonne Communications SARL
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
|
|
@ -49,7 +49,7 @@ import org.linphone.core.SubscriptionState;
|
|||
/**
|
||||
* This program is a _very_ simple usage example of liblinphone.
|
||||
* It just takes a sip-uri as first argument and attempts to call it.
|
||||
*
|
||||
*
|
||||
* Ported from helloworld.c
|
||||
*
|
||||
* @author Guillaume Beraudo
|
||||
|
|
@ -68,8 +68,8 @@ public class TutorialHelloWorld implements LinphoneCoreListener {
|
|||
this.TutorialNotifier = new TutorialNotifier();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public void show(LinphoneCore lc) {}
|
||||
public void byeReceived(LinphoneCore lc, String from) {}
|
||||
public void authInfoRequested(LinphoneCore lc, String realm, String username, String domain) {}
|
||||
|
|
@ -103,7 +103,7 @@ public class TutorialHelloWorld implements LinphoneCoreListener {
|
|||
if (args.length != 1) {
|
||||
throw new IllegalArgumentException("Bad number of arguments");
|
||||
}
|
||||
|
||||
|
||||
// Create tutorial object
|
||||
TutorialHelloWorld helloWorld = new TutorialHelloWorld();
|
||||
try {
|
||||
|
|
@ -114,16 +114,16 @@ public class TutorialHelloWorld implements LinphoneCoreListener {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public void launchTutorial(String destinationSipAddress) throws LinphoneCoreException {
|
||||
|
||||
|
||||
// First instantiate the core Linphone object given only a listener.
|
||||
// The listener will react to events in Linphone core.
|
||||
LinphoneCore lc = LinphoneCoreFactory.instance().createLinphoneCore(this, null);
|
||||
|
||||
|
||||
|
||||
|
||||
try {
|
||||
// Send the INVITE message to destination SIP address
|
||||
LinphoneCall call = lc.invite(destinationSipAddress);
|
||||
|
|
@ -135,7 +135,7 @@ public class TutorialHelloWorld implements LinphoneCoreListener {
|
|||
write("Call to " + destinationSipAddress + " is in progress...");
|
||||
|
||||
|
||||
|
||||
|
||||
// main loop for receiving notifications and doing background linphonecore work
|
||||
running = true;
|
||||
while (running) {
|
||||
|
|
@ -149,7 +149,7 @@ public class TutorialHelloWorld implements LinphoneCoreListener {
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if (!State.CallEnd.equals(call.getState())) {
|
||||
write("Terminating the call");
|
||||
lc.terminateCall(call);
|
||||
|
|
@ -167,7 +167,7 @@ public class TutorialHelloWorld implements LinphoneCoreListener {
|
|||
running=false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void write(String s) {
|
||||
TutorialNotifier.notify(s);
|
||||
}
|
||||
|
|
@ -176,68 +176,73 @@ public class TutorialHelloWorld implements LinphoneCoreListener {
|
|||
public void messageReceived(LinphoneCore lc, LinphoneChatRoom cr,
|
||||
LinphoneChatMessage message) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void messageReceivedUnableToDecrypted(LinphoneCore lc, LinphoneChatRoom cr, LinphoneChatMessage message) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void transferState(LinphoneCore lc, LinphoneCall call,
|
||||
State new_call_state) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void infoReceived(LinphoneCore lc, LinphoneCall call, LinphoneInfoMessage info) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void subscriptionStateChanged(LinphoneCore lc, LinphoneEvent ev,
|
||||
SubscriptionState state) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void notifyReceived(LinphoneCore lc, LinphoneEvent ev,
|
||||
String eventName, LinphoneContent content) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void publishStateChanged(LinphoneCore lc, LinphoneEvent ev,
|
||||
PublishState state) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void isComposingReceived(LinphoneCore lc, LinphoneChatRoom cr) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configuringStatus(LinphoneCore lc,
|
||||
RemoteProvisioningState state, String message) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fileTransferProgressIndication(LinphoneCore lc,
|
||||
LinphoneChatMessage message, LinphoneContent content, int progress) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fileTransferRecv(LinphoneCore lc, LinphoneChatMessage message,
|
||||
LinphoneContent content, byte[] buffer, int size) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -250,17 +255,17 @@ public class TutorialHelloWorld implements LinphoneCoreListener {
|
|||
@Override
|
||||
public void uploadProgressIndication(LinphoneCore lc, int offset, int total) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void uploadStateChanged(LinphoneCore lc,
|
||||
LogCollectionUploadState state, String info) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void friendListCreated(LinphoneCore lc, LinphoneFriendList list) {
|
||||
// TODO Auto-generated method stub
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
TutorialRegistration.java
|
||||
Copyright (C) 2010 Belledonne Communications SARL
|
||||
Copyright (C) 2010 Belledonne Communications SARL
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
|
|
@ -73,7 +73,7 @@ public class TutorialRegistration implements LinphoneCoreListener {
|
|||
this.TutorialNotifier = new TutorialNotifier();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Registration state notification listener
|
||||
*/
|
||||
|
|
@ -103,7 +103,7 @@ public class TutorialRegistration implements LinphoneCoreListener {
|
|||
if (args.length != 2) {
|
||||
throw new IllegalArgumentException("Bad number of arguments");
|
||||
}
|
||||
|
||||
|
||||
// Create tutorial object
|
||||
TutorialRegistration tutorial = new TutorialRegistration();
|
||||
try {
|
||||
|
|
@ -117,8 +117,8 @@ public class TutorialRegistration implements LinphoneCoreListener {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public void launchTutorial(String sipAddress, String password) throws LinphoneCoreException {
|
||||
final LinphoneCoreFactory lcFactory = LinphoneCoreFactory.instance();
|
||||
|
||||
|
|
@ -126,9 +126,9 @@ public class TutorialRegistration implements LinphoneCoreListener {
|
|||
// The listener will react to events in Linphone core.
|
||||
LinphoneCore lc = lcFactory.createLinphoneCore(this, null);
|
||||
|
||||
|
||||
|
||||
try {
|
||||
|
||||
|
||||
// Parse identity
|
||||
LinphoneAddress address = lcFactory.createLinphoneAddress(sipAddress);
|
||||
String username = address.getUserName();
|
||||
|
|
@ -147,11 +147,11 @@ public class TutorialRegistration implements LinphoneCoreListener {
|
|||
lc.setDefaultProxyConfig(proxyCfg);
|
||||
|
||||
|
||||
|
||||
|
||||
// main loop for receiving notifications and doing background linphonecore work
|
||||
running = true;
|
||||
while (running) {
|
||||
lc.iterate(); // first iterate initiates registration
|
||||
lc.iterate(); // first iterate initiates registration
|
||||
sleep(50);
|
||||
}
|
||||
|
||||
|
|
@ -197,7 +197,7 @@ public class TutorialRegistration implements LinphoneCoreListener {
|
|||
running=false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void write(String s) {
|
||||
TutorialNotifier.notify(s);
|
||||
}
|
||||
|
|
@ -206,68 +206,73 @@ public class TutorialRegistration implements LinphoneCoreListener {
|
|||
public void messageReceived(LinphoneCore lc, LinphoneChatRoom cr,
|
||||
LinphoneChatMessage message) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void messageReceivedUnableToDecrypted(LinphoneCore lc, LinphoneChatRoom cr, LinphoneChatMessage message) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void transferState(LinphoneCore lc, LinphoneCall call,
|
||||
State new_call_state) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void infoReceived(LinphoneCore lc, LinphoneCall call, LinphoneInfoMessage info) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void subscriptionStateChanged(LinphoneCore lc, LinphoneEvent ev,
|
||||
SubscriptionState state) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void notifyReceived(LinphoneCore lc, LinphoneEvent ev,
|
||||
String eventName, LinphoneContent content) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void publishStateChanged(LinphoneCore lc, LinphoneEvent ev,
|
||||
PublishState state) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void isComposingReceived(LinphoneCore lc, LinphoneChatRoom cr) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configuringStatus(LinphoneCore lc,
|
||||
RemoteProvisioningState state, String message) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fileTransferProgressIndication(LinphoneCore lc,
|
||||
LinphoneChatMessage message, LinphoneContent content, int progress) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fileTransferRecv(LinphoneCore lc, LinphoneChatMessage message,
|
||||
LinphoneContent content, byte[] buffer, int size) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -280,17 +285,17 @@ public class TutorialRegistration implements LinphoneCoreListener {
|
|||
@Override
|
||||
public void uploadProgressIndication(LinphoneCore lc, int offset, int total) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void uploadStateChanged(LinphoneCore lc,
|
||||
LogCollectionUploadState state, String info) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void friendListCreated(LinphoneCore lc, LinphoneFriendList list) {
|
||||
// TODO Auto-generated method stub
|
||||
|
|
|
|||
|
|
@ -297,6 +297,8 @@ public:
|
|||
|
||||
messageReceivedId = env->GetMethodID(listenerClass,"messageReceived","(Lorg/linphone/core/LinphoneCore;Lorg/linphone/core/LinphoneChatRoom;Lorg/linphone/core/LinphoneChatMessage;)V");
|
||||
|
||||
messageReceivedUnableToDecryptedId = env->GetMethodID(listenerClass,"messageReceivedUnableToDecrypted","(Lorg/linphone/core/LinphoneCore;Lorg/linphone/core/LinphoneChatRoom;Lorg/linphone/core/LinphoneChatMessage;)V");
|
||||
|
||||
isComposingReceivedId = env->GetMethodID(listenerClass,"isComposingReceived","(Lorg/linphone/core/LinphoneCore;Lorg/linphone/core/LinphoneChatRoom;)V");
|
||||
|
||||
dtmfReceivedId = env->GetMethodID(listenerClass,"dtmfReceived","(Lorg/linphone/core/LinphoneCore;Lorg/linphone/core/LinphoneCall;I)V");
|
||||
|
|
@ -431,6 +433,7 @@ public:
|
|||
jmethodID newSubscriptionRequestId;
|
||||
jmethodID notifyPresenceReceivedId;
|
||||
jmethodID messageReceivedId;
|
||||
jmethodID messageReceivedUnableToDecryptedId;
|
||||
jmethodID isComposingReceivedId;
|
||||
jmethodID dtmfReceivedId;
|
||||
jmethodID callStatsUpdatedId;
|
||||
|
|
@ -844,6 +847,10 @@ public:
|
|||
vTable->message_received = message_received;
|
||||
}
|
||||
|
||||
if (ljb->messageReceivedUnableToDecryptedId) {
|
||||
vTable->message_received_unable_decrypt = message_received_unable_decrypt;
|
||||
}
|
||||
|
||||
if (ljb->isComposingReceivedId) {
|
||||
vTable->is_composing_received = is_composing_received;
|
||||
}
|
||||
|
|
@ -1178,6 +1185,36 @@ public:
|
|||
env->DeleteLocalRef(jroom);
|
||||
}
|
||||
}
|
||||
|
||||
static void message_received_unable_decrypt(LinphoneCore *lc, LinphoneChatRoom *room, LinphoneChatMessage *msg) {
|
||||
JNIEnv *env = 0;
|
||||
jint result = jvm->AttachCurrentThread(&env,NULL);
|
||||
if (result != 0) {
|
||||
ms_error("cannot attach VM");
|
||||
return;
|
||||
}
|
||||
|
||||
jobject jmsg;
|
||||
jobject jroom;
|
||||
LinphoneJavaBindings *ljb = (LinphoneJavaBindings *)linphone_core_get_user_data(lc);
|
||||
LinphoneCoreVTable *table = linphone_core_get_current_vtable(lc);
|
||||
LinphoneCoreData* lcData = (LinphoneCoreData*)linphone_core_v_table_get_user_data(table);
|
||||
/*note: we call linphone_chat_message_ref() because the application does not acquire the object when invoked from a callback*/
|
||||
env->CallVoidMethod(lcData->listener
|
||||
,ljb->messageReceivedUnableToDecryptedId
|
||||
,lcData->core
|
||||
,(jroom = getChatRoom(env, room))
|
||||
,(jmsg = getChatMessage(env, msg)));
|
||||
handle_possible_java_exception(env, lcData->listener);
|
||||
|
||||
if (jmsg) {
|
||||
env->DeleteLocalRef(jmsg);
|
||||
}
|
||||
if (jroom) {
|
||||
env->DeleteLocalRef(jroom);
|
||||
}
|
||||
}
|
||||
|
||||
static void is_composing_received(LinphoneCore *lc, LinphoneChatRoom *room) {
|
||||
JNIEnv *env = 0;
|
||||
jint result = jvm->AttachCurrentThread(&env,NULL);
|
||||
|
|
|
|||
|
|
@ -22,25 +22,25 @@ import java.nio.ByteBuffer;
|
|||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*This interface holds all callbacks that the application should implement. None is mandatory.
|
||||
*/
|
||||
public interface LinphoneCoreListener {
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* Ask the application some authentication information
|
||||
* Ask the application some authentication information
|
||||
**/
|
||||
@Deprecated
|
||||
void authInfoRequested(LinphoneCore lc, String realm, String username, String domain);
|
||||
|
||||
|
||||
/**
|
||||
* Ask the application some authentication information
|
||||
* @param lc the LinphoneCore
|
||||
* @param authInfo a LinphoneAuthInfo pre-filled with username, realm and domain values as much as possible
|
||||
* @param method the type of authentication requested (HttpDigest, Tls, ...)
|
||||
**/
|
||||
void authenticationRequested(LinphoneCore lc, LinphoneAuthInfo authInfo, LinphoneCore.AuthMethod method);
|
||||
void authenticationRequested(LinphoneCore lc, LinphoneAuthInfo authInfo, LinphoneCore.AuthMethod method);
|
||||
|
||||
/**
|
||||
* Call stats notification
|
||||
|
|
@ -48,12 +48,12 @@ public interface LinphoneCoreListener {
|
|||
void callStatsUpdated(LinphoneCore lc, LinphoneCall call, LinphoneCallStats stats);
|
||||
|
||||
/**
|
||||
* Reports that a new subscription request has been received and wait for a decision.
|
||||
* Reports that a new subscription request has been received and wait for a decision.
|
||||
*Status on this subscription request is notified by changing policy for this friend
|
||||
*@param lc LinphoneCore
|
||||
*@param lc LinphoneCore
|
||||
*@param lf LinphoneFriend corresponding to the subscriber
|
||||
*@param url of the subscriber
|
||||
*
|
||||
*
|
||||
*/
|
||||
void newSubscriptionRequest(LinphoneCore lc, LinphoneFriend lf, String url);
|
||||
|
||||
|
|
@ -78,15 +78,15 @@ public interface LinphoneCoreListener {
|
|||
* @param call LinphoneCall in case the notify is part of a dialog, may be null
|
||||
* @param from LinphoneAddress the message comes from
|
||||
* @param event String the raw body of the notify event.
|
||||
*
|
||||
*
|
||||
*/
|
||||
void notifyReceived(LinphoneCore lc, LinphoneCall call, LinphoneAddress from, byte[] event);
|
||||
|
||||
/**
|
||||
* Notifies progress of a call transfer.
|
||||
/**
|
||||
* Notifies progress of a call transfer.
|
||||
* @param lc the LinphoneCore
|
||||
* @param call the call through which the transfer was sent.
|
||||
* @param new_call_state the state of the call resulting of the transfer, at the other party.
|
||||
* @param new_call_state the state of the call resulting of the transfer, at the other party.
|
||||
**/
|
||||
void transferState(LinphoneCore lc, LinphoneCall call, LinphoneCall.State new_call_state);
|
||||
|
||||
|
|
@ -128,14 +128,14 @@ public interface LinphoneCoreListener {
|
|||
void displayStatus(LinphoneCore lc,String message);
|
||||
|
||||
/**
|
||||
* Callback to display a message to the user
|
||||
* Callback to display a message to the user
|
||||
* @deprecated
|
||||
*/
|
||||
@Deprecated
|
||||
void displayMessage(LinphoneCore lc,String message);
|
||||
|
||||
/**
|
||||
* Callback to display a warning to the user
|
||||
* Callback to display a warning to the user
|
||||
* @deprecated
|
||||
*/
|
||||
@Deprecated
|
||||
|
|
@ -172,9 +172,9 @@ public interface LinphoneCoreListener {
|
|||
int fileTransferSend(LinphoneCore lc, LinphoneChatMessage message, LinphoneContent content, ByteBuffer buffer, int size);
|
||||
|
||||
/**
|
||||
* General State notification
|
||||
* General State notification
|
||||
* @param state LinphoneCore.State
|
||||
*/
|
||||
*/
|
||||
void globalState(LinphoneCore lc,LinphoneCore.GlobalState state, String message);
|
||||
|
||||
/**
|
||||
|
|
@ -198,10 +198,17 @@ public interface LinphoneCoreListener {
|
|||
*/
|
||||
void messageReceived(LinphoneCore lc, LinphoneChatRoom cr, LinphoneChatMessage message);
|
||||
|
||||
/**
|
||||
* invoked when a new linphone chat message is received and we cannot decrypt this
|
||||
* @param lc LinphoneCore
|
||||
* @param cr LinphoneChatRoom involved in this conversation. Can be be created by the framework in case the from is not present in any chat room.
|
||||
* @param message incoming linphone chat message message
|
||||
*/
|
||||
void messageReceivedUnableToDecrypted(LinphoneCore lc, LinphoneChatRoom cr, LinphoneChatMessage message);
|
||||
|
||||
/** Call State notification
|
||||
/** Call State notification
|
||||
* @param state LinphoneCall.State
|
||||
*/
|
||||
*/
|
||||
void callState(LinphoneCore lc, LinphoneCall call, LinphoneCall.State state, String message);
|
||||
|
||||
/**
|
||||
|
|
@ -214,7 +221,7 @@ public interface LinphoneCoreListener {
|
|||
/**
|
||||
* Notifies of an incoming NOTIFY received.
|
||||
* @param lc the linphoneCore
|
||||
* @param ev a LinphoneEvent representing the subscription context for which this notify belongs, or null if it is a NOTIFY out of of any subscription.
|
||||
* @param ev a LinphoneEvent representing the subscription context for which this notify belongs, or null if it is a NOTIFY out of of any subscription.
|
||||
* @param eventName the event name
|
||||
* @param content content of the NOTIFY request.
|
||||
*/
|
||||
|
|
@ -230,7 +237,7 @@ public interface LinphoneCoreListener {
|
|||
/**
|
||||
* Invoked when echo cancalation calibration is completed
|
||||
* @param lc LinphoneCore
|
||||
* @param status
|
||||
* @param status
|
||||
* @param delay_ms echo delay
|
||||
* @param data
|
||||
*/
|
||||
|
|
@ -248,14 +255,14 @@ public interface LinphoneCoreListener {
|
|||
* @param info Additional information: error message in case of error state, URL of uploaded file in case of success.
|
||||
*/
|
||||
void uploadStateChanged(LinphoneCore lc, LinphoneCore.LogCollectionUploadState state, String info);
|
||||
|
||||
|
||||
/**
|
||||
* Callback prototype for reporting LinphoneFriendList creation.
|
||||
* @param lc LinphoneCore object
|
||||
* @param list LinphoneFriendList object
|
||||
*/
|
||||
void friendListCreated(LinphoneCore lc, LinphoneFriendList list);
|
||||
|
||||
|
||||
/**
|
||||
* Callback prototype for reporting LinphoneFriendList removal.
|
||||
* @param lc LinphoneCore object
|
||||
|
|
|
|||
|
|
@ -17,9 +17,9 @@ public class LinphoneCoreListenerBase implements LinphoneCoreListener {
|
|||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void authenticationRequested(LinphoneCore lc,
|
||||
public void authenticationRequested(LinphoneCore lc,
|
||||
LinphoneAuthInfo authInfo, LinphoneCore.AuthMethod method) {
|
||||
// TODO Auto-generated method stub
|
||||
}
|
||||
|
|
@ -133,86 +133,91 @@ public class LinphoneCoreListenerBase implements LinphoneCoreListener {
|
|||
@Override
|
||||
public void globalState(LinphoneCore lc, GlobalState state, String message) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registrationState(LinphoneCore lc, LinphoneProxyConfig cfg,
|
||||
RegistrationState state, String smessage) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configuringStatus(LinphoneCore lc,
|
||||
RemoteProvisioningState state, String message) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void messageReceived(LinphoneCore lc, LinphoneChatRoom cr,
|
||||
LinphoneChatMessage message) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void messageReceivedUnableToDecrypted(LinphoneCore lc, LinphoneChatRoom cr,
|
||||
LinphoneChatMessage message) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void callState(LinphoneCore lc, LinphoneCall call, State state,
|
||||
String message) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void callEncryptionChanged(LinphoneCore lc, LinphoneCall call,
|
||||
boolean encrypted, String authenticationToken) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void notifyReceived(LinphoneCore lc, LinphoneEvent ev,
|
||||
String eventName, LinphoneContent content) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void isComposingReceived(LinphoneCore lc, LinphoneChatRoom cr) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void ecCalibrationStatus(LinphoneCore lc, EcCalibratorStatus status,
|
||||
int delay_ms, Object data) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void uploadProgressIndication(LinphoneCore lc, int offset, int total) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void uploadStateChanged(LinphoneCore lc,
|
||||
LogCollectionUploadState state, String info) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void friendListCreated(LinphoneCore lc, LinphoneFriendList list) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void friendListRemoved(LinphoneCore lc, LinphoneFriendList list) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue