├── .classpath ├── .gitignore ├── .project ├── .settings ├── org.eclipse.core.resources.prefs ├── org.eclipse.jdt.core.prefs └── org.maven.ide.eclipse.prefs ├── README.md ├── pom.xml ├── src-native ├── src_linux │ ├── Makefile │ ├── Makefile.common │ ├── commons │ │ ├── Logging.c │ │ └── Logging.h │ ├── dbus │ │ ├── Makefile │ │ ├── README │ │ ├── SkypeFramework.c │ │ ├── SkypeService.c │ │ ├── skype-service-object-glue.h │ │ ├── skype-service-object.xml │ │ ├── skype-service.h │ │ └── typical-output.txt │ └── x11 │ │ ├── Makefile │ │ ├── README │ │ ├── SkypeFramework.c │ │ └── skypetest.cpp ├── src_osx │ ├── Makefile │ ├── Skype.framework │ │ ├── Headers │ │ │ ├── Skype.h │ │ │ ├── SkypeAPI-Carbon.h │ │ │ └── SkypeAPI.h │ │ ├── Resources │ │ │ └── Info.plist │ │ ├── Skype │ │ └── Versions │ │ │ ├── A │ │ │ ├── Headers │ │ │ │ ├── Skype.h │ │ │ │ ├── SkypeAPI-Carbon.h │ │ │ │ └── SkypeAPI.h │ │ │ ├── Resources │ │ │ │ └── Info.plist │ │ │ └── Skype │ │ │ └── Current │ │ │ ├── Headers │ │ │ ├── Skype.h │ │ │ ├── SkypeAPI-Carbon.h │ │ │ └── SkypeAPI.h │ │ │ ├── Resources │ │ │ └── Info.plist │ │ │ └── Skype │ ├── SkypeFramework.m │ ├── build.xml │ └── com_skype_connector_osx_SkypeFramework.h └── src_win32 │ ├── Makefile │ ├── Makefile.linux │ ├── NMakefile │ ├── Win32Connector.cpp │ ├── com_skype_connector_win32_Win32Connector.h │ ├── skype.sln │ └── skype.vcproj └── src ├── main ├── java │ └── com │ │ └── skype │ │ ├── AbstractVoiceMailListener.java │ │ ├── Application.java │ │ ├── ApplicationAdapter.java │ │ ├── ApplicationListener.java │ │ ├── Call.java │ │ ├── CallAdapter.java │ │ ├── CallConnectorListener.java │ │ ├── CallListener.java │ │ ├── CallMonitorListener.java │ │ ├── CallStatusChangedListener.java │ │ ├── Chat.java │ │ ├── ChatListener.java │ │ ├── ChatListenerMananager.java │ │ ├── ChatMessage.java │ │ ├── ChatMessageAdapter.java │ │ ├── ChatMessageConnectorListener.java │ │ ├── ChatMessageEditConnectorListener.java │ │ ├── ChatMessageEditListener.java │ │ ├── ChatMessageListener.java │ │ ├── CommandFailedException.java │ │ ├── ConnectorListenerImpl.java │ │ ├── ContactList.java │ │ ├── CountryIsoByCountryName.java │ │ ├── EventMessage.java │ │ ├── EventMessageListener.java │ │ ├── FileTransfer.java │ │ ├── FileTransferConnectorListener.java │ │ ├── FileTransferListener.java │ │ ├── Friend.java │ │ ├── GlobalChatListener.java │ │ ├── GlobalChatMessageListener.java │ │ ├── Group.java │ │ ├── MenuItem.java │ │ ├── MenuItemClickEvent.java │ │ ├── MenuItemListener.java │ │ ├── NotAttachedException.java │ │ ├── Profile.java │ │ ├── SMS.java │ │ ├── Skype.java │ │ ├── SkypeClient.java │ │ ├── SkypeException.java │ │ ├── SkypeExceptionHandler.java │ │ ├── SkypeObject.java │ │ ├── Stream.java │ │ ├── StreamAdapter.java │ │ ├── StreamListener.java │ │ ├── TimeOutException.java │ │ ├── User.java │ │ ├── UserConnectorListener.java │ │ ├── UserListener.java │ │ ├── Utils.java │ │ ├── VoiceMail.java │ │ ├── VoiceMailConnectorListener.java │ │ ├── VoiceMailListener.java │ │ ├── VoiceMailStatusChangedListener.java │ │ ├── connector │ │ ├── AbstractConnectorListener.java │ │ ├── Connector.java │ │ ├── ConnectorEvent.java │ │ ├── ConnectorException.java │ │ ├── ConnectorListener.java │ │ ├── ConnectorMessageEvent.java │ │ ├── ConnectorStatusEvent.java │ │ ├── ConnectorUtils.java │ │ ├── LoadLibraryException.java │ │ ├── MessageProcessor.java │ │ ├── NotAttachedException.java │ │ ├── NotificationChecker.java │ │ ├── TimeOutException.java │ │ ├── UnsupportedArchitectureException.java │ │ ├── linux │ │ │ ├── LinuxConnector.java │ │ │ ├── SkypeFramework.java │ │ │ ├── SkypeFrameworkListener.java │ │ │ └── package-info.java │ │ ├── osx │ │ │ ├── AbstractSkypeFrameworkListener.java │ │ │ ├── OSXConnector.java │ │ │ ├── SkypeFramework.java │ │ │ ├── SkypeFrameworkListener.java │ │ │ └── package-info.java │ │ ├── package-info.java │ │ └── win32 │ │ │ ├── Win32Connector.java │ │ │ └── package-info.java │ │ └── package-info.java └── resources │ ├── Skype.Framework │ ├── libskype.jnilib │ ├── libskype_dbus_x64.so │ ├── libskype_dbus_x86.so │ ├── libskype_x11_x64.so │ ├── libskype_x11_x86.so │ ├── skype_amd64.dll │ └── skype_x86.dll └── test ├── java └── com │ └── skype │ ├── .cvsignore │ ├── Ap2ApAPIStressTest.java │ ├── Ap2ApAPIStressTestServer.java │ ├── Ap2ApAPITest.java │ ├── Ap2ApAPITestServer.java │ ├── AutoAp2ApAPITest.java │ ├── AutoCallAPITest.java │ ├── AutoChatAPITest.java │ ├── AutoDebugOutTest.java │ ├── AutoMainWindowStateTest.java │ ├── AutoSkypeAPITest.java │ ├── AutoSkypeClientAPITest.java │ ├── AutoVoiceMailAPITest.java │ ├── CallAPITest.java │ ├── CallForwardingTest.java │ ├── CallListenerTest.java │ ├── CallStatusChangedListenerTest.java │ ├── ChatAPITest.java │ ├── ChatMessageEditConnectorListenerTest.java │ ├── ChatMessageListenerTest.java │ ├── CountryIsoByCountryNameTest.java │ ├── DialogAPITest.java │ ├── FriendTest.java │ ├── GroupAPITest.java │ ├── HistoryAPITest.java │ ├── PhoneAPITest.java │ ├── ProfileTest.java │ ├── SMSTest.java │ ├── SkypeExceptionHandlerTest.java │ ├── SkypeObjectTest.java │ ├── SkypeTest.java │ ├── SystemTest.java │ ├── TestCaseProperties.java │ ├── TestData.java │ ├── TestUtils.java │ ├── VideoAPITest.java │ ├── VoiceMailAPITest.java │ ├── connector │ ├── AutoPropertyTest.java │ ├── ConnectorTest.java │ ├── ConnectorUtilsTest.java │ ├── osx │ │ ├── OSXConnectorTest.java │ │ └── SkypeFrameworkTest.java │ └── test │ │ ├── AutoConnectorTest.java │ │ ├── CSVPlayer.java │ │ ├── CSVRecorder.java │ │ ├── Player.java │ │ ├── PlayerMessage.java │ │ ├── Recorder.java │ │ ├── TestCaseByCSVFile.java │ │ ├── TestConnector.java │ │ └── package-info.java │ └── mocks │ └── ConnectorMock.java └── resources └── com └── skype ├── AutoAp2ApAPITest_testDoubleConnecting.csv ├── AutoAp2ApAPITest_testRecreatingApplication.csv ├── AutoCallAPITest_testConferenceId.csv ├── AutoCallAPITest_testSendDTMF.csv ├── AutoChatAPITest_testGetAllActiveChat.csv ├── AutoChatAPITest_testGetAllBookmarkedChat.csv ├── AutoChatAPITest_testGetAllChat.csv ├── AutoChatAPITest_testGetAllMissedChat.csv ├── AutoChatAPITest_testGetAllRecentChat.csv ├── AutoDebugOutTest_testBasic.csv ├── AutoMainWindowStateTest_testBasic.csv ├── AutoSkypeAPITest_testSetSilentMode.csv ├── AutoSkypeClientAPITest_test.csv ├── AutoSkypeClientAPITest_testSetSilentMode.csv ├── AutoVoiceMailAPITest_testGetAllVoiceMails.csv ├── AutoVoiceMailAPITest_testVoiceMail.csv ├── AutoVoiceMailAPITest_testVoiceMailStatusChangedListener.csv ├── FriendTest_testFriendProperties.csv ├── FriendTest_testGetAllFriends.csv ├── ProfileTest_testBasic.csv ├── TestData.properties ├── TestData.properties.base └── connector └── test ├── AutoConnectorTest_testCall.csv └── AutoConnectorTest_testGetVersion.csv /.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | target/* 3 | .*.swp 4 | build 5 | *.o 6 | com_skype_connector_linux_SkypeFramework.h 7 | skypetest 8 | *.dll 9 | .classpath 10 | .settings/* 11 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | skype-api 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.maven.ide.eclipse.maven2Builder 15 | 16 | 17 | 18 | 19 | org.eclipse.m2e.core.maven2Builder 20 | 21 | 22 | 23 | 24 | 25 | org.eclipse.m2e.core.maven2Nature 26 | org.eclipse.jdt.core.javanature 27 | org.maven.ide.eclipse.maven2Nature 28 | 29 | 30 | -------------------------------------------------------------------------------- /.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | #Mon Dec 12 22:32:47 BRST 2011 2 | eclipse.preferences.version=1 3 | encoding//src/main/java=UTF-8 4 | encoding//src/main/resources=UTF-8 5 | encoding//src/test/java=UTF-8 6 | encoding//src/test/resources=UTF-8 7 | encoding/=UTF-8 8 | -------------------------------------------------------------------------------- /.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | #Wed Feb 23 23:13:28 BRT 2011 2 | eclipse.preferences.version=1 3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 4 | org.eclipse.jdt.core.compiler.compliance=1.6 5 | org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning 6 | org.eclipse.jdt.core.compiler.source=1.6 7 | -------------------------------------------------------------------------------- /.settings/org.maven.ide.eclipse.prefs: -------------------------------------------------------------------------------- 1 | #Wed Feb 23 21:53:36 BRT 2011 2 | activeProfiles= 3 | eclipse.preferences.version=1 4 | fullBuildGoals=process-test-resources 5 | resolveWorkspaceProjects=true 6 | resourceFilterGoals=process-resources resources\:testResources 7 | skipCompilerPlugin=true 8 | version=1 9 | -------------------------------------------------------------------------------- /src-native/src_linux/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | make -C x11 3 | make -C dbus 4 | 5 | clean: 6 | make -C x11 clean 7 | make -C dbus clean 8 | 9 | -------------------------------------------------------------------------------- /src-native/src_linux/Makefile.common: -------------------------------------------------------------------------------- 1 | JDK_DIR = /usr/lib/jvm/java-6-openjdk-amd64/ 2 | CC = gcc 3 | CFLAGS = -Wall -pipe -g -fPIC -I../commons 4 | INCPATH = -I. -I$(JDK_DIR)/include -I$(JDK_DIR)/include/linux 5 | LOGGING=../commons/Logging.c 6 | LINK = g++ 7 | LD_FLAGS = -shared 8 | PROJECT_ROOT=../../.. 9 | TARGET_CLASSES=$(PROJECT_ROOT)/target/classes 10 | TARGET=$(PROJECT_ROOT)/src/main/resources/ 11 | OBJECTS = $(SOURCES:.c=.o) 12 | OBJECTS_X64 = $(SOURCES:.c=_x64.o) 13 | 14 | PWD=$(shell pwd) 15 | IMPLEMENTATION=$(shell basename $(PWD)) 16 | X86=libskype_$(IMPLEMENTATION)_x86.so 17 | X64=libskype_$(IMPLEMENTATION)_x64.so 18 | 19 | startfrom: all 20 | 21 | com_skype_connector_linux_SkypeFramework.h: 22 | javah -classpath $(TARGET_CLASSES) com.skype.connector.linux.SkypeFramework 23 | 24 | SkypeFramework: com_skype_connector_linux_SkypeFramework.h SkypeFramework.c 25 | $(CC) -c $(CFLAGS) $(INCPATH) -m32 -o $@.o $@.c 26 | $(CC) -c $(CFLAGS) $(INCPATH) -m64 -o $@_x64.o $@.c 27 | 28 | Logging: com_skype_connector_linux_SkypeFramework.h $(LOGGING) 29 | $(CC) -c $(CFLAGS) $(INCPATH) -m32 -o $@.o $(LOGGING) 30 | $(CC) -c $(CFLAGS) $(INCPATH) -m64 -o $@_x64.o $(LOGGING) 31 | 32 | 33 | clean: 34 | rm -f com_skype_connector_linux_SkypeFramework.h *.o *.so skypetest 35 | -------------------------------------------------------------------------------- /src-native/src_linux/commons/Logging.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2011 Gabriel Takeuchi 3 | * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 4 | * Copyright (c) 2006-2007 UBION Inc. 5 | * 6 | * Copyright (c) 2006-2007 Skype Technologies S.A. 7 | * 8 | * Skype4Java is licensed under either the Apache License, Version 2.0 or 9 | * the Eclipse Public License v1.0. 10 | * You may use it freely in commercial and non-commercial products. 11 | * You may obtain a copy of the licenses at 12 | * 13 | * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 14 | * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 15 | * 16 | * If it is possible to cooperate with the publicity of Skype4Java, please add 17 | * links to the Skype4Java web site 18 | * in your web site or documents. 19 | * 20 | * Contributors: 21 | * Gabriel Takeuchi - log4j support for native library 22 | ******************************************************************************/ 23 | #ifndef __SKYPE_FRAMEWORK_LOGGER__ 24 | #define __SKYPE_FRAMEWORK_LOGGER__ 25 | 26 | #define LOG_ERR 0 27 | #define LOG_INFO 1 28 | #define LOG_DEBUG 2 29 | 30 | #define LOGGER_CATEGORY "skype-framework-native" 31 | 32 | typedef struct { 33 | JNIEnv *env; 34 | jclass log4JClass; 35 | jobject logger; 36 | jmethodID log4JMethods[3]; 37 | 38 | } LoggerContext; 39 | 40 | LoggerContext * getLoggerContext(JNIEnv *env); 41 | 42 | 43 | void openLogWithStdout(); 44 | void openLogFile(const char* logfilename); 45 | void logToFile(int level, const char* fmt, ...); 46 | 47 | void logInfo(JNIEnv * env, const char * message); 48 | void logError(JNIEnv * env, const char * message); 49 | void logDebug(JNIEnv * env, const char* fmt, ...); 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /src-native/src_linux/dbus/Makefile: -------------------------------------------------------------------------------- 1 | #******************************************************************************* 2 | # * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 3 | # * Copyright (c) 2006-2007 UBION Inc. 4 | # * 5 | # * Copyright (c) 2006-2007 Skype Technologies S.A. 6 | # * 7 | # * Skype4Java is licensed under either the Apache License, Version 2.0 or 8 | # * the Eclipse Public License v1.0. 9 | # * You may use it freely in commercial and non-commercial products. 10 | # * You may obtain a copy of the licenses at 11 | # * 12 | # * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 13 | # * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 14 | # * 15 | # * If it is possible to cooperate with the publicity of Skype4Java, please add 16 | # * links to the Skype4Java web site 17 | # * in your web site or documents. 18 | # * 19 | # * Contributors: 20 | # * Koji Hisano - initial API and implementation 21 | # * Gabriel Takeuchi - added support for 64 bit arch 22 | # ******************************************************************************/ 23 | 24 | include ../Makefile.common 25 | 26 | CFLAGS := $(CFLAGS) $(shell pkg-config --cflags dbus-1 dbus-glib-1 ) 27 | SOURCES = SkypeFramework.c SkypeService.c Logging.c 28 | 29 | .SECONDEXPANSION: 30 | 31 | LIBS = $(shell pkg-config --libs dbus-1 dbus-glib-1) 32 | LIBS_32= -L/usr/lib32/i386-linux-gnu $(shell pkg-config --libs dbus-1 dbus-glib-1) 33 | 34 | all: $(X64) $(X86) 35 | 36 | $(X86): SkypeFramework Logging SkypeService 37 | $(LINK) $(LD_FLAGS) -m32 -o $(TARGET)/$(X86) $(OBJECTS) $(LIBS_32) 38 | 39 | $(X64): SkypeFramework Logging SkypeService 40 | $(LINK) $(LD_FLAGS) -m64 -o $(TARGET)/$(X64) $(OBJECTS_X64) $(LIBS) 41 | 42 | SkypeService: skype-service.h skype-service-object-glue.h SkypeService.c 43 | $(CC) -c $(CFLAGS) $(INCPATH) -m32 -o $@.o $@.c 44 | $(CC) -c $(CFLAGS) $(INCPATH) -m64 -o $@_x64.o $@.c 45 | 46 | 47 | -------------------------------------------------------------------------------- /src-native/src_linux/dbus/README: -------------------------------------------------------------------------------- 1 | You must have the following packages installed to compile this: 2 | 3 | libdbus-glib-1-dev 4 | libdbus-1-dev 5 | libgobject-2.0.so 6 | libglib2.0-0 7 | libc6-dev-i386 8 | g++-multilib 9 | getlibs -l libdbus-glib-1.so 10 | getlibs -l libdbus-1.so 11 | getlibs -l libgobject-2.0.so 12 | getlibs -l libglib-2.0.so 13 | getlibs -l libdbus-glib-1.a 14 | getlibs -l libdbus-1.a 15 | getlibs -l libgobject-2.0.a 16 | getlibs -l libglib-2.0.a 17 | 18 | -------------------------------------------------------------------------------- /src-native/src_linux/dbus/SkypeService.c: -------------------------------------------------------------------------------- 1 | #include "skype-service.h" 2 | 3 | G_DEFINE_TYPE(SkypeService, skype_service, G_TYPE_OBJECT) 4 | 5 | static void skype_service_finalize (GObject *object) 6 | { 7 | G_OBJECT_CLASS (skype_service_parent_class)->finalize (object); 8 | } 9 | 10 | static void skype_service_class_init (SkypeServiceClass *klass) 11 | { 12 | GObjectClass *object_class; 13 | object_class = G_OBJECT_CLASS (klass); 14 | object_class->finalize = skype_service_finalize; 15 | } 16 | 17 | static void skype_service_init (SkypeService *object) 18 | { 19 | ; 20 | } 21 | 22 | SkypeService *skype_service_new (void) 23 | { 24 | return g_object_new(TYPE_SKYPE_SERVICE, NULL); 25 | } 26 | -------------------------------------------------------------------------------- /src-native/src_linux/dbus/skype-service-object.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src-native/src_linux/dbus/skype-service.h: -------------------------------------------------------------------------------- 1 | #ifndef _SKYPE_SERVICE_H_ 2 | #define _SKYPE_SERVICE_H_ 3 | 4 | // Ref:http://library.gnome.org/devel/gobject/unstable/chapter-gobject.html 5 | // http://live.gnome.org/DBusGlibBindings 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | // DBus path and interface 13 | #define SKYPE_SERVICE_PATH "/com/Skype/Client" 14 | #define SKYPE_SERVICE_INTERFACE "com.Skype.API.Client" 15 | 16 | // Service Object 17 | #define TYPE_SKYPE_SERVICE (skype_service_get_type ()) 18 | #define SKYPE_SERVICE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), TYPE_SKYPE_SERVICE, SkypeService)) 19 | #define SKYPE_SERVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SKYPE_SERVICE, SkypeServiceClass)) 20 | #define IS_SKYPE_SERVICE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), TYPE_SKYPE_SERVICE)) 21 | #define IS_SKYPE_SERVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SKYPE_SERVICE)) 22 | #define SKYPE_SERVICE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SKYPE_SERVICE, SkypeServiceClass)) 23 | 24 | G_BEGIN_DECLS 25 | 26 | typedef struct _SkypeService SkypeService; 27 | typedef struct _SkypeServiceClass SkypeServiceClass; 28 | 29 | struct _SkypeService { 30 | GObject parent; 31 | }; 32 | 33 | struct _SkypeServiceClass { 34 | GObjectClass parent; 35 | }; 36 | 37 | gboolean skype_service_notify_callback(SkypeService *object, gchar *message, GError **error); 38 | 39 | SkypeService *skype_service_new (void); 40 | GType skype_service_get_type (void); 41 | 42 | G_END_DECLS 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /src-native/src_linux/dbus/typical-output.txt: -------------------------------------------------------------------------------- 1 | Typical output of t1.c. 2 | 3 | First, start Skype. 4 | Then run 5 | $ ./t1 6 | Make or receive a call. 7 | 8 | Got= 9 | Got= 10 | Setup of notify methods done and OK. 11 | skype_service_notify_callback, message: 12 | skype_service_notify_callback, message: 13 | skype_service_notify_callback, message: 14 | skype_service_notify_callback, message: 15 | skype_service_notify_callback, message: 16 | skype_service_notify_callback, message: 17 | skype_service_notify_callback, message: 18 | skype_service_notify_callback, message: 19 | skype_service_notify_callback, message: 20 | skype_service_notify_callback, message: 21 | skype_service_notify_callback, message: 22 | skype_service_notify_callback, message: 23 | skype_service_notify_callback, message: 24 | skype_service_notify_callback, message: 25 | skype_service_notify_callback, message: 26 | skype_service_notify_callback, message: 27 | skype_service_notify_callback, message: 28 | skype_service_notify_callback, message: 29 | ... 30 | skype_service_notify_callback, message: 31 | skype_service_notify_callback, message: 33 | skype_service_notify_callback, message: 34 | 35 | -------------------------------------------------------------------------------- /src-native/src_linux/x11/Makefile: -------------------------------------------------------------------------------- 1 | #******************************************************************************* 2 | # * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 3 | # * Copyright (c) 2006-2007 UBION Inc. 4 | # * 5 | # * Copyright (c) 2006-2007 Skype Technologies S.A. 6 | # * 7 | # * Skype4Java is licensed under either the Apache License, Version 2.0 or 8 | # * the Eclipse Public License v1.0. 9 | # * You may use it freely in commercial and non-commercial products. 10 | # * You may obtain a copy of the licenses at 11 | # * 12 | # * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 13 | # * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 14 | # * 15 | # * If it is possible to cooperate with the publicity of Skype4Java, please add 16 | # * links to the Skype4Java web site 17 | # * in your web site or documents. 18 | # * 19 | # * Contributors: 20 | # * Koji Hisano - initial API and implementation 21 | # * Gabriel Takeuchi - added support for 64 bit arch 22 | # ******************************************************************************/ 23 | include ../Makefile.common 24 | 25 | SOURCES = SkypeFramework.c Logging.c 26 | 27 | .SECONDEXPANSION: 28 | 29 | LIBS = -lX11 30 | 31 | all: $(X86) $(X64) 32 | 33 | $(X86): SkypeFramework Logging 34 | $(LINK) $(LD_FLAGS) -m32 -o $(TARGET)/$(X86) $(OBJECTS) $(LIBS) 35 | $(X64): SkypeFramework Logging 36 | $(LINK) $(LD_FLAGS) -m64 -o $(TARGET)/$(X64) $(OBJECTS_X64) $(LIBS) 37 | 38 | skypetest: SkypeFramework.o skypetest.cpp 39 | $(LINK) -o skypetest $(OBJECTS_X64) skypetest.cpp -lX11 -lpthread 40 | 41 | 42 | -------------------------------------------------------------------------------- /src-native/src_linux/x11/README: -------------------------------------------------------------------------------- 1 | To make the libraries, you must have xorg-dev installed (which should install libX11) 2 | Also, in a 64bit system, you must have ia32-libs. 3 | -------------------------------------------------------------------------------- /src-native/src_linux/x11/skypetest.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | 11 | #define FALSE 0 12 | #define TRUE 1 13 | 14 | 15 | extern "C" { 16 | int aisRunning(); 17 | void * runLoop(void * arg); 18 | void setup(); 19 | }; 20 | 21 | void startEventLoopInSeparateThread(){ 22 | pthread_t thread; 23 | pthread_create(&thread, NULL,&runLoop, NULL ); 24 | sleep(1); 25 | } 26 | 27 | int main(){ 28 | setup(); 29 | startEventLoopInSeparateThread(); 30 | printf("%d\n", aisRunning()); 31 | // skype_connect(); 32 | } 33 | -------------------------------------------------------------------------------- /src-native/src_osx/Skype.framework/Headers/Skype.h: -------------------------------------------------------------------------------- 1 | // $Id: Skype.h,v 1.2 2005/06/15 11:13:05 teelem Exp $ 2 | /* 3 | * Skype.h 4 | * SkypeMac 5 | * 6 | * Created by Janno Teelem on 12/04/2005. 7 | * Copyright (c) 2005 Skype Technologies S.A. All rights reserved. 8 | * 9 | */ 10 | 11 | #include "SkypeAPI-Carbon.h" 12 | 13 | #ifdef __OBJC__ 14 | #include "SkypeAPI.h" 15 | #endif 16 | 17 | -------------------------------------------------------------------------------- /src-native/src_osx/Skype.framework/Headers/SkypeAPI-Carbon.h: -------------------------------------------------------------------------------- 1 | // $Id: SkypeAPI-Carbon.h,v 1.4 2005/11/28 19:00:28 teelem Exp $ 2 | /* 3 | * SkypeAPI-Carbon.h 4 | * SkypeMac 5 | * 6 | * Created by Janno Teelem on 14/06/2005. 7 | * Copyright 2005 Skype Technologies S.A.. All rights reserved. 8 | * 9 | */ 10 | 11 | #include 12 | #include 13 | 14 | __BEGIN_DECLS 15 | 16 | // In order to use Skype API, you must create a single instance of SkypeDelegate. 17 | // Set callback functions for the members of this struct and Skype will call these 18 | // functions to notify your application when something happens. 19 | struct SkypeDelegate 20 | { 21 | // Required member 22 | CFStringRef clientApplicationName; 23 | 24 | // Optional members, can be NULL 25 | void (*SkypeNotificationReceived)(CFStringRef aNotificationString); 26 | void (*SkypeAttachResponse)(unsigned int aAttachResponseCode); // 0 - failed, 1 - success 27 | void (*SkypeBecameAvailable)(CFPropertyListRef aNotification); 28 | void (*SkypeBecameUnavailable)(CFPropertyListRef aNotification); 29 | }; 30 | 31 | Boolean IsSkypeRunning(void); 32 | Boolean IsSkypeAvailable(void); 33 | 34 | // You must call this function, before calling ConnectToSkype() and SendSkypeCommand() 35 | void SetSkypeDelegate(struct SkypeDelegate* aDelegate); 36 | 37 | struct SkypeDelegate* GetSkypeDelegate(void); 38 | void RemoveSkypeDelegate(void); 39 | 40 | void ConnectToSkype(void); 41 | void DisconnectFromSkype(void); 42 | 43 | CFStringRef SendSkypeCommand(CFStringRef aCommandString); 44 | 45 | __END_DECLS -------------------------------------------------------------------------------- /src-native/src_osx/Skype.framework/Headers/SkypeAPI.h: -------------------------------------------------------------------------------- 1 | // $Id: SkypeAPI.h,v 1.5 2005/11/28 19:00:28 teelem Exp $ 2 | // 3 | // SkypeAPI.h 4 | // SkypeMac 5 | // 6 | // Created by Janno Teelem on 12/04/2005. 7 | // Copyright (c) 2005 Skype Technologies S.A. All rights reserved. 8 | // 9 | 10 | #import 11 | 12 | @protocol SkypeAPIDelegate; 13 | 14 | @interface SkypeAPI : NSObject 15 | { 16 | 17 | } 18 | 19 | + (BOOL)isSkypeRunning; 20 | + (BOOL)isSkypeAvailable; // You can only connect and send commands when this method returns YES. 21 | // For example, when Skype is running, but user is logged out, then it returns NO. 22 | 23 | + (void)setSkypeDelegate:(NSObject*)aDelegate; 24 | + (NSObject*)skypeDelegate; 25 | + (void)removeSkypeDelegate; 26 | 27 | + (void)connect; 28 | + (void)disconnect; 29 | 30 | + (NSString*)sendSkypeCommand:(NSString*)aCommandString; 31 | @end 32 | 33 | 34 | // delegate protocol 35 | @protocol SkypeAPIDelegate 36 | - (NSString*)clientApplicationName; 37 | @end 38 | 39 | // delegate informal protocol 40 | @interface NSObject (SkypeAPIDelegateInformalProtocol) 41 | - (void)skypeNotificationReceived:(NSString*)aNotificationString; 42 | - (void)skypeAttachResponse:(unsigned)aAttachResponseCode; // 0 - failed, 1 - success 43 | - (void)skypeBecameAvailable:(NSNotification*)aNotification; 44 | - (void)skypeBecameUnavailable:(NSNotification*)aNotification; 45 | @end 46 | 47 | -------------------------------------------------------------------------------- /src-native/src_osx/Skype.framework/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | Skype 9 | CFBundleIdentifier 10 | com.skype.skypeframework 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | Skype Framework 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleSignature 18 | SKYP 19 | CFBundleVersion 20 | 2.6.0.142 21 | 22 | 23 | -------------------------------------------------------------------------------- /src-native/src_osx/Skype.framework/Skype: -------------------------------------------------------------------------------- 1 | Versions/A/Skype -------------------------------------------------------------------------------- /src-native/src_osx/Skype.framework/Versions/A/Headers/Skype.h: -------------------------------------------------------------------------------- 1 | // $Id: Skype.h,v 1.2 2005/06/15 11:13:05 teelem Exp $ 2 | /* 3 | * Skype.h 4 | * SkypeMac 5 | * 6 | * Created by Janno Teelem on 12/04/2005. 7 | * Copyright (c) 2005 Skype Technologies S.A. All rights reserved. 8 | * 9 | */ 10 | 11 | #include "SkypeAPI-Carbon.h" 12 | 13 | #ifdef __OBJC__ 14 | #include "SkypeAPI.h" 15 | #endif 16 | 17 | -------------------------------------------------------------------------------- /src-native/src_osx/Skype.framework/Versions/A/Headers/SkypeAPI-Carbon.h: -------------------------------------------------------------------------------- 1 | // $Id: SkypeAPI-Carbon.h,v 1.4 2005/11/28 19:00:28 teelem Exp $ 2 | /* 3 | * SkypeAPI-Carbon.h 4 | * SkypeMac 5 | * 6 | * Created by Janno Teelem on 14/06/2005. 7 | * Copyright 2005 Skype Technologies S.A.. All rights reserved. 8 | * 9 | */ 10 | 11 | #include 12 | #include 13 | 14 | __BEGIN_DECLS 15 | 16 | // In order to use Skype API, you must create a single instance of SkypeDelegate. 17 | // Set callback functions for the members of this struct and Skype will call these 18 | // functions to notify your application when something happens. 19 | struct SkypeDelegate 20 | { 21 | // Required member 22 | CFStringRef clientApplicationName; 23 | 24 | // Optional members, can be NULL 25 | void (*SkypeNotificationReceived)(CFStringRef aNotificationString); 26 | void (*SkypeAttachResponse)(unsigned int aAttachResponseCode); // 0 - failed, 1 - success 27 | void (*SkypeBecameAvailable)(CFPropertyListRef aNotification); 28 | void (*SkypeBecameUnavailable)(CFPropertyListRef aNotification); 29 | }; 30 | 31 | Boolean IsSkypeRunning(void); 32 | Boolean IsSkypeAvailable(void); 33 | 34 | // You must call this function, before calling ConnectToSkype() and SendSkypeCommand() 35 | void SetSkypeDelegate(struct SkypeDelegate* aDelegate); 36 | 37 | struct SkypeDelegate* GetSkypeDelegate(void); 38 | void RemoveSkypeDelegate(void); 39 | 40 | void ConnectToSkype(void); 41 | void DisconnectFromSkype(void); 42 | 43 | CFStringRef SendSkypeCommand(CFStringRef aCommandString); 44 | 45 | __END_DECLS -------------------------------------------------------------------------------- /src-native/src_osx/Skype.framework/Versions/A/Headers/SkypeAPI.h: -------------------------------------------------------------------------------- 1 | // $Id: SkypeAPI.h,v 1.5 2005/11/28 19:00:28 teelem Exp $ 2 | // 3 | // SkypeAPI.h 4 | // SkypeMac 5 | // 6 | // Created by Janno Teelem on 12/04/2005. 7 | // Copyright (c) 2005 Skype Technologies S.A. All rights reserved. 8 | // 9 | 10 | #import 11 | 12 | @protocol SkypeAPIDelegate; 13 | 14 | @interface SkypeAPI : NSObject 15 | { 16 | 17 | } 18 | 19 | + (BOOL)isSkypeRunning; 20 | + (BOOL)isSkypeAvailable; // You can only connect and send commands when this method returns YES. 21 | // For example, when Skype is running, but user is logged out, then it returns NO. 22 | 23 | + (void)setSkypeDelegate:(NSObject*)aDelegate; 24 | + (NSObject*)skypeDelegate; 25 | + (void)removeSkypeDelegate; 26 | 27 | + (void)connect; 28 | + (void)disconnect; 29 | 30 | + (NSString*)sendSkypeCommand:(NSString*)aCommandString; 31 | @end 32 | 33 | 34 | // delegate protocol 35 | @protocol SkypeAPIDelegate 36 | - (NSString*)clientApplicationName; 37 | @end 38 | 39 | // delegate informal protocol 40 | @interface NSObject (SkypeAPIDelegateInformalProtocol) 41 | - (void)skypeNotificationReceived:(NSString*)aNotificationString; 42 | - (void)skypeAttachResponse:(unsigned)aAttachResponseCode; // 0 - failed, 1 - success 43 | - (void)skypeBecameAvailable:(NSNotification*)aNotification; 44 | - (void)skypeBecameUnavailable:(NSNotification*)aNotification; 45 | @end 46 | 47 | -------------------------------------------------------------------------------- /src-native/src_osx/Skype.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | Skype 9 | CFBundleIdentifier 10 | com.skype.skypeframework 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | Skype Framework 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleSignature 18 | SKYP 19 | CFBundleVersion 20 | 2.6.0.142 21 | 22 | 23 | -------------------------------------------------------------------------------- /src-native/src_osx/Skype.framework/Versions/A/Skype: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taksan/skype-java-api/e7007433f851c1d233b7f7b53abfc031cc271ecd/src-native/src_osx/Skype.framework/Versions/A/Skype -------------------------------------------------------------------------------- /src-native/src_osx/Skype.framework/Versions/Current/Headers/Skype.h: -------------------------------------------------------------------------------- 1 | // $Id: Skype.h,v 1.2 2005/06/15 11:13:05 teelem Exp $ 2 | /* 3 | * Skype.h 4 | * SkypeMac 5 | * 6 | * Created by Janno Teelem on 12/04/2005. 7 | * Copyright (c) 2005 Skype Technologies S.A. All rights reserved. 8 | * 9 | */ 10 | 11 | #include "SkypeAPI-Carbon.h" 12 | 13 | #ifdef __OBJC__ 14 | #include "SkypeAPI.h" 15 | #endif 16 | 17 | -------------------------------------------------------------------------------- /src-native/src_osx/Skype.framework/Versions/Current/Headers/SkypeAPI-Carbon.h: -------------------------------------------------------------------------------- 1 | // $Id: SkypeAPI-Carbon.h,v 1.4 2005/11/28 19:00:28 teelem Exp $ 2 | /* 3 | * SkypeAPI-Carbon.h 4 | * SkypeMac 5 | * 6 | * Created by Janno Teelem on 14/06/2005. 7 | * Copyright 2005 Skype Technologies S.A.. All rights reserved. 8 | * 9 | */ 10 | 11 | #include 12 | #include 13 | 14 | __BEGIN_DECLS 15 | 16 | // In order to use Skype API, you must create a single instance of SkypeDelegate. 17 | // Set callback functions for the members of this struct and Skype will call these 18 | // functions to notify your application when something happens. 19 | struct SkypeDelegate 20 | { 21 | // Required member 22 | CFStringRef clientApplicationName; 23 | 24 | // Optional members, can be NULL 25 | void (*SkypeNotificationReceived)(CFStringRef aNotificationString); 26 | void (*SkypeAttachResponse)(unsigned int aAttachResponseCode); // 0 - failed, 1 - success 27 | void (*SkypeBecameAvailable)(CFPropertyListRef aNotification); 28 | void (*SkypeBecameUnavailable)(CFPropertyListRef aNotification); 29 | }; 30 | 31 | Boolean IsSkypeRunning(void); 32 | Boolean IsSkypeAvailable(void); 33 | 34 | // You must call this function, before calling ConnectToSkype() and SendSkypeCommand() 35 | void SetSkypeDelegate(struct SkypeDelegate* aDelegate); 36 | 37 | struct SkypeDelegate* GetSkypeDelegate(void); 38 | void RemoveSkypeDelegate(void); 39 | 40 | void ConnectToSkype(void); 41 | void DisconnectFromSkype(void); 42 | 43 | CFStringRef SendSkypeCommand(CFStringRef aCommandString); 44 | 45 | __END_DECLS -------------------------------------------------------------------------------- /src-native/src_osx/Skype.framework/Versions/Current/Headers/SkypeAPI.h: -------------------------------------------------------------------------------- 1 | // $Id: SkypeAPI.h,v 1.5 2005/11/28 19:00:28 teelem Exp $ 2 | // 3 | // SkypeAPI.h 4 | // SkypeMac 5 | // 6 | // Created by Janno Teelem on 12/04/2005. 7 | // Copyright (c) 2005 Skype Technologies S.A. All rights reserved. 8 | // 9 | 10 | #import 11 | 12 | @protocol SkypeAPIDelegate; 13 | 14 | @interface SkypeAPI : NSObject 15 | { 16 | 17 | } 18 | 19 | + (BOOL)isSkypeRunning; 20 | + (BOOL)isSkypeAvailable; // You can only connect and send commands when this method returns YES. 21 | // For example, when Skype is running, but user is logged out, then it returns NO. 22 | 23 | + (void)setSkypeDelegate:(NSObject*)aDelegate; 24 | + (NSObject*)skypeDelegate; 25 | + (void)removeSkypeDelegate; 26 | 27 | + (void)connect; 28 | + (void)disconnect; 29 | 30 | + (NSString*)sendSkypeCommand:(NSString*)aCommandString; 31 | @end 32 | 33 | 34 | // delegate protocol 35 | @protocol SkypeAPIDelegate 36 | - (NSString*)clientApplicationName; 37 | @end 38 | 39 | // delegate informal protocol 40 | @interface NSObject (SkypeAPIDelegateInformalProtocol) 41 | - (void)skypeNotificationReceived:(NSString*)aNotificationString; 42 | - (void)skypeAttachResponse:(unsigned)aAttachResponseCode; // 0 - failed, 1 - success 43 | - (void)skypeBecameAvailable:(NSNotification*)aNotification; 44 | - (void)skypeBecameUnavailable:(NSNotification*)aNotification; 45 | @end 46 | 47 | -------------------------------------------------------------------------------- /src-native/src_osx/Skype.framework/Versions/Current/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | Skype 9 | CFBundleIdentifier 10 | com.skype.skypeframework 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | Skype Framework 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleSignature 18 | SKYP 19 | CFBundleVersion 20 | 2.6.0.142 21 | 22 | 23 | -------------------------------------------------------------------------------- /src-native/src_osx/Skype.framework/Versions/Current/Skype: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taksan/skype-java-api/e7007433f851c1d233b7f7b53abfc031cc271ecd/src-native/src_osx/Skype.framework/Versions/Current/Skype -------------------------------------------------------------------------------- /src-native/src_osx/build.xml: -------------------------------------------------------------------------------- 1 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /src-native/src_osx/com_skype_connector_osx_SkypeFramework.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | #include 3 | /* Header for class com_skype_connector_osx_SkypeFramework */ 4 | 5 | #ifndef _Included_com_skype_connector_osx_SkypeFramework 6 | #define _Included_com_skype_connector_osx_SkypeFramework 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | /* Inaccessible static: initializedFieldMutex */ 11 | /* Inaccessible static: initialized */ 12 | /* Inaccessible static: listeners */ 13 | /* Inaccessible static: sendCommandMutex */ 14 | /* Inaccessible static: notificationReceivedMutex */ 15 | /* 16 | * Class: com_skype_connector_osx_SkypeFramework 17 | * Method: setup0 18 | * Signature: (Ljava/lang/String;)V 19 | */ 20 | JNIEXPORT void JNICALL Java_com_skype_connector_osx_SkypeFramework_setup0 21 | (JNIEnv *, jclass, jstring); 22 | 23 | /* 24 | * Class: com_skype_connector_osx_SkypeFramework 25 | * Method: isRunning0 26 | * Signature: ()Z 27 | */ 28 | JNIEXPORT jboolean JNICALL Java_com_skype_connector_osx_SkypeFramework_isRunning0 29 | (JNIEnv *, jclass); 30 | 31 | /* 32 | * Class: com_skype_connector_osx_SkypeFramework 33 | * Method: isAvailable0 34 | * Signature: ()Z 35 | */ 36 | JNIEXPORT jboolean JNICALL Java_com_skype_connector_osx_SkypeFramework_isAvailable0 37 | (JNIEnv *, jclass); 38 | 39 | /* 40 | * Class: com_skype_connector_osx_SkypeFramework 41 | * Method: connect0 42 | * Signature: ()V 43 | */ 44 | JNIEXPORT void JNICALL Java_com_skype_connector_osx_SkypeFramework_connect0 45 | (JNIEnv *, jclass); 46 | 47 | /* 48 | * Class: com_skype_connector_osx_SkypeFramework 49 | * Method: sendCommand0 50 | * Signature: (Ljava/lang/String;)Ljava/lang/String; 51 | */ 52 | JNIEXPORT jstring JNICALL Java_com_skype_connector_osx_SkypeFramework_sendCommand0 53 | (JNIEnv *, jclass, jstring); 54 | 55 | /* 56 | * Class: com_skype_connector_osx_SkypeFramework 57 | * Method: dispose0 58 | * Signature: ()V 59 | */ 60 | JNIEXPORT void JNICALL Java_com_skype_connector_osx_SkypeFramework_dispose0 61 | (JNIEnv *, jclass); 62 | 63 | /* 64 | * Class: com_skype_connector_osx_SkypeFramework 65 | * Method: runCurrentEventLoop0 66 | * Signature: (D)I 67 | */ 68 | JNIEXPORT jint JNICALL Java_com_skype_connector_osx_SkypeFramework_runCurrentEventLoop0 69 | (JNIEnv *, jclass, jdouble); 70 | 71 | /* 72 | * Class: com_skype_connector_osx_SkypeFramework 73 | * Method: runApplicationEventLoop0 74 | * Signature: ()V 75 | */ 76 | JNIEXPORT void JNICALL Java_com_skype_connector_osx_SkypeFramework_runApplicationEventLoop0 77 | (JNIEnv *, jclass); 78 | 79 | /* 80 | * Class: com_skype_connector_osx_SkypeFramework 81 | * Method: quitApplicationEventLoop0 82 | * Signature: ()V 83 | */ 84 | JNIEXPORT void JNICALL Java_com_skype_connector_osx_SkypeFramework_quitApplicationEventLoop0 85 | (JNIEnv *, jclass); 86 | 87 | #ifdef __cplusplus 88 | } 89 | #endif 90 | #endif 91 | -------------------------------------------------------------------------------- /src-native/src_win32/Makefile: -------------------------------------------------------------------------------- 1 | #/******************************************************************************* 2 | # * Copyright (c) 2011 Gabriel Takeuchi 3 | # * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 4 | # * Copyright (c) 2006-2007 UBION Inc. 5 | # * 6 | # * Copyright (c) 2006-2007 Skype Technologies S.A. 7 | # * 8 | # * Skype4Java is licensed under either the Apache License, Version 2.0 or 9 | # * the Eclipse Public License v1.0. 10 | # * You may use it freely in commercial and non-commercial products. 11 | # * You may obtain a copy of the licenses at 12 | # * 13 | # * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 14 | # * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 15 | # * 16 | # * If it is possible to cooperate with the publicity of Skype4Java, please add 17 | # * links to the Skype4Java web site 18 | # * in your web site or documents. 19 | # * 20 | # * Contributors: 21 | # * Gabriel Takeuchi - Makes both 32 bit and 64 bit dlls automatically 22 | # ******************************************************************** 23 | # To build using this Makefile you just need mingw installed 24 | 25 | all: x86 amd64 26 | 27 | x86: 28 | gcc -m32 -shared -I"${JAVA_HOME}"/include -I"${JAVA_HOME}"/include/win32 -Wall -D_JNI_IMPLEMENTATION_ -Wl,--kill-at Win32Connector.cpp -o skype_x86.dll 29 | cp skype_x86.dll ../../src/main/resources 30 | 31 | amd64: 32 | # TODO 33 | 34 | clean: 35 | rm -rf *.o *.dll 36 | -------------------------------------------------------------------------------- /src-native/src_win32/Makefile.linux: -------------------------------------------------------------------------------- 1 | #/******************************************************************************* 2 | # * Copyright (c) 2011 Gabriel Takeuchi 3 | # * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 4 | # * Copyright (c) 2006-2007 UBION Inc. 5 | # * 6 | # * Copyright (c) 2006-2007 Skype Technologies S.A. 7 | # * 8 | # * Skype4Java is licensed under either the Apache License, Version 2.0 or 9 | # * the Eclipse Public License v1.0. 10 | # * You may use it freely in commercial and non-commercial products. 11 | # * You may obtain a copy of the licenses at 12 | # * 13 | # * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 14 | # * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 15 | # * 16 | # * If it is possible to cooperate with the publicity of Skype4Java, please add 17 | # * links to the Skype4Java web site 18 | # * in your web site or documents. 19 | # * 20 | # * Contributors: 21 | # * Gabriel Takeuchi - Makes both 32 bit and 64 bit dlls automatically 22 | # ******************************************************************** 23 | # To build using this Makefile you need to install: 24 | # - apt-get install mingw-w64-dev 25 | 26 | CC32=i686-w64-mingw32-gcc 27 | CC64=x86_64-w64-mingw32-gcc 28 | 29 | all: x86 amd64 30 | 31 | x86: 32 | $(CC32) -shared -I"${JAVA_HOME}"/include -I"${JAVA_HOME}"/include -Wall -D_JNI_IMPLEMENTATION_ -Wl,--kill-at Win32Connector.cpp -o skype_x86.dll 33 | cp skype_x86.dll ../../src/main/resources 34 | 35 | amd64: 36 | $(CC64) -shared -I"${JAVA_HOME}"/include -I"${JAVA_HOME}"/include -Wall -D_JNI_IMPLEMENTATION_ -Wl,--kill-at Win32Connector.cpp -o skype_amd64.dll 37 | cp skype_amd64.dll ../../src/main/resources 38 | 39 | 40 | clean: 41 | rm -rf *.o *.dll 42 | 43 | -------------------------------------------------------------------------------- /src-native/src_win32/NMakefile: -------------------------------------------------------------------------------- 1 | #/******************************************************************************* 2 | # * Copyright (c) 2011 Gabriel Takeuchi 3 | # * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 4 | # * Copyright (c) 2006-2007 UBION Inc. 5 | # * 6 | # * Copyright (c) 2006-2007 Skype Technologies S.A. 7 | # * 8 | # * Skype4Java is licensed under either the Apache License, Version 2.0 or 9 | # * the Eclipse Public License v1.0. 10 | # * You may use it freely in commercial and non-commercial products. 11 | # * You may obtain a copy of the licenses at 12 | # * 13 | # * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 14 | # * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 15 | # * 16 | # * If it is possible to cooperate with the publicity of Skype4Java, please add 17 | # * links to the Skype4Java web site 18 | # * in your web site or documents. 19 | # * 20 | # * Contributors: 21 | # * Gabriel Takeuchi - Makes both 32 bit and 64 bit dlls automatically 22 | # ******************************************************************************/ 23 | # use NMAKE 24 | all: 25 | devenv skype.sln /build "Release|Win32" 26 | devenv skype.sln /build "Release|x64" 27 | move /y x86\skype_x86.dll ..\..\src\main\resources 28 | move /y amd64\skype_amd64.dll ..\..\src\main\resources 29 | 30 | clean: 31 | del amd64 x86 skype.suo 32 | -------------------------------------------------------------------------------- /src-native/src_win32/com_skype_connector_win32_Win32Connector.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | #include 3 | /* Header for class com_skype_connector_win32_Win32Connector */ 4 | 5 | #ifndef _Included_com_skype_connector_win32_Win32Connector 6 | #define _Included_com_skype_connector_win32_Win32Connector 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | #undef com_skype_connector_win32_Win32Connector_ATTACH_SUCCESS 11 | #define com_skype_connector_win32_Win32Connector_ATTACH_SUCCESS 0L 12 | #undef com_skype_connector_win32_Win32Connector_ATTACH_PENDING_AUTHORIZATION 13 | #define com_skype_connector_win32_Win32Connector_ATTACH_PENDING_AUTHORIZATION 1L 14 | #undef com_skype_connector_win32_Win32Connector_ATTACH_REFUSED 15 | #define com_skype_connector_win32_Win32Connector_ATTACH_REFUSED 2L 16 | #undef com_skype_connector_win32_Win32Connector_ATTACH_NOT_AVAILABLE 17 | #define com_skype_connector_win32_Win32Connector_ATTACH_NOT_AVAILABLE 3L 18 | #undef com_skype_connector_win32_Win32Connector_ATTACH_API_AVAILABLE 19 | #define com_skype_connector_win32_Win32Connector_ATTACH_API_AVAILABLE 32769L 20 | /* 21 | * Class: com_skype_connector_win32_Win32Connector 22 | * Method: jni_init 23 | * Signature: ()V 24 | */ 25 | JNIEXPORT void JNICALL Java_com_skype_connector_win32_Win32Connector_jni_1init 26 | (JNIEnv *, jobject); 27 | 28 | /* 29 | * Class: com_skype_connector_win32_Win32Connector 30 | * Method: jni_windowProc 31 | * Signature: ()V 32 | */ 33 | JNIEXPORT void JNICALL Java_com_skype_connector_win32_Win32Connector_jni_1windowProc 34 | (JNIEnv *, jobject); 35 | 36 | /* 37 | * Class: com_skype_connector_win32_Win32Connector 38 | * Method: jni_sendMessage 39 | * Signature: (Ljava/lang/String;)V 40 | */ 41 | JNIEXPORT void JNICALL Java_com_skype_connector_win32_Win32Connector_jni_1sendMessage 42 | (JNIEnv *, jobject, jstring); 43 | 44 | /* 45 | * Class: com_skype_connector_win32_Win32Connector 46 | * Method: jni_connect 47 | * Signature: ()V 48 | */ 49 | JNIEXPORT void JNICALL Java_com_skype_connector_win32_Win32Connector_jni_1connect 50 | (JNIEnv *, jobject); 51 | 52 | /* 53 | * Class: com_skype_connector_win32_Win32Connector 54 | * Method: jni_getInstalledPath 55 | * Signature: ()Ljava/lang/String; 56 | */ 57 | JNIEXPORT jstring JNICALL Java_com_skype_connector_win32_Win32Connector_jni_1getInstalledPath 58 | (JNIEnv *, jobject); 59 | 60 | #ifdef __cplusplus 61 | } 62 | #endif 63 | #endif 64 | -------------------------------------------------------------------------------- /src-native/src_win32/skype.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 10.00 3 | # Visual Studio 2008 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "skype", "skype.vcproj", "{883B5843-CDF4-4E53-9C83-2326164F7867}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Win32 = Debug|Win32 9 | Debug|x64 = Debug|x64 10 | Release|Win32 = Release|Win32 11 | Release|x64 = Release|x64 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {883B5843-CDF4-4E53-9C83-2326164F7867}.Debug|Win32.ActiveCfg = Debug|Win32 15 | {883B5843-CDF4-4E53-9C83-2326164F7867}.Debug|Win32.Build.0 = Debug|Win32 16 | {883B5843-CDF4-4E53-9C83-2326164F7867}.Debug|x64.ActiveCfg = Debug|x64 17 | {883B5843-CDF4-4E53-9C83-2326164F7867}.Debug|x64.Build.0 = Debug|x64 18 | {883B5843-CDF4-4E53-9C83-2326164F7867}.Release|Win32.ActiveCfg = Release|Win32 19 | {883B5843-CDF4-4E53-9C83-2326164F7867}.Release|Win32.Build.0 = Release|Win32 20 | {883B5843-CDF4-4E53-9C83-2326164F7867}.Release|x64.ActiveCfg = Release|x64 21 | {883B5843-CDF4-4E53-9C83-2326164F7867}.Release|x64.Build.0 = Release|x64 22 | EndGlobalSection 23 | GlobalSection(SolutionProperties) = preSolution 24 | HideSolutionNode = FALSE 25 | EndGlobalSection 26 | EndGlobal 27 | -------------------------------------------------------------------------------- /src/main/java/com/skype/AbstractVoiceMailListener.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 3 | * Copyright (c) 2006-2007 UBION Inc. 4 | * 5 | * Copyright (c) 2006-2007 Skype Technologies S.A. 6 | * 7 | * Skype4Java is licensed under either the Apache License, Version 2.0 or 8 | * the Eclipse Public License v1.0. 9 | * You may use it freely in commercial and non-commercial products. 10 | * You may obtain a copy of the licenses at 11 | * 12 | * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 13 | * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 14 | * 15 | * If it is possible to cooperate with the publicity of Skype4Java, please add 16 | * links to the Skype4Java web site 17 | * in your web site or documents. 18 | * 19 | * Contributors: 20 | * Koji Hisano - initial API, implementation and changed javadoc 21 | * Bart Lamot - initial javadocs 22 | ******************************************************************************/ 23 | package com.skype; 24 | 25 | /** 26 | * Empty implementation of VoiceMailListener to overide and use as a listener. 27 | * @author Koji Hisano 28 | */ 29 | public class AbstractVoiceMailListener implements VoiceMailListener { 30 | /** 31 | * Called when a new voice mail is received. 32 | * @param receivedVoiceMail the received voice mail 33 | * @throws SkypeException if a connection is bad 34 | */ 35 | public void voiceMailReceived(VoiceMail receivedVoiceMail) throws SkypeException { 36 | } 37 | 38 | /** 39 | * Called when a new voice mail is made. 40 | * @param madeVoiceMail the made voice mail 41 | * @throws SkypeException if the connection is bad. 42 | */ 43 | public void voiceMailMade(VoiceMail madeVoiceMail) throws SkypeException { 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/com/skype/ApplicationAdapter.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 3 | * Copyright (c) 2006-2007 UBION Inc. 4 | * 5 | * Copyright (c) 2006-2007 Skype Technologies S.A. 6 | * 7 | * Skype4Java is licensed under either the Apache License, Version 2.0 or 8 | * the Eclipse Public License v1.0. 9 | * You may use it freely in commercial and non-commercial products. 10 | * You may obtain a copy of the licenses at 11 | * 12 | * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 13 | * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 14 | * 15 | * If it is possible to cooperate with the publicity of Skype4Java, please add 16 | * links to the Skype4Java web site 17 | * in your web site or documents. 18 | * 19 | * Contributors: 20 | * Koji Hisano - initial API and implementation 21 | * Bart Lamot - good javadocs 22 | ******************************************************************************/ 23 | package com.skype; 24 | 25 | /** 26 | * Use this class to implement event triggers for AP2AP connections. 27 | * @author Koji Hisano 28 | */ 29 | public class ApplicationAdapter implements ApplicationListener { 30 | /** 31 | * Implement this method to get triggered on AP2AP connected events. 32 | * @param stream the stream that triggered the event. 33 | * @throws SkypeException when connection is gone bad. 34 | */ 35 | public void connected(final Stream stream) throws SkypeException { 36 | } 37 | 38 | /** 39 | * Implement this method to get triggered on AP2AP disconnected events. 40 | * @param stream the stream that triggered the event. 41 | * @throws SkypeException when connection is gone bad. 42 | */ 43 | public void disconnected(final Stream stream) throws SkypeException { 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/com/skype/ApplicationListener.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 3 | * Copyright (c) 2006-2007 UBION Inc. 4 | * 5 | * Copyright (c) 2006-2007 Skype Technologies S.A. 6 | * 7 | * Skype4Java is licensed under either the Apache License, Version 2.0 or 8 | * the Eclipse Public License v1.0. 9 | * You may use it freely in commercial and non-commercial products. 10 | * You may obtain a copy of the licenses at 11 | * 12 | * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 13 | * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 14 | * 15 | * If it is possible to cooperate with the publicity of Skype4Java, please add 16 | * links to the Skype4Java web site 17 | * in your web site or documents. 18 | * 19 | * Contributors: 20 | * Koji Hisano - initial API and implementation 21 | * Bart Lamot - good javadocs 22 | ******************************************************************************/ 23 | package com.skype; 24 | 25 | /** 26 | * Listener used for the Application class. 27 | * Listener gets triggerd by AP2AP events. 28 | * @author Koji Hisano 29 | */ 30 | public interface ApplicationListener { 31 | /** 32 | * Called when a AP2AP stream is connected. 33 | * @param stream the connected stream. 34 | * @throws SkypeException when connection is gone bad. 35 | */ 36 | void connected(Stream stream) throws SkypeException; 37 | 38 | /** 39 | * Called when a AP2AP stream gets disconnected. 40 | * @param stream the disconnected stream. 41 | * @throws SkypeException when connection is gone bad. 42 | */ 43 | void disconnected(Stream stream) throws SkypeException; 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/skype/CallAdapter.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 3 | * Copyright (c) 2006-2007 UBION Inc. 4 | * 5 | * Copyright (c) 2006-2007 Skype Technologies S.A. 6 | * 7 | * Skype4Java is licensed under either the Apache License, Version 2.0 or 8 | * the Eclipse Public License v1.0. 9 | * You may use it freely in commercial and non-commercial products. 10 | * You may obtain a copy of the licenses at 11 | * 12 | * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 13 | * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 14 | * 15 | * If it is possible to cooperate with the publicity of Skype4Java, please add 16 | * links to the Skype4Java web site 17 | * in your web site or documents. 18 | * 19 | * Contributors: 20 | * Koji Hisano - initial API and implementation 21 | * Bart Lamot - good javadocs 22 | ******************************************************************************/ 23 | package com.skype; 24 | 25 | /** 26 | * Empty implementation of CallListener to overide and use as a listener. 27 | * @author Koji Hisano 28 | */ 29 | public class CallAdapter implements CallListener { 30 | /** 31 | * This method will be triggered when a CALL is received. 32 | * @param receivedCall the CALL received. 33 | * @throws SkypeException when connection is gone bad. 34 | */ 35 | public void callReceived(Call receivedCall) throws SkypeException { 36 | } 37 | 38 | /** 39 | * This method is called when a new CALL is started. 40 | * @param makedCall the new CALL made. 41 | * @throws SkypeException when the connection is goen bad. 42 | */ 43 | public void callMaked(Call makedCall) throws SkypeException { 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/com/skype/CallConnectorListener.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2013 Fabio D. C. Depin . 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | * Contributors: 17 | * Fabio D. C. Depin - initial implementation this Class 18 | ******************************************************************************/ 19 | package com.skype; 20 | 21 | import com.skype.connector.AbstractConnectorListener; 22 | import com.skype.connector.ConnectorMessageEvent; 23 | 24 | /** 25 | * Monitor for CALL events. 26 | * 27 | * @author Fabio D. C. Depin 28 | */ 29 | public class CallConnectorListener extends AbstractConnectorListener { 30 | 31 | private CallMonitorListener callMonitorListener = null; 32 | 33 | CallConnectorListener(CallMonitorListener listener) { 34 | callMonitorListener = listener; 35 | } 36 | 37 | @Override 38 | public void messageReceived(ConnectorMessageEvent event) { 39 | String message = event.getMessage(); 40 | if (message.startsWith("CALL ")) { 41 | String data = message.substring("CALL ".length()); 42 | String id = data.substring(0, data.indexOf(' ')); 43 | String propertyNameAndValue = data.substring(data.indexOf(' ') + 1); 44 | String propertyName = propertyNameAndValue.substring(0, 45 | propertyNameAndValue.indexOf(' ')); 46 | if ("STATUS".equals(propertyName)) { 47 | String propertyValue = propertyNameAndValue 48 | .substring(propertyNameAndValue.indexOf(' ') + 1); 49 | Call.Status status = Call.Status.valueOf(propertyValue); 50 | if (callMonitorListener != null){ 51 | Call call = Call.getInstance(id, callMonitorListener); 52 | call.fireCallMonitor(status); 53 | } else { 54 | Call call = Call.getInstance(id); 55 | } 56 | EXIT: 57 | if (status == Call.Status.FINISHED || status == Call.Status.CANCELLED || 58 | status == Call.Status.FAILED || status == Call.Status.MISSED){ 59 | break EXIT; 60 | } 61 | } 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/main/java/com/skype/CallListener.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 3 | * Copyright (c) 2006-2007 UBION Inc. 4 | * 5 | * Copyright (c) 2006-2007 Skype Technologies S.A. 6 | * 7 | * Skype4Java is licensed under either the Apache License, Version 2.0 or 8 | * the Eclipse Public License v1.0. 9 | * You may use it freely in commercial and non-commercial products. 10 | * You may obtain a copy of the licenses at 11 | * 12 | * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 13 | * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 14 | * 15 | * If it is possible to cooperate with the publicity of Skype4Java, please add 16 | * links to the Skype4Java web site 17 | * in your web site or documents. 18 | * 19 | * Contributors: 20 | * Koji Hisano - initial API and implementation 21 | * Bart Lamot - good javadocs 22 | ******************************************************************************/ 23 | package com.skype; 24 | 25 | /** 26 | * Listener interface for the CALL object. 27 | * @author Koji Hisano. 28 | */ 29 | public interface CallListener { 30 | /** 31 | * Called when a CALL is received. 32 | * @param receivedCall the received CALL. 33 | * @throws SkypeException when a connection is gone bad. 34 | */ 35 | void callReceived(Call receivedCall) throws SkypeException; 36 | 37 | /** 38 | * Called when a new CALL is started. 39 | * @param makedCall the new CALL made. 40 | * @throws SkypeException when the connection is goen bad. 41 | */ 42 | void callMaked(Call makedCall) throws SkypeException; 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/com/skype/CallMonitorListener.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2013 Fabio D. C. Depin . 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | * * Contributors: 17 | * Fabio D. C. Depin - initial implementation this Class 18 | ******************************************************************************/ 19 | package com.skype; 20 | 21 | /** 22 | * Listener interface for CALL objects status changed events. 23 | * @see Call 24 | * @author Fabio D. C. Depin 25 | */ 26 | public interface CallMonitorListener { 27 | /** 28 | * Called when the status of a CALL object changes. 29 | * @param CALL object. 30 | * @param STATUS identified that changed. 31 | * @throws SkypeException when a connection is gone bad. 32 | */ 33 | void callMonitor(Call call, Call.Status status) throws SkypeException; 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/skype/CallStatusChangedListener.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 3 | * Copyright (c) 2006-2007 UBION Inc. 4 | * 5 | * Copyright (c) 2006-2007 Skype Technologies S.A. 6 | * 7 | * Skype4Java is licensed under either the Apache License, Version 2.0 or 8 | * the Eclipse Public License v1.0. 9 | * You may use it freely in commercial and non-commercial products. 10 | * You may obtain a copy of the licenses at 11 | * 12 | * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 13 | * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 14 | * 15 | * If it is possible to cooperate with the publicity of Skype4Java, please add 16 | * links to the Skype4Java web site 17 | * in your web site or documents. 18 | * 19 | * Contributors: 20 | * Koji Hisano - initial API and implementation 21 | * Bart Lamot - good javadocs 22 | ******************************************************************************/ 23 | package com.skype; 24 | 25 | /** 26 | * Listener interface for CALL objects status changed events. 27 | * @author Koji Hisano. 28 | */ 29 | public interface CallStatusChangedListener { 30 | /** 31 | * Called when the status of a CALL object changes. 32 | * @param status the new status. 33 | * @throws SkypeException when a connection is gone bad. 34 | */ 35 | void statusChanged(Call.Status status) throws SkypeException; 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/skype/ChatListener.java: -------------------------------------------------------------------------------- 1 | package com.skype; 2 | 3 | public interface ChatListener { 4 | public void userAdded(User user); 5 | public void userLeft(User user); 6 | } 7 | -------------------------------------------------------------------------------- /src/main/java/com/skype/ChatListenerMananager.java: -------------------------------------------------------------------------------- 1 | package com.skype; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import com.skype.ChatMessage.LeaveReason; 7 | import com.skype.ChatMessage.Type; 8 | 9 | public class ChatListenerMananager implements ChatMessageListener { 10 | private List listeners = new ArrayList(); 11 | 12 | @Override 13 | public void chatMessageReceived(ChatMessage chatMessage) throws SkypeException { 14 | determineChatEvent(chatMessage); 15 | } 16 | 17 | 18 | @Override 19 | public void chatMessageSent(ChatMessage chatMessage) throws SkypeException { 20 | determineChatEvent(chatMessage); 21 | } 22 | 23 | private synchronized void determineChatEvent(ChatMessage chatMessage) throws SkypeException { 24 | Chat chat = chatMessage.getChat(); 25 | Type type = chatMessage.getType(); 26 | switch(type){ 27 | case ADDEDMEMBERS: 28 | User[] addedUsers = chatMessage.getAllUsers(); 29 | for (User user : addedUsers) { 30 | fireChatUserAdded(chat, user); 31 | } 32 | break; 33 | case LEFT: 34 | LeaveReason leaveReason = chatMessage.getLeaveReason(); 35 | if (leaveReason.equals(LeaveReason.UNSUBSCRIBE)) { 36 | User user = chatMessage.getSender(); 37 | fireChatUserLeft(chat, user); 38 | } 39 | break; 40 | default: 41 | // do nothing 42 | } 43 | } 44 | 45 | private void fireChatUserAdded(Chat chat, User user) { 46 | for (GlobalChatListener listener : listeners) 47 | listener.userAdded(chat, user); 48 | } 49 | 50 | private void fireChatUserLeft(Chat chat, User user) { 51 | for (GlobalChatListener listener : listeners) 52 | listener.userLeft(chat, user); 53 | } 54 | 55 | void addGlobalChatListener(GlobalChatListener listener) { 56 | listeners.add(listener); 57 | } 58 | 59 | void removeListener(GlobalChatListener listener) { 60 | listeners.remove(listener); 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /src/main/java/com/skype/ChatMessageAdapter.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 3 | * Copyright (c) 2006-2007 UBION Inc. 4 | * 5 | * Copyright (c) 2006-2007 Skype Technologies S.A. 6 | * 7 | * Skype4Java is licensed under either the Apache License, Version 2.0 or 8 | * the Eclipse Public License v1.0. 9 | * You may use it freely in commercial and non-commercial products. 10 | * You may obtain a copy of the licenses at 11 | * 12 | * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 13 | * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 14 | * 15 | * If it is possible to cooperate with the publicity of Skype4Java, please add 16 | * links to the Skype4Java web site 17 | * in your web site or documents. 18 | * 19 | * Contributors: 20 | * Koji Hisano - initial API and implementation 21 | * Bart Lamot - good javadocs 22 | ******************************************************************************/ 23 | package com.skype; 24 | 25 | /** 26 | * Implementation of the ChatMessageListener. 27 | * Overide the methods to use for event trigger. 28 | * @see ChatMessageListener 29 | * @author Koji Hisano 30 | */ 31 | public class ChatMessageAdapter implements ChatMessageListener { 32 | /** 33 | * This method is called when a chatmessage is received. 34 | * @param receivedChatMessage the actual message. 35 | * @throws SkypeException when the connection has gone bad. 36 | */ 37 | public void chatMessageReceived(ChatMessage receivedChatMessage) throws SkypeException { 38 | } 39 | 40 | /** 41 | * This method is called when a chatmessage us sent. 42 | * @param sentChatMessage the chatmessage that has been sent. 43 | * @throws SkypeException when the connection has gone bad. 44 | */ 45 | public void chatMessageSent(ChatMessage sentChatMessage) throws SkypeException { 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/com/skype/ChatMessageEditListener.java: -------------------------------------------------------------------------------- 1 | package com.skype; 2 | 3 | import java.util.Date; 4 | 5 | 6 | public interface ChatMessageEditListener { 7 | public void chatMessageEdited(ChatMessage editedMessage, Date eventDate, User who); 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/com/skype/ChatMessageListener.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 3 | * Copyright (c) 2006-2007 UBION Inc. 4 | * 5 | * Copyright (c) 2006-2007 Skype Technologies S.A. 6 | * 7 | * Skype4Java is licensed under either the Apache License, Version 2.0 or 8 | * the Eclipse Public License v1.0. 9 | * You may use it freely in commercial and non-commercial products. 10 | * You may obtain a copy of the licenses at 11 | * 12 | * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 13 | * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 14 | * 15 | * If it is possible to cooperate with the publicity of Skype4Java, please add 16 | * links to the Skype4Java web site 17 | * in your web site or documents. 18 | * 19 | * Contributors: 20 | * Koji Hisano - initial API and implementation 21 | * Bart Lamot - good javadocs 22 | ******************************************************************************/ 23 | package com.skype; 24 | 25 | /** 26 | * This is the listener for the ChatMessage object. 27 | * @see ChatMessage 28 | * @author Koji Hisano 29 | */ 30 | public interface ChatMessageListener { 31 | /** 32 | * This method is called when a ChatMessage is received. 33 | * @param receivedChatMessage the received message. 34 | * @throws SkypeException when a connection has gone bad. 35 | */ 36 | void chatMessageReceived(ChatMessage receivedChatMessage) throws SkypeException; 37 | 38 | /** 39 | * This method is called when a chat message is sent. 40 | * @param sentChatMessage the sent message. 41 | * @throws SkypeException when a connection has gone bad. 42 | */ 43 | void chatMessageSent(ChatMessage sentChatMessage) throws SkypeException; 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/skype/CommandFailedException.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 3 | * Copyright (c) 2006-2007 UBION Inc. 4 | * 5 | * Copyright (c) 2006-2007 Skype Technologies S.A. 6 | * 7 | * Skype4Java is licensed under either the Apache License, Version 2.0 or 8 | * the Eclipse Public License v1.0. 9 | * You may use it freely in commercial and non-commercial products. 10 | * You may obtain a copy of the licenses at 11 | * 12 | * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 13 | * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 14 | * 15 | * If it is possible to cooperate with the publicity of Skype4Java, please add 16 | * links to the Skype4Java web site 17 | * in your web site or documents. 18 | * 19 | * Contributors: 20 | * Koji Hisano - initial API and implementation 21 | * Bart Lamot - good javadocs 22 | ******************************************************************************/ 23 | package com.skype; 24 | 25 | /** 26 | * This exception is used for commands that get a ERROR reply. 27 | * @author Koji Hisano 28 | */ 29 | public final class CommandFailedException extends SkypeException { 30 | /** 31 | * serialVersionUID needed for all serialisation objects. 32 | */ 33 | private static final long serialVersionUID = 5247715297475793607L; 34 | 35 | /** 36 | * ERROR code refrence. 37 | * @see https://developer.skype.com/Docs/ApiDoc/Error_codes 38 | */ 39 | private int code; 40 | 41 | /** 42 | * The error message. 43 | */ 44 | private String message; 45 | 46 | /** 47 | * Constructor with parsing. 48 | * @param response the complete ERROR string. 49 | */ 50 | CommandFailedException(String response) { 51 | super(response); 52 | if (response.startsWith("ERROR ")) { 53 | response = response.substring("ERROR ".length()); 54 | } 55 | int spaceIndex = response.indexOf(' '); 56 | if (spaceIndex == -1) { 57 | code = Integer.parseInt(response); 58 | message = "ERROR " + response; 59 | } 60 | else { 61 | code = Integer.parseInt(response.substring(0, spaceIndex)); 62 | message = response.substring(spaceIndex + 1); 63 | } 64 | } 65 | 66 | /** 67 | * returns the error code. 68 | * @return error code. 69 | */ 70 | public int getCode() { 71 | return code; 72 | } 73 | 74 | /** 75 | * Returns the humanreadible error message. 76 | * @return message. 77 | */ 78 | public String getMessage() { 79 | return message; 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /src/main/java/com/skype/ConnectorListenerImpl.java: -------------------------------------------------------------------------------- 1 | package com.skype; 2 | 3 | import com.skype.connector.AbstractConnectorListener; 4 | import com.skype.connector.ConnectorMessageEvent; 5 | 6 | final class ConnectorListenerImpl extends 7 | AbstractConnectorListener { 8 | public void messageReceived(ConnectorMessageEvent event) { 9 | String message = event.getMessage(); 10 | if (message.startsWith("CALL ")) { 11 | String data = message.substring("CALL ".length()); 12 | String id = data.substring(0, data.indexOf(' ')); 13 | String propertyNameAndValue = data 14 | .substring(data.indexOf(' ') + 1); 15 | String propertyName = propertyNameAndValue.substring(0, 16 | propertyNameAndValue.indexOf(' ')); 17 | if ("STATUS".equals(propertyName)) { 18 | String propertyValue = propertyNameAndValue 19 | .substring(propertyNameAndValue.indexOf(' ') + 1); 20 | Call.Status status = Call.Status.valueOf(propertyValue); 21 | Call call = Call.getInstance(id); 22 | EXIT: if (status == Call.Status.ROUTING || status == Call.Status.RINGING) { 23 | synchronized (call) { 24 | if (call.isCallListenerEventFired()) { 25 | break EXIT; 26 | } 27 | call.setCallListenerEventFired(true); 28 | CallListener[] listeners = Skype.callListeners 29 | .toArray(new CallListener[0]); 30 | try { 31 | switch (call.getType()) { 32 | case OUTGOING_P2P: 33 | case OUTGOING_PSTN: 34 | for (CallListener listener : listeners) { 35 | try { 36 | listener.callMaked(call); 37 | } catch (Throwable e) { 38 | Skype.handleUncaughtException(e); 39 | } 40 | } 41 | break; 42 | case INCOMING_P2P: 43 | case INCOMING_PSTN: 44 | for (CallListener listener : listeners) { 45 | try { 46 | listener.callReceived(call); 47 | } catch (Throwable e) { 48 | Skype.handleUncaughtException(e); 49 | } 50 | } 51 | break; 52 | default: 53 | // Should an exception be thrown? 54 | break; 55 | } 56 | } catch (Throwable e) { 57 | Skype.handleUncaughtException(e); 58 | } 59 | } 60 | } 61 | call.fireStatusChanged(status); 62 | } 63 | } 64 | } 65 | } -------------------------------------------------------------------------------- /src/main/java/com/skype/CountryIsoByCountryName.java: -------------------------------------------------------------------------------- 1 | package com.skype; 2 | 3 | import java.util.LinkedHashMap; 4 | import java.util.Locale; 5 | import java.util.Map; 6 | 7 | public class CountryIsoByCountryName { 8 | private static Map countryIsoByCountryName = new LinkedHashMap(); 9 | static { 10 | String[] isoCountries = Locale.getISOCountries(); 11 | for (String countryIso : isoCountries) { 12 | String displayCountry = new Locale("", countryIso).getDisplayCountry(new Locale("en_US")); 13 | countryIsoByCountryName.put(displayCountry.toLowerCase(), countryIso.toLowerCase()); 14 | } 15 | } 16 | 17 | public static String getIsoForCountry(String country) { 18 | return countryIsoByCountryName.get(country.toLowerCase()); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/skype/EventMessageListener.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 3 | * Copyright (c) 2006-2007 UBION Inc. 4 | * 5 | * Copyright (c) 2006-2007 Skype Technologies S.A. 6 | * 7 | * Skype4Java is licensed under either the Apache License, Version 2.0 or 8 | * the Eclipse Public License v1.0. 9 | * You may use it freely in commercial and non-commercial products. 10 | * You may obtain a copy of the licenses at 11 | * 12 | * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 13 | * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 14 | * 15 | * If it is possible to cooperate with the publicity of Skype4Java, please add 16 | * links to the Skype4Java web site 17 | * in your web site or documents. 18 | * 19 | * Contributors: 20 | * Koji Hisano - initial API and implementation 21 | ******************************************************************************/ 22 | package com.skype; 23 | 24 | public interface EventMessageListener { 25 | void eventMessageClicked() throws SkypeException; 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/skype/FileTransferListener.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2013 Fabio D. C. Depin . 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | * * Contributors: 17 | * Fabio D. C. Depin - initial implementation this Class 18 | ******************************************************************************/ 19 | package com.skype; 20 | 21 | /** 22 | * This is the listener for the FileTransfer object. 23 | * @see FileTransfer 24 | * @author Fabio D. C. Depin 25 | */ 26 | public interface FileTransferListener { 27 | /** 28 | * Called when the status of a FILETRANSFER object changes. 29 | * @param FILETRANSFER object. 30 | * @param STATUS identified that changed. 31 | * @throws SkypeException when a connection is gone bad. 32 | */ 33 | void fileTransferMonitor(FileTransfer sentFileTransfer, FileTransfer.Status status) throws SkypeException; 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/skype/Friend.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 3 | * Copyright (c) 2006-2007 UBION Inc. 4 | * 5 | * Copyright (c) 2006-2007 Skype Technologies S.A. 6 | * 7 | * Skype4Java is licensed under either the Apache License, Version 2.0 or 8 | * the Eclipse Public License v1.0. 9 | * You may use it freely in commercial and non-commercial products. 10 | * You may obtain a copy of the licenses at 11 | * 12 | * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 13 | * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 14 | * 15 | * If it is possible to cooperate with the publicity of Skype4Java, please add 16 | * links to the Skype4Java web site 17 | * in your web site or documents. 18 | * 19 | * Contributors: 20 | * Koji Hisano - initial API and implementation 21 | * Bart Lamot - good javadocs 22 | ******************************************************************************/ 23 | package com.skype; 24 | 25 | /** 26 | * Implementation of a special USER, one that is authorized and on the contactlist. 27 | * @see User 28 | * @author Koji Hisano 29 | */ 30 | public final class Friend extends User { 31 | /** 32 | * Constuctor. 33 | * @param id ID of this User. 34 | */ 35 | Friend(String id) { 36 | super(id); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/skype/GlobalChatListener.java: -------------------------------------------------------------------------------- 1 | package com.skype; 2 | 3 | public interface GlobalChatListener { 4 | void newChatStarted(Chat chat, User[] users); 5 | void userLeft(Chat chat, User user); 6 | void userAdded(Chat chat, User user); 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/com/skype/GlobalChatMessageListener.java: -------------------------------------------------------------------------------- 1 | package com.skype; 2 | 3 | public interface GlobalChatMessageListener extends ChatMessageListener { 4 | public void newChatStarted(Chat chat, User[] users); 5 | } 6 | -------------------------------------------------------------------------------- /src/main/java/com/skype/MenuItemClickEvent.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 3 | * Copyright (c) 2006-2007 UBION Inc. 4 | * 5 | * Copyright (c) 2006-2007 Skype Technologies S.A. 6 | * 7 | * Skype4Java is licensed under either the Apache License, Version 2.0 or 8 | * the Eclipse Public License v1.0. 9 | * You may use it freely in commercial and non-commercial products. 10 | * You may obtain a copy of the licenses at 11 | * 12 | * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 13 | * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 14 | * 15 | * If it is possible to cooperate with the publicity of Skype4Java, please add 16 | * links to the Skype4Java web site 17 | * in your web site or documents. 18 | * 19 | * Contributors: Koji Hisano - initial API and implementation 20 | ******************************************************************************/ 21 | package com.skype; 22 | 23 | import java.util.EventObject; 24 | 25 | import com.skype.MenuItem.Context; 26 | 27 | public final class MenuItemClickEvent extends EventObject { 28 | private static final long serialVersionUID = -1777142015080318057L; 29 | 30 | private final String[] _skypeIds; 31 | private final Context _context; 32 | private final String[] _contextIds; 33 | 34 | MenuItemClickEvent(MenuItem menuItem, String[] skypeIds, Context context, String[] contextIds) { 35 | super(menuItem); 36 | Utils.checkNotNull("menuItem", menuItem); 37 | Utils.checkNotNull("skypeIds", skypeIds); 38 | Utils.checkNotNull("context", context); 39 | Utils.checkNotNull("contextIds", contextIds); 40 | _skypeIds = skypeIds; 41 | _context = context; 42 | _contextIds = contextIds; 43 | } 44 | 45 | public MenuItem getMenuItem() { 46 | return (MenuItem) getSource(); 47 | } 48 | 49 | public String[] getSkypeIds() { 50 | return _skypeIds; 51 | } 52 | 53 | public Context getContext() { 54 | return _context; 55 | } 56 | 57 | public String[] getContextIds() { 58 | return _contextIds; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/main/java/com/skype/MenuItemListener.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 3 | * Copyright (c) 2006-2007 UBION Inc. 4 | * 5 | * Copyright (c) 2006-2007 Skype Technologies S.A. 6 | * 7 | * Skype4Java is licensed under either the Apache License, Version 2.0 or 8 | * the Eclipse Public License v1.0. 9 | * You may use it freely in commercial and non-commercial products. 10 | * You may obtain a copy of the licenses at 11 | * 12 | * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 13 | * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 14 | * 15 | * If it is possible to cooperate with the publicity of Skype4Java, please add 16 | * links to the Skype4Java web site 17 | * in your web site or documents. 18 | * 19 | * Contributors: 20 | * Koji Hisano - initial API and implementation 21 | ******************************************************************************/ 22 | package com.skype; 23 | 24 | 25 | public interface MenuItemListener { 26 | void menuItemClicked(MenuItemClickEvent event) throws SkypeException; 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/skype/NotAttachedException.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 3 | * Copyright (c) 2006-2007 UBION Inc. 4 | * 5 | * Copyright (c) 2006-2007 Skype Technologies S.A. 6 | * 7 | * Skype4Java is licensed under either the Apache License, Version 2.0 or 8 | * the Eclipse Public License v1.0. 9 | * You may use it freely in commercial and non-commercial products. 10 | * You may obtain a copy of the licenses at 11 | * 12 | * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 13 | * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 14 | * 15 | * If it is possible to cooperate with the publicity of Skype4Java, please add 16 | * links to the Skype4Java web site 17 | * in your web site or documents. 18 | * 19 | * Contributors: 20 | * Koji Hisano - initial API and implementation 21 | * Bart Lamot - good javadocs 22 | ******************************************************************************/ 23 | package com.skype; 24 | 25 | /** 26 | * Exception which is thrown when the connection the SKYPE Client isn't in place. 27 | * @author Koji Hisano 28 | */ 29 | public class NotAttachedException extends SkypeException { 30 | /** 31 | * Serial UID needed for all serialisation objects. 32 | */ 33 | private static final long serialVersionUID = -4191519326969230719L; 34 | 35 | /** 36 | * Constructor. 37 | * 38 | */ 39 | NotAttachedException() { 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/skype/SkypeException.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 3 | * Copyright (c) 2006-2007 UBION Inc. 4 | * 5 | * Copyright (c) 2006-2007 Skype Technologies S.A. 6 | * 7 | * Skype4Java is licensed under either the Apache License, Version 2.0 or 8 | * the Eclipse Public License v1.0. 9 | * You may use it freely in commercial and non-commercial products. 10 | * You may obtain a copy of the licenses at 11 | * 12 | * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 13 | * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 14 | * 15 | * If it is possible to cooperate with the publicity of Skype4Java, please add 16 | * links to the Skype4Java web site 17 | * in your web site or documents. 18 | * 19 | * Contributors: 20 | * Koji Hisano - initial API and implementation 21 | * Bart Lamot - good javadocs 22 | ******************************************************************************/ 23 | package com.skype; 24 | 25 | /** 26 | * Exception that will be thrown when the connection with Skype is not OK or unexpected events happen. 27 | * @author Koji Hisano 28 | */ 29 | public class SkypeException extends Exception { 30 | /** 31 | * SerialVersionUID needed for serialisation. 32 | */ 33 | private static final long serialVersionUID = -4277557764382543108L; 34 | 35 | /** 36 | * Constructor. 37 | * 38 | */ 39 | SkypeException() { 40 | } 41 | 42 | /** 43 | * Constructor with message to provide with the exception. 44 | * @param message the exception message. 45 | */ 46 | SkypeException(String message) { 47 | super(message); 48 | } 49 | 50 | /** 51 | * Constructor not only with a message but also a cause. 52 | * @param message the exception message. 53 | * @param cause the exception cause. 54 | */ 55 | SkypeException(String message, Throwable cause) { 56 | super(message, cause); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/com/skype/SkypeExceptionHandler.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 3 | * Copyright (c) 2006-2007 UBION Inc. 4 | * 5 | * Copyright (c) 2006-2007 Skype Technologies S.A. 6 | * 7 | * Skype4Java is licensed under either the Apache License, Version 2.0 or 8 | * the Eclipse Public License v1.0. 9 | * You may use it freely in commercial and non-commercial products. 10 | * You may obtain a copy of the licenses at 11 | * 12 | * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 13 | * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 14 | * 15 | * If it is possible to cooperate with the publicity of Skype4Java, please add 16 | * links to the Skype4Java web site 17 | * in your web site or documents. 18 | * 19 | * Contributors: 20 | * Koji Hisano - initial API and implementation 21 | ******************************************************************************/ 22 | package com.skype; 23 | 24 | /** 25 | * Interface to handle an uncaught {@link Throwable} in the listener's callback method. 26 | * @see Skype#setSkypeExceptionHanlder() 27 | * @author Koji Hisano 28 | */ 29 | public interface SkypeExceptionHandler { 30 | /** 31 | * Invoked when a {@link Throwable} happened in calling the listener's callback method. 32 | *

33 | * Each failure of calling callback method executes this method. 34 | *

35 | * @param e the throwable occured in the listener's callback method 36 | */ 37 | void uncaughtExceptionHappened(Throwable e); 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/skype/StreamAdapter.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 3 | * Copyright (c) 2006-2007 UBION Inc. 4 | * 5 | * Copyright (c) 2006-2007 Skype Technologies S.A. 6 | * 7 | * Skype4Java is licensed under either the Apache License, Version 2.0 or 8 | * the Eclipse Public License v1.0. 9 | * You may use it freely in commercial and non-commercial products. 10 | * You may obtain a copy of the licenses at 11 | * 12 | * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 13 | * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 14 | * 15 | * If it is possible to cooperate with the publicity of Skype4Java, please add 16 | * links to the Skype4Java web site 17 | * in your web site or documents. 18 | * 19 | * Contributors: 20 | * Koji Hisano - initial API and implementation 21 | ******************************************************************************/ 22 | package com.skype; 23 | 24 | /** 25 | * Listener adapter for Stream objects. 26 | */ 27 | public class StreamAdapter implements StreamListener { 28 | /** 29 | * Overwrite this method to get triggered for each test message. 30 | * @param receivedText the message received. 31 | * @throws SkypeException when connection to Skype client has gone bad. 32 | */ 33 | public void textReceived(String receivedText) throws SkypeException { 34 | } 35 | 36 | /** 37 | * Overwrite this method to get triggered for each datagram message. 38 | * @param receivedDatagram the message received. 39 | * @throws SkypeException when connection to Skype client has gone bad. 40 | */ 41 | public void datagramReceived(String receivedDatagram) throws SkypeException { 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/com/skype/StreamListener.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 3 | * Copyright (c) 2006-2007 UBION Inc. 4 | * 5 | * Copyright (c) 2006-2007 Skype Technologies S.A. 6 | * 7 | * Skype4Java is licensed under either the Apache License, Version 2.0 or 8 | * the Eclipse Public License v1.0. 9 | * You may use it freely in commercial and non-commercial products. 10 | * You may obtain a copy of the licenses at 11 | * 12 | * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 13 | * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 14 | * 15 | * If it is possible to cooperate with the publicity of Skype4Java, please add 16 | * links to the Skype4Java web site 17 | * in your web site or documents. 18 | * 19 | * Contributors: 20 | * Koji Hisano - initial API and implementation 21 | ******************************************************************************/ 22 | package com.skype; 23 | 24 | /** 25 | * Listener interface for Stream object events. 26 | * @see Stream 27 | * @see StreamAdapter 28 | */ 29 | public interface StreamListener { 30 | /** 31 | * This method will be fired when a text message is received. 32 | * @param receivedText the received message. 33 | * @throws SkypeException when the connection to the Skype client has gone bad. 34 | */ 35 | void textReceived(String receivedText) throws SkypeException; 36 | 37 | /** 38 | * This method will be fired when a datagram message is received. 39 | * @param receivedDatagram the received message. 40 | * @throws SkypeException when the connection to the Skype client has gone bad. 41 | */ 42 | void datagramReceived(String receivedDatagram) throws SkypeException; 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/com/skype/TimeOutException.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 3 | * Copyright (c) 2006-2007 UBION Inc. 4 | * 5 | * Copyright (c) 2006-2007 Skype Technologies S.A. 6 | * 7 | * Skype4Java is licensed under either the Apache License, Version 2.0 or 8 | * the Eclipse Public License v1.0. 9 | * You may use it freely in commercial and non-commercial products. 10 | * You may obtain a copy of the licenses at 11 | * 12 | * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 13 | * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 14 | * 15 | * If it is possible to cooperate with the publicity of Skype4Java, please add 16 | * links to the Skype4Java web site 17 | * in your web site or documents. 18 | * 19 | * Contributors: 20 | * Koji Hisano - initial API and implementation 21 | ******************************************************************************/ 22 | package com.skype; 23 | 24 | /** 25 | * Exception to throw when a timeout occurs. 26 | */ 27 | public class TimeOutException extends SkypeException { 28 | /** 29 | * serialVersionUID needed for serialisation. 30 | */ 31 | private static final long serialVersionUID = -5760422025501667771L; 32 | 33 | /** 34 | * Constructor. 35 | * @param message exception message. 36 | */ 37 | TimeOutException(String message) { 38 | super(message); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/com/skype/VoiceMailConnectorListener.java: -------------------------------------------------------------------------------- 1 | package com.skype; 2 | 3 | import com.skype.connector.AbstractConnectorListener; 4 | import com.skype.connector.ConnectorMessageEvent; 5 | 6 | final class VoiceMailConnectorListener extends AbstractConnectorListener { 7 | public void messageReceived(ConnectorMessageEvent event) { 8 | String message = event.getMessage(); 9 | if (message.startsWith("VOICEMAIL ")) { 10 | String data = message.substring("VOICEMAIL ".length()); 11 | String id = data.substring(0, data.indexOf(' ')); 12 | String propertyNameAndValue = data.substring(data.indexOf(' ') + 1); 13 | String propertyName = propertyNameAndValue.substring(0, propertyNameAndValue.indexOf(' ')); 14 | if ("TYPE".equals(propertyName)) { 15 | String propertyValue = propertyNameAndValue.substring(propertyNameAndValue.indexOf(' ') + 1); 16 | VoiceMail.Type type = VoiceMail.Type.valueOf(propertyValue); 17 | VoiceMail voiceMail = VoiceMail.getInstance(id); 18 | VoiceMailListener[] listeners = Skype.voiceMailListeners.toArray(new VoiceMailListener[0]); 19 | switch (type) { 20 | case OUTGOING: 21 | for (VoiceMailListener listener : listeners) { 22 | try { 23 | listener.voiceMailMade(voiceMail); 24 | } catch (Throwable e) { 25 | Skype.handleUncaughtException(e); 26 | } 27 | } 28 | break; 29 | case INCOMING: 30 | for (VoiceMailListener listener : listeners) { 31 | try { 32 | listener.voiceMailReceived(voiceMail); 33 | } catch (Throwable e) { 34 | Skype.handleUncaughtException(e); 35 | } 36 | } 37 | break; 38 | case DEFAULT_GREETING: 39 | case CUSTOM_GREETING: 40 | case UNKNOWN: 41 | default: 42 | // do nothing 43 | break; 44 | } 45 | } 46 | } 47 | } 48 | } -------------------------------------------------------------------------------- /src/main/java/com/skype/VoiceMailListener.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 3 | * Copyright (c) 2006-2007 UBION Inc. 4 | * 5 | * Copyright (c) 2006-2007 Skype Technologies S.A. 6 | * 7 | * Skype4Java is licensed under either the Apache License, Version 2.0 or 8 | * the Eclipse Public License v1.0. 9 | * You may use it freely in commercial and non-commercial products. 10 | * You may obtain a copy of the licenses at 11 | * 12 | * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 13 | * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 14 | * 15 | * If it is possible to cooperate with the publicity of Skype4Java, please add 16 | * links to the Skype4Java web site 17 | * in your web site or documents. 18 | * 19 | * Contributors: 20 | * Koji Hisano - initial API, implementation and changed javadoc 21 | * Bart Lamot - initial javadocs 22 | ******************************************************************************/ 23 | package com.skype; 24 | 25 | /** 26 | * Listener interface for the VoiceMail object. 27 | * @author Koji Hisano. 28 | */ 29 | public interface VoiceMailListener { 30 | /** 31 | * Called when a new voice mail is received. 32 | * @param receivedVoiceMail the received voice mail 33 | * @throws SkypeException if a connection is bad 34 | */ 35 | void voiceMailReceived(VoiceMail receivedVoiceMail) throws SkypeException; 36 | 37 | /** 38 | * Called when a new voice mail is made. 39 | * @param madeVoiceMail the made voice mail 40 | * @throws SkypeException if the connection is bad. 41 | */ 42 | void voiceMailMade(VoiceMail madeVoiceMail) throws SkypeException; 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/com/skype/VoiceMailStatusChangedListener.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 3 | * Copyright (c) 2006-2007 UBION Inc. 4 | * 5 | * Copyright (c) 2006-2007 Skype Technologies S.A. 6 | * 7 | * Skype4Java is licensed under either the Apache License, Version 2.0 or 8 | * the Eclipse Public License v1.0. 9 | * You may use it freely in commercial and non-commercial products. 10 | * You may obtain a copy of the licenses at 11 | * 12 | * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 13 | * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 14 | * 15 | * If it is possible to cooperate with the publicity of Skype4Java, please add 16 | * links to the Skype4Java web site 17 | * in your web site or documents. 18 | * 19 | * Contributors: 20 | * Koji Hisano - initial API, implementation and changed javadoc 21 | * Bart Lamot - initial javadocs 22 | ******************************************************************************/ 23 | package com.skype; 24 | 25 | /** 26 | * Listener interface for VOICEMAIL objects status changed events. 27 | * @author Koji Hisano. 28 | */ 29 | public interface VoiceMailStatusChangedListener { 30 | /** 31 | * Called when the status of a VOICEMAIL object changes. 32 | * @param status the new status. 33 | * @throws SkypeException when a connection is gone bad. 34 | */ 35 | void statusChanged(VoiceMail.Status status) throws SkypeException; 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/skype/connector/AbstractConnectorListener.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 3 | * Copyright (c) 2006-2007 UBION Inc. 4 | * 5 | * Copyright (c) 2006-2007 Skype Technologies S.A. 6 | * 7 | * Skype4Java is licensed under either the Apache License, Version 2.0 or 8 | * the Eclipse Public License v1.0. 9 | * You may use it freely in commercial and non-commercial products. 10 | * You may obtain a copy of the licenses at 11 | * 12 | * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 13 | * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 14 | * 15 | * If it is possible to cooperate with the publicity of Skype4Java, please add 16 | * links to the Skype4Java web site 17 | * in your web site or documents. 18 | * 19 | * Contributors: 20 | * Koji Hisano - initial API and implementation 21 | ******************************************************************************/ 22 | package com.skype.connector; 23 | 24 | /** 25 | * Abstract basis for all platform dependant connectorLinstener implementations. 26 | */ 27 | public abstract class AbstractConnectorListener implements ConnectorListener { 28 | /** 29 | * This method gets fired when a Message is received. 30 | * @param event The event that triggered this. 31 | */ 32 | public void messageReceived(ConnectorMessageEvent event) { 33 | } 34 | 35 | /** 36 | * This method gets fired when a message is being send. 37 | * @param event The event that triggered this. 38 | */ 39 | public void messageSent(ConnectorMessageEvent event) { 40 | } 41 | 42 | /** 43 | * This method is called when a status of a connector changes. 44 | * @param event The event that triggered this. 45 | */ 46 | public void statusChanged(ConnectorStatusEvent event) { 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/com/skype/connector/ConnectorEvent.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 3 | * Copyright (c) 2006-2007 UBION Inc. 4 | * 5 | * Copyright (c) 2006-2007 Skype Technologies S.A. 6 | * 7 | * Skype4Java is licensed under either the Apache License, Version 2.0 or 8 | * the Eclipse Public License v1.0. 9 | * You may use it freely in commercial and non-commercial products. 10 | * You may obtain a copy of the licenses at 11 | * 12 | * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 13 | * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 14 | * 15 | * If it is possible to cooperate with the publicity of Skype4Java, please add 16 | * links to the Skype4Java web site 17 | * in your web site or documents. 18 | * 19 | * Contributors: 20 | * Koji Hisano - initial API and implementation 21 | ******************************************************************************/ 22 | package com.skype.connector; 23 | 24 | import java.util.Date; 25 | import java.util.EventObject; 26 | 27 | /** 28 | * Event will by raised when a connector has a event. 29 | */ 30 | class ConnectorEvent extends EventObject { 31 | /** 32 | * Needed for all serialization classes. 33 | */ 34 | private static final long serialVersionUID = -4743437008394579910L; 35 | 36 | /** Time. */ 37 | private final long time; 38 | 39 | /** 40 | * Constructor. 41 | * @param source The event source. 42 | */ 43 | ConnectorEvent(final Object source) { 44 | super(source); 45 | assert source != null; 46 | time = System.currentTimeMillis(); 47 | } 48 | 49 | /** 50 | * Get the source Connector. 51 | * @return Connector. 52 | */ 53 | public final Connector getConnector() { 54 | return (Connector)getSource(); 55 | } 56 | 57 | /** 58 | * Get the time of the event. 59 | * @return Date fo event. 60 | */ 61 | public final Date getTime() { 62 | return new Date(time); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/main/java/com/skype/connector/ConnectorException.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 3 | * Copyright (c) 2006-2007 UBION Inc. 4 | * 5 | * Copyright (c) 2006-2007 Skype Technologies S.A. 6 | * 7 | * Skype4Java is licensed under either the Apache License, Version 2.0 or 8 | * the Eclipse Public License v1.0. 9 | * You may use it freely in commercial and non-commercial products. 10 | * You may obtain a copy of the licenses at 11 | * 12 | * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 13 | * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 14 | * 15 | * If it is possible to cooperate with the publicity of Skype4Java, please add 16 | * links to the Skype4Java web site 17 | * in your web site or documents. 18 | * 19 | * Contributors: 20 | * Koji Hisano - initial API and implementation 21 | ******************************************************************************/ 22 | package com.skype.connector; 23 | 24 | /** 25 | * Exception class which connectors can throw. 26 | */ 27 | public class ConnectorException extends Exception { 28 | private static final long serialVersionUID = -764987191989792842L; 29 | 30 | /** 31 | * Constructor. 32 | */ 33 | public ConnectorException() { 34 | } 35 | 36 | /** 37 | * Constructor with message. 38 | * @param message The exception message. 39 | */ 40 | public ConnectorException(String message) { 41 | super(message); 42 | } 43 | 44 | /** 45 | * Constructor with message and cause. 46 | * @param message The exception message. 47 | * @param cause The cause exception. 48 | */ 49 | public ConnectorException(String message, Throwable cause) { 50 | super(message, cause); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/com/skype/connector/ConnectorListener.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 3 | * Copyright (c) 2006-2007 UBION Inc. 4 | * 5 | * Copyright (c) 2006-2007 Skype Technologies S.A. 6 | * 7 | * Skype4Java is licensed under either the Apache License, Version 2.0 or 8 | * the Eclipse Public License v1.0. 9 | * You may use it freely in commercial and non-commercial products. 10 | * You may obtain a copy of the licenses at 11 | * 12 | * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 13 | * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 14 | * 15 | * If it is possible to cooperate with the publicity of Skype4Java, please add 16 | * links to the Skype4Java web site 17 | * in your web site or documents. 18 | * 19 | * Contributors: 20 | * Koji Hisano - initial API and implementation 21 | ******************************************************************************/ 22 | package com.skype.connector; 23 | 24 | import java.util.EventListener; 25 | 26 | /** 27 | * Connector event listener interface. 28 | * Implement this interface when writing an event listener for connector classes. 29 | */ 30 | public interface ConnectorListener extends EventListener { 31 | /** 32 | * This will be triggered when a connector has received a message. 33 | * @param event the event source. 34 | */ 35 | void messageReceived(ConnectorMessageEvent event); 36 | 37 | /** 38 | * This will be triggered when a connector has send a message to a Skype Client. 39 | * @param event the event source. 40 | */ 41 | void messageSent(ConnectorMessageEvent event); 42 | 43 | /** 44 | * This method will be triggered when the status of a connector changes. 45 | * @param event the event source. 46 | */ 47 | void statusChanged(ConnectorStatusEvent event); 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/com/skype/connector/ConnectorMessageEvent.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 3 | * Copyright (c) 2006-2007 UBION Inc. 4 | * 5 | * Copyright (c) 2006-2007 Skype Technologies S.A. 6 | * 7 | * Skype4Java is licensed under either the Apache License, Version 2.0 or 8 | * the Eclipse Public License v1.0. 9 | * You may use it freely in commercial and non-commercial products. 10 | * You may obtain a copy of the licenses at 11 | * 12 | * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 13 | * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 14 | * 15 | * If it is possible to cooperate with the publicity of Skype4Java, please add 16 | * links to the Skype4Java web site 17 | * in your web site or documents. 18 | * 19 | * Contributors: 20 | * Koji Hisano - initial API and implementation 21 | ******************************************************************************/ 22 | package com.skype.connector; 23 | 24 | /** 25 | * Event object a connector will use when it fires a message received or sent event. 26 | */ 27 | public final class ConnectorMessageEvent extends ConnectorEvent { 28 | /** 29 | * Needed for serialisation. 30 | */ 31 | private static final long serialVersionUID = -8610258526127376241L; 32 | 33 | /** 34 | * The message that triggered the event. 35 | */ 36 | private final String message; 37 | 38 | /** 39 | * Constructor with source (connector) and the message. 40 | * @param source Connector which threw the event. 41 | * @param newMessage The message sent or received. 42 | */ 43 | ConnectorMessageEvent(Object source, String newMessage) { 44 | super(source); 45 | assert newMessage != null; 46 | this.message = newMessage; 47 | } 48 | 49 | /** 50 | * Get the message of this event. 51 | * @return Message. 52 | */ 53 | public String getMessage() { 54 | return message; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/com/skype/connector/ConnectorStatusEvent.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 3 | * Copyright (c) 2006-2007 UBION Inc. 4 | * 5 | * Copyright (c) 2006-2007 Skype Technologies S.A. 6 | * 7 | * Skype4Java is licensed under either the Apache License, Version 2.0 or 8 | * the Eclipse Public License v1.0. 9 | * You may use it freely in commercial and non-commercial products. 10 | * You may obtain a copy of the licenses at 11 | * 12 | * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 13 | * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 14 | * 15 | * If it is possible to cooperate with the publicity of Skype4Java, please add 16 | * links to the Skype4Java web site 17 | * in your web site or documents. 18 | * 19 | * Contributors: 20 | * Koji Hisano - initial API and implementation 21 | ******************************************************************************/ 22 | package com.skype.connector; 23 | 24 | /** 25 | * This event will be raised when the connector instance has a change in status. 26 | */ 27 | public final class ConnectorStatusEvent extends ConnectorEvent { 28 | /** 29 | * Needed for serialisation. 30 | */ 31 | private static final long serialVersionUID = -7285732323922562464L; 32 | 33 | /** 34 | * The new status that caused this event. 35 | */ 36 | private final Connector.Status status; 37 | 38 | /** 39 | * Constructor which sets the connector as source and the new status. 40 | * @param source The connector that caused the change. 41 | * @param newStatus The new status. 42 | */ 43 | ConnectorStatusEvent(Object source, Connector.Status newStatus) { 44 | super(source); 45 | assert newStatus != null; 46 | this.status = newStatus; 47 | } 48 | 49 | /** 50 | * Return the new Status. 51 | * @return Status. 52 | */ 53 | public Connector.Status getStatus() { 54 | return status; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/com/skype/connector/LoadLibraryException.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 3 | * Copyright (c) 2006-2007 UBION Inc. 4 | * 5 | * Copyright (c) 2006-2007 Skype Technologies S.A. 6 | * 7 | * Skype4Java is licensed under either the Apache License, Version 2.0 or 8 | * the Eclipse Public License v1.0. 9 | * You may use it freely in commercial and non-commercial products. 10 | * You may obtain a copy of the licenses at 11 | * 12 | * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 13 | * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 14 | * 15 | * If it is possible to cooperate with the publicity of Skype4Java, please add 16 | * links to the Skype4Java web site 17 | * in your web site or documents. 18 | * 19 | * Contributors: 20 | * Koji Hisano - initial API and implementation 21 | ******************************************************************************/ 22 | package com.skype.connector; 23 | 24 | /** 25 | * This exception will be thrown when loading a library failed. 26 | */ 27 | @SuppressWarnings("serial") 28 | public final class LoadLibraryException extends ConnectorException { 29 | /** 30 | * Constructor with a message. 31 | * @param message. 32 | */ 33 | LoadLibraryException(String message) { 34 | super(message); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/skype/connector/MessageProcessor.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 3 | * Copyright (c) 2006-2007 UBION Inc. 4 | * 5 | * Copyright (c) 2006-2007 Skype Technologies S.A. 6 | * 7 | * Skype4Java is licensed under either the Apache License, Version 2.0 or 8 | * the Eclipse Public License v1.0. 9 | * You may use it freely in commercial and non-commercial products. 10 | * You may obtain a copy of the licenses at 11 | * 12 | * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 13 | * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 14 | * 15 | * If it is possible to cooperate with the publicity of Skype4Java, please add 16 | * links to the Skype4Java web site 17 | * in your web site or documents. 18 | * 19 | * Contributors: 20 | * Koji Hisano - initial API and implementation 21 | ******************************************************************************/ 22 | package com.skype.connector; 23 | 24 | @Deprecated 25 | public abstract class MessageProcessor { 26 | private Object lock; 27 | private ConnectorListener parent; 28 | 29 | final void init(Object lock, ConnectorListener parent) { 30 | this.lock = lock; 31 | } 32 | 33 | protected abstract void messageReceived(String message); 34 | 35 | protected final void releaseLock() { 36 | synchronized (lock) { 37 | lock.notify(); 38 | } 39 | } 40 | 41 | protected final void processedAllMessages() { 42 | Connector.getInstance().removeConnectorListener(parent); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/skype/connector/NotAttachedException.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 3 | * Copyright (c) 2006-2007 UBION Inc. 4 | * 5 | * Copyright (c) 2006-2007 Skype Technologies S.A. 6 | * 7 | * Skype4Java is licensed under either the Apache License, Version 2.0 or 8 | * the Eclipse Public License v1.0. 9 | * You may use it freely in commercial and non-commercial products. 10 | * You may obtain a copy of the licenses at 11 | * 12 | * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 13 | * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 14 | * 15 | * If it is possible to cooperate with the publicity of Skype4Java, please add 16 | * links to the Skype4Java web site 17 | * in your web site or documents. 18 | * 19 | * Contributors: 20 | * Koji Hisano - initial API and implementation 21 | ******************************************************************************/ 22 | package com.skype.connector; 23 | 24 | import com.skype.connector.Connector.Status; 25 | 26 | /** 27 | * This exception will be thrown when a command is sent to a connector but when the connector isn't connected. 28 | */ 29 | public final class NotAttachedException extends ConnectorException { 30 | /** 31 | * Needed for serialisation. 32 | */ 33 | private static final long serialVersionUID = 8424409627819350472L; 34 | 35 | /** 36 | * The actual current status (Not attached). 37 | */ 38 | private final Status status; 39 | 40 | /** 41 | * Constructor with the current status. 42 | * @param newStatus Current status. 43 | */ 44 | NotAttachedException(Status newStatus) { 45 | this.status = newStatus; 46 | } 47 | 48 | NotAttachedException(Status newStatus, Throwable cause) { 49 | this(newStatus); 50 | initCause(cause); 51 | } 52 | 53 | /** 54 | * Return the status at the moment of the exception. 55 | * @return Status. 56 | */ 57 | public Status getStatus() { 58 | return status; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/main/java/com/skype/connector/NotificationChecker.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 3 | * Copyright (c) 2006-2007 UBION Inc. 4 | * 5 | * Copyright (c) 2006-2007 Skype Technologies S.A. 6 | * 7 | * Skype4Java is licensed under either the Apache License, Version 2.0 or 8 | * the Eclipse Public License v1.0. 9 | * You may use it freely in commercial and non-commercial products. 10 | * You may obtain a copy of the licenses at 11 | * 12 | * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 13 | * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 14 | * 15 | * If it is possible to cooperate with the publicity of Skype4Java, please add 16 | * links to the Skype4Java web site 17 | * in your web site or documents. 18 | * 19 | * Contributors: 20 | * Koji Hisano - initial API and implementation 21 | ******************************************************************************/ 22 | package com.skype.connector; 23 | 24 | public interface NotificationChecker { 25 | boolean isTarget(String message); 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/skype/connector/TimeOutException.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 3 | * Copyright (c) 2006-2007 UBION Inc. 4 | * 5 | * Copyright (c) 2006-2007 Skype Technologies S.A. 6 | * 7 | * Skype4Java is licensed under either the Apache License, Version 2.0 or 8 | * the Eclipse Public License v1.0. 9 | * You may use it freely in commercial and non-commercial products. 10 | * You may obtain a copy of the licenses at 11 | * 12 | * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 13 | * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 14 | * 15 | * If it is possible to cooperate with the publicity of Skype4Java, please add 16 | * links to the Skype4Java web site 17 | * in your web site or documents. 18 | * 19 | * Contributors: 20 | * Koji Hisano - initial API and implementation 21 | ******************************************************************************/ 22 | package com.skype.connector; 23 | 24 | /** 25 | * This exception is thrown when a connector is working with a timeout. 26 | * Like initializing and connecting. 27 | */ 28 | public final class TimeOutException extends ConnectorException { 29 | /** 30 | * Needed for serialisation. 31 | */ 32 | private static final long serialVersionUID = -8283931255668558270L; 33 | 34 | /** 35 | * Constructor. 36 | * @param message Exception message. 37 | */ 38 | public TimeOutException(String message) { 39 | super(message); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/skype/connector/UnsupportedArchitectureException.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2011 Gabriel Takeuchi 3 | * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 4 | * Copyright (c) 2006-2007 UBION Inc. 5 | * 6 | * Copyright (c) 2006-2007 Skype Technologies S.A. 7 | * 8 | * Skype4Java is licensed under either the Apache License, Version 2.0 or 9 | * the Eclipse Public License v1.0. 10 | * You may use it freely in commercial and non-commercial products. 11 | * You may obtain a copy of the licenses at 12 | * 13 | * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 14 | * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 15 | * 16 | * If it is possible to cooperate with the publicity of Skype4Java, please add 17 | * links to the Skype4Java web site 18 | * in your web site or documents. 19 | * 20 | * Contributors: 21 | * Gabriel Takeuchi - Improvements under mac os 22 | ******************************************************************************/ 23 | package com.skype.connector; 24 | 25 | @SuppressWarnings("serial") 26 | public class UnsupportedArchitectureException extends RuntimeException { 27 | 28 | public UnsupportedArchitectureException(String msg) { 29 | super(msg); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/skype/connector/linux/SkypeFrameworkListener.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 3 | * Copyright (c) 2006-2007 UBION Inc. 4 | * 5 | * Copyright (c) 2006-2007 Skype Technologies S.A. 6 | * 7 | * Skype4Java is licensed under either the Apache License, Version 2.0 or 8 | * the Eclipse Public License v1.0. 9 | * You may use it freely in commercial and non-commercial products. 10 | * You may obtain a copy of the licenses at 11 | * 12 | * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 13 | * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 14 | * 15 | * If it is possible to cooperate with the publicity of Skype4Java, please add 16 | * links to the Skype4Java web site 17 | * in your web site or documents. 18 | * 19 | * Contributors: 20 | * Koji Hisano - initial API and implementation 21 | ******************************************************************************/ 22 | package com.skype.connector.linux; 23 | 24 | import java.util.EventListener; 25 | 26 | interface SkypeFrameworkListener extends EventListener { 27 | void notificationReceived(String notification); 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/skype/connector/linux/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Provides the connector for Linux 3 | */ 4 | package com.skype.connector.linux; 5 | -------------------------------------------------------------------------------- /src/main/java/com/skype/connector/osx/AbstractSkypeFrameworkListener.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 3 | * Copyright (c) 2006-2007 UBION Inc. 4 | * 5 | * Copyright (c) 2006-2007 Skype Technologies S.A. 6 | * 7 | * Skype4Java is licensed under either the Apache License, Version 2.0 or 8 | * the Eclipse Public License v1.0. 9 | * You may use it freely in commercial and non-commercial products. 10 | * You may obtain a copy of the licenses at 11 | * 12 | * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 13 | * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 14 | * 15 | * If it is possible to cooperate with the publicity of Skype4Java, please add 16 | * links to the Skype4Java web site 17 | * in your web site or documents. 18 | * 19 | * Contributors: 20 | * Koji Hisano - initial API and implementation 21 | ******************************************************************************/ 22 | package com.skype.connector.osx; 23 | 24 | class AbstractSkypeFrameworkListener implements SkypeFrameworkListener { 25 | public void attachResponse(int attachResponseCode) { 26 | } 27 | 28 | public void becameAvailable() { 29 | } 30 | 31 | public void becameUnavailable() { 32 | } 33 | 34 | public void notificationReceived(String notificationString) { 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/skype/connector/osx/SkypeFrameworkListener.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 3 | * Copyright (c) 2006-2007 UBION Inc. 4 | * 5 | * Copyright (c) 2006-2007 Skype Technologies S.A. 6 | * 7 | * Skype4Java is licensed under either the Apache License, Version 2.0 or 8 | * the Eclipse Public License v1.0. 9 | * You may use it freely in commercial and non-commercial products. 10 | * You may obtain a copy of the licenses at 11 | * 12 | * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 13 | * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 14 | * 15 | * If it is possible to cooperate with the publicity of Skype4Java, please add 16 | * links to the Skype4Java web site 17 | * in your web site or documents. 18 | * 19 | * Contributors: 20 | * Koji Hisano - initial API and implementation 21 | ******************************************************************************/ 22 | package com.skype.connector.osx; 23 | 24 | import java.util.EventListener; 25 | 26 | interface SkypeFrameworkListener extends EventListener { 27 | void becameAvailable(); 28 | void becameUnavailable(); 29 | void attachResponse(int attachResponseCode); 30 | void notificationReceived(String notificationString); 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/skype/connector/osx/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Provides the connector for Max OS X 3 | */ 4 | package com.skype.connector.osx; 5 | -------------------------------------------------------------------------------- /src/main/java/com/skype/connector/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Provides the classes for the connector 3 | */ 4 | package com.skype.connector; 5 | -------------------------------------------------------------------------------- /src/main/java/com/skype/connector/win32/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Provides the connector for Windows by JNI 3 | */ 4 | package com.skype.connector.win32; 5 | -------------------------------------------------------------------------------- /src/main/java/com/skype/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | <#if locale="ja"> 3 | *

4 | * Skype4Javaのアプリケーションレベルのクラスを提供します。 5 | *

6 | * 最も重要なクラスは、Skypeの情報モデルを表す{@link com.skype.Skype}とユーザインターフェイスを表す{@link com.skype.SkypeClient}です。 7 | *

8 | * Skype4JavaでサポートされていないSkype APIの機能はコネクタレベルのクラスを用いて追加できます。 9 | *

10 | <#else> 11 | * Provides the classes for Skype API 12 | 13 | */ 14 | package com.skype; 15 | -------------------------------------------------------------------------------- /src/main/resources/Skype.Framework: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taksan/skype-java-api/e7007433f851c1d233b7f7b53abfc031cc271ecd/src/main/resources/Skype.Framework -------------------------------------------------------------------------------- /src/main/resources/libskype.jnilib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taksan/skype-java-api/e7007433f851c1d233b7f7b53abfc031cc271ecd/src/main/resources/libskype.jnilib -------------------------------------------------------------------------------- /src/main/resources/libskype_dbus_x64.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taksan/skype-java-api/e7007433f851c1d233b7f7b53abfc031cc271ecd/src/main/resources/libskype_dbus_x64.so -------------------------------------------------------------------------------- /src/main/resources/libskype_dbus_x86.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taksan/skype-java-api/e7007433f851c1d233b7f7b53abfc031cc271ecd/src/main/resources/libskype_dbus_x86.so -------------------------------------------------------------------------------- /src/main/resources/libskype_x11_x64.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taksan/skype-java-api/e7007433f851c1d233b7f7b53abfc031cc271ecd/src/main/resources/libskype_x11_x64.so -------------------------------------------------------------------------------- /src/main/resources/libskype_x11_x86.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taksan/skype-java-api/e7007433f851c1d233b7f7b53abfc031cc271ecd/src/main/resources/libskype_x11_x86.so -------------------------------------------------------------------------------- /src/main/resources/skype_amd64.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taksan/skype-java-api/e7007433f851c1d233b7f7b53abfc031cc271ecd/src/main/resources/skype_amd64.dll -------------------------------------------------------------------------------- /src/main/resources/skype_x86.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taksan/skype-java-api/e7007433f851c1d233b7f7b53abfc031cc271ecd/src/main/resources/skype_x86.dll -------------------------------------------------------------------------------- /src/test/java/com/skype/.cvsignore: -------------------------------------------------------------------------------- 1 | FriendAPITest.properties 2 | ProfileAPITest.properties 3 | TestData.properties 4 | Main.java 5 | -------------------------------------------------------------------------------- /src/test/java/com/skype/AutoAp2ApAPITest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 3 | * Copyright (c) 2006-2007 UBION Inc. 4 | * 5 | * Copyright (c) 2006-2007 Skype Technologies S.A. 6 | * 7 | * Skype4Java is licensed under either the Apache License, Version 2.0 or 8 | * the Eclipse Public License v1.0. 9 | * You may use it freely in commercial and non-commercial products. 10 | * You may obtain a copy of the licenses at 11 | * 12 | * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 13 | * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 14 | * 15 | * If it is possible to cooperate with the publicity of Skype4Java, please add 16 | * links to the Skype4Java web site 17 | * in your web site or documents. 18 | * 19 | * Contributors: 20 | * Koji Hisano - initial API and implementation 21 | * Gabriel Takeuchi - Ignored non working tests, fixed some, removed warnings 22 | ******************************************************************************/ 23 | package com.skype; 24 | 25 | import org.junit.Ignore; 26 | import org.junit.Test; 27 | 28 | @Ignore 29 | public class AutoAp2ApAPITest { 30 | 31 | @Test 32 | public void testRecreatingApplication() throws Exception { 33 | String APPLICATION_NAME = "test"; 34 | Application application = Skype.addApplication(APPLICATION_NAME); 35 | application.finish(); 36 | application = Skype.addApplication(APPLICATION_NAME); 37 | application.finish(); 38 | } 39 | 40 | @Test 41 | public void testDoubleConnecting() throws Exception { 42 | Application application = Skype.addApplication("test"); 43 | Stream[] streams = application.connect("echo123"); 44 | streams[0].write("TEST"); 45 | application.finish(); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/test/java/com/skype/AutoCallAPITest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 3 | * Copyright (c) 2006-2007 UBION Inc. 4 | * 5 | * Copyright (c) 2006-2007 Skype Technologies S.A. 6 | * 7 | * Skype4Java is licensed under either the Apache License, Version 2.0 or 8 | * the Eclipse Public License v1.0. 9 | * You may use it freely in commercial and non-commercial products. 10 | * You may obtain a copy of the licenses at 11 | * 12 | * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 13 | * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 14 | * 15 | * If it is possible to cooperate with the publicity of Skype4Java, please add 16 | * links to the Skype4Java web site 17 | * in your web site or documents. 18 | * 19 | * Contributors: 20 | * Koji Hisano - initial API and implementation 21 | * Gabriel Takeuchi - Ignored non working tests, fixed some, removed warnings 22 | ******************************************************************************/ 23 | package com.skype; 24 | 25 | import com.skype.Call.DTMF; 26 | import com.skype.connector.test.TestCaseByCSVFile; 27 | 28 | public class AutoCallAPITest extends TestCaseByCSVFile { 29 | @Override 30 | protected void setUp() throws Exception { 31 | setRecordingMode(false); 32 | } 33 | 34 | public void testSendDTMF() throws Exception { 35 | Thread.sleep(2000); 36 | Call call = Skype.call("echo123"); 37 | for (DTMF command: DTMF.values()) { 38 | call.send(command); 39 | } 40 | call.finish(); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/test/java/com/skype/AutoMainWindowStateTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 3 | * Copyright (c) 2006-2007 UBION Inc. 4 | * 5 | * Copyright (c) 2006-2007 Skype Technologies S.A. 6 | * 7 | * Skype4Java is licensed under either the Apache License, Version 2.0 or 8 | * the Eclipse Public License v1.0. 9 | * You may use it freely in commercial and non-commercial products. 10 | * You may obtain a copy of the licenses at 11 | * 12 | * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 13 | * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 14 | * 15 | * If it is possible to cooperate with the publicity of Skype4Java, please add 16 | * links to the Skype4Java web site 17 | * in your web site or documents. 18 | * 19 | * Contributors: 20 | * Koji Hisano - initial API and implementation 21 | * Gabriel Takeuchi - Ignored non working tests, fixed some, removed warnings 22 | ******************************************************************************/ 23 | package com.skype; 24 | 25 | import com.skype.SkypeClient.WindowState; 26 | import com.skype.connector.test.TestCaseByCSVFile; 27 | 28 | public class AutoMainWindowStateTest extends TestCaseByCSVFile { 29 | @Override 30 | protected void setUp() throws Exception { 31 | setRecordingMode(false); 32 | } 33 | 34 | public void testBasic() throws Exception { 35 | SkypeClient.setMainWindowState(WindowState.MAXIMIZED); 36 | assertEquals(WindowState.MAXIMIZED, SkypeClient.getMainWindowState()); 37 | Thread.sleep(1000); 38 | SkypeClient.setMainWindowState(WindowState.MINIMIZED); 39 | assertEquals(WindowState.MINIMIZED, SkypeClient.getMainWindowState()); 40 | Thread.sleep(1000); 41 | SkypeClient.setMainWindowState(WindowState.NORMAL); 42 | assertEquals(WindowState.NORMAL, SkypeClient.getMainWindowState()); 43 | Thread.sleep(1000); 44 | SkypeClient.setMainWindowState(WindowState.HIDDEN); 45 | assertEquals(WindowState.HIDDEN, SkypeClient.getMainWindowState()); 46 | Thread.sleep(1000); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/test/java/com/skype/AutoSkypeAPITest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 3 | * Copyright (c) 2006-2007 UBION Inc. 4 | * 5 | * Copyright (c) 2006-2007 Skype Technologies S.A. 6 | * 7 | * Skype4Java is licensed under either the Apache License, Version 2.0 or 8 | * the Eclipse Public License v1.0. 9 | * You may use it freely in commercial and non-commercial products. 10 | * You may obtain a copy of the licenses at 11 | * 12 | * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 13 | * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 14 | * 15 | * If it is possible to cooperate with the publicity of Skype4Java, please add 16 | * links to the Skype4Java web site 17 | * in your web site or documents. 18 | * 19 | * Contributors: 20 | * Koji Hisano - initial API and implementation 21 | * Gabriel Takeuchi - Ignored non working tests, fixed some, removed warnings 22 | ******************************************************************************/ 23 | package com.skype; 24 | 25 | import org.junit.Ignore; 26 | 27 | import com.skype.connector.test.TestCaseByCSVFile; 28 | 29 | @Ignore 30 | public class AutoSkypeAPITest extends TestCaseByCSVFile { 31 | @Override 32 | protected void setUp() throws Exception { 33 | setRecordingMode(false); 34 | } 35 | 36 | public void testSetSilentMode() throws Exception { 37 | User[] users = Skype.searchUsers("test"); 38 | if (isRecordingMode()) { 39 | System.out.println(users.length); 40 | } else { 41 | assertEquals(89, users.length); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/test/java/com/skype/AutoSkypeClientAPITest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 3 | * Copyright (c) 2006-2007 UBION Inc. 4 | * 5 | * Copyright (c) 2006-2007 Skype Technologies S.A. 6 | * 7 | * Skype4Java is licensed under either the Apache License, Version 2.0 or 8 | * the Eclipse Public License v1.0. 9 | * You may use it freely in commercial and non-commercial products. 10 | * You may obtain a copy of the licenses at 11 | * 12 | * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 13 | * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 14 | * 15 | * If it is possible to cooperate with the publicity of Skype4Java, please add 16 | * links to the Skype4Java web site 17 | * in your web site or documents. 18 | * 19 | * Contributors: 20 | * Koji Hisano - initial API and implementation 21 | * Gabriel Takeuchi - Ignored non working tests, fixed some, removed warnings 22 | ******************************************************************************/ 23 | package com.skype; 24 | 25 | import com.skype.connector.test.TestCaseByCSVFile; 26 | 27 | public class AutoSkypeClientAPITest extends TestCaseByCSVFile { 28 | @Override 29 | protected void setUp() throws Exception { 30 | setRecordingMode(false); 31 | } 32 | 33 | public void test() { 34 | 35 | } 36 | 37 | public void ignore_testSetSilentMode() throws Exception { 38 | SkypeClient.setSilentMode(true); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/test/java/com/skype/CallForwardingTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 3 | * Copyright (c) 2006-2007 UBION Inc. 4 | * 5 | * Copyright (c) 2006-2007 Skype Technologies S.A. 6 | * 7 | * Skype4Java is licensed under either the Apache License, Version 2.0 or 8 | * the Eclipse Public License v1.0. 9 | * You may use it freely in commercial and non-commercial products. 10 | * You may obtain a copy of the licenses at 11 | * 12 | * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 13 | * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 14 | * 15 | * If it is possible to cooperate with the publicity of Skype4Java, please add 16 | * links to the Skype4Java web site 17 | * in your web site or documents. 18 | * 19 | * Contributors: Koji Hisano - initial API and implementation 20 | * Gabriel Takeuchi - Ignored non working tests, fixed some, removed warnings 21 | ******************************************************************************/ 22 | package com.skype; 23 | 24 | import org.junit.Ignore; 25 | import org.junit.Test; 26 | 27 | import com.skype.Profile.CallForwardingRule; 28 | import com.skype.Profile.Status; 29 | 30 | @Ignore 31 | public class CallForwardingTest { 32 | @Test 33 | public void testSetCallForwarding() throws Exception { 34 | Skype.setDaemon(true); 35 | Skype.setDebug(true); 36 | Skype.getProfile().setStatus(Status.OFFLINE); 37 | // CallForwardingRule[] oldCallForwardingRules = 38 | // Skype.getProfile().getAllCallForwardingRules(); 39 | // boolean oldCallForwarding = Skype.getProfile().isCallForwarding(); 40 | Skype.getProfile().setAllCallForwardingRules(new CallForwardingRule[] { new CallForwardingRule(0, 30, "+819018875000") }); 41 | Skype.getProfile().setCallForwarding(true); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/test/java/com/skype/CallListenerTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 3 | * Copyright (c) 2006-2007 UBION Inc. 4 | * 5 | * Copyright (c) 2006-2007 Skype Technologies S.A. 6 | * 7 | * Skype4Java is licensed under either the Apache License, Version 2.0 or 8 | * the Eclipse Public License v1.0. 9 | * You may use it freely in commercial and non-commercial products. 10 | * You may obtain a copy of the licenses at 11 | * 12 | * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 13 | * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 14 | * 15 | * If it is possible to cooperate with the publicity of Skype4Java, please add 16 | * links to the Skype4Java web site 17 | * in your web site or documents. 18 | * 19 | * Contributors: 20 | * Koji Hisano - initial API and implementation 21 | * Gabriel Takeuchi - Ignored non working tests, fixed some, removed warnings 22 | ******************************************************************************/ 23 | package com.skype; 24 | 25 | import org.junit.Assert; 26 | import org.junit.Ignore; 27 | import org.junit.Test; 28 | 29 | // non automatic test 30 | @Ignore 31 | public class CallListenerTest { 32 | @Test 33 | public void testBasic() throws Exception { 34 | final boolean[] maked = new boolean[1]; 35 | Skype.addCallListener(new CallAdapter() { 36 | @Override 37 | public void callMaked(Call makedCall) throws SkypeException { 38 | maked[0] = true; 39 | Skype.removeCallListener(this); 40 | } 41 | }); 42 | TestUtils.showMessageDialog("Please, make a call to " + TestData.getFriendId() + " and finish."); 43 | Assert.assertTrue(maked[0]); 44 | 45 | final boolean[] received = new boolean[1]; 46 | Skype.addCallListener(new CallAdapter() { 47 | @Override 48 | public void callReceived(Call receivedCall) throws SkypeException { 49 | received[0] = true; 50 | Skype.removeCallListener(this); 51 | } 52 | }); 53 | TestUtils.showMessageDialog("Please, receive a call from " + TestData.getFriendId() + " and finish."); 54 | Assert.assertTrue(received[0]); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/test/java/com/skype/CallStatusChangedListenerTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 3 | * Copyright (c) 2006-2007 UBION Inc. 4 | * 5 | * Copyright (c) 2006-2007 Skype Technologies S.A. 6 | * 7 | * Skype4Java is licensed under either the Apache License, Version 2.0 or 8 | * the Eclipse Public License v1.0. 9 | * You may use it freely in commercial and non-commercial products. 10 | * You may obtain a copy of the licenses at 11 | * 12 | * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 13 | * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 14 | * 15 | * If it is possible to cooperate with the publicity of Skype4Java, please add 16 | * links to the Skype4Java web site 17 | * in your web site or documents. 18 | * 19 | * Contributors: 20 | * Koji Hisano - initial API and implementation 21 | * Gabriel Takeuchi - Ignored non working tests, fixed some, removed warnings 22 | ******************************************************************************/ 23 | package com.skype; 24 | 25 | import org.junit.Assert; 26 | import org.junit.Ignore; 27 | import org.junit.Test; 28 | 29 | import com.skype.Call.Status; 30 | 31 | @Ignore 32 | public class CallStatusChangedListenerTest { 33 | @Test 34 | public void testBasic() throws Exception { 35 | final StringBuffer statuses = new StringBuffer(); 36 | Skype.addCallListener(new CallAdapter() { 37 | @Override 38 | public void callMaked(Call makedCall) throws SkypeException { 39 | makedCall.addCallStatusChangedListener(new CallStatusChangedListener() { 40 | public void statusChanged(Status status) throws SkypeException { 41 | statuses.append("[" + status + "]"); 42 | } 43 | }); 44 | } 45 | }); 46 | TestUtils.showMessageDialog("Please, make a call to " + TestData.getFriendId() + " and finish."); 47 | Assert.assertEquals("[RINGING][CANCELLED]", statuses.toString()); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/test/java/com/skype/ChatAPITest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 3 | * Copyright (c) 2006-2007 UBION Inc. 4 | * 5 | * Copyright (c) 2006-2007 Skype Technologies S.A. 6 | * 7 | * Skype4Java is licensed under either the Apache License, Version 2.0 or 8 | * the Eclipse Public License v1.0. 9 | * You may use it freely in commercial and non-commercial products. 10 | * You may obtain a copy of the licenses at 11 | * 12 | * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 13 | * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 14 | * 15 | * If it is possible to cooperate with the publicity of Skype4Java, please add 16 | * links to the Skype4Java web site 17 | * in your web site or documents. 18 | * 19 | * Contributors: Koji Hisano - initial API and implementation 20 | * Gabriel Takeuchi - Ignored non working tests, fixed some, removed warnings 21 | ******************************************************************************/ 22 | package com.skype; 23 | 24 | import org.junit.Assert; 25 | import org.junit.Ignore; 26 | 27 | // non automatic test 28 | @Ignore 29 | public class ChatAPITest { 30 | public void testChat() throws Exception { 31 | Friend friend = TestData.getFriend(); 32 | Chat chat = friend.chat(); 33 | 34 | long time = chat.getTime().getTime(); 35 | Assert.assertTrue(0 <= time && time <= System.currentTimeMillis()); 36 | Assert.assertNull(chat.getAdder()); 37 | Assert.assertTrue(chat.getStatus().equals(Chat.Status.DIALOG)); 38 | Assert.assertTrue(0 < chat.getWindowTitle().length()); 39 | Assert.assertEquals(0, chat.getAllPosters().length); 40 | Assert.assertEquals(2, chat.getAllMembers().length); 41 | 42 | chat.send("Test Message"); 43 | TestUtils.showCheckDialog(TestData.getFriendId() + " has received \"Test Message\""); 44 | chat.setTopic("New Topic"); 45 | TestUtils.showCheckDialog("Topic was changed to \"New Topic\""); 46 | Friend friend2 = TestData.getFriend2(); 47 | chat.addUser(friend2); 48 | Assert.assertEquals(1, chat.getAllPosters().length); 49 | Assert.assertEquals(3, chat.getAllMembers().length); 50 | TestUtils.showCheckDialog(friend2.getId() + " was added to this chat"); 51 | chat.leave(); 52 | Assert.assertEquals(2, chat.getAllMembers().length); 53 | TestUtils.showCheckDialog("You have left from this chat"); 54 | Assert.assertTrue(0 < chat.getAllChatMessages().length); 55 | Assert.assertTrue(0 < chat.getRecentChatMessages().length); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/test/java/com/skype/ChatMessageEditConnectorListenerTest.java: -------------------------------------------------------------------------------- 1 | package com.skype; 2 | 3 | import static org.junit.Assert.assertEquals; 4 | 5 | import java.util.Date; 6 | import java.util.concurrent.atomic.AtomicReference; 7 | 8 | import org.junit.Test; 9 | 10 | public class ChatMessageEditConnectorListenerTest { 11 | 12 | @Test 13 | public void onProcessMessage_ShouldTriggerListenerEventIfEditSequenceIsMet() 14 | { 15 | ChatMessageEditConnectorListener subject = new ChatMessageEditConnectorListener(); 16 | final AtomicReference actualWhen = new AtomicReference(); 17 | final AtomicReference actualWho = new AtomicReference() ; 18 | final AtomicReference actualEdited = new AtomicReference(); 19 | subject.addListener(new ChatMessageEditListener() { 20 | @Override 21 | public void chatMessageEdited(ChatMessage editedMessage, Date when, User who) { 22 | actualWhen.set(when); 23 | actualWho.set(who); 24 | actualEdited.set(editedMessage); 25 | } 26 | }); 27 | 28 | subject.processMessage("CHATMESSAGE 1045193 EDITED_TIMESTAMP 1340851521"); 29 | subject.processMessage("CHATMESSAGE 1045193 EDITED_BY anhanga.tinhoso"); 30 | subject.processMessage("CHATMESSAGE 1045192 EDITED_TIMESTAMP 1340851521"); 31 | subject.processMessage("CHATMESSAGE 1045192 EDITED_BY manhoso"); 32 | subject.processMessage("CHATMESSAGE 1045193 BODY dude not good"); 33 | 34 | Date expected = new Date(1340851521); 35 | User user = User.getInstance("anhanga.tinhoso"); 36 | assertEquals(expected, actualWhen.get()); 37 | assertEquals(user.getId(), actualWho.get().getId()); 38 | assertEquals("1045193", actualEdited.get().getId()); 39 | } 40 | } -------------------------------------------------------------------------------- /src/test/java/com/skype/ChatMessageListenerTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 3 | * Copyright (c) 2006-2007 UBION Inc. 4 | * 5 | * Copyright (c) 2006-2007 Skype Technologies S.A. 6 | * 7 | * Skype4Java is licensed under either the Apache License, Version 2.0 or 8 | * the Eclipse Public License v1.0. 9 | * You may use it freely in commercial and non-commercial products. 10 | * You may obtain a copy of the licenses at 11 | * 12 | * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 13 | * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 14 | * 15 | * If it is possible to cooperate with the publicity of Skype4Java, please add 16 | * links to the Skype4Java web site 17 | * in your web site or documents. 18 | * 19 | * Contributors: Koji Hisano - initial API and implementation 20 | * Gabriel Takeuchi - Ignored non working tests, fixed some, removed warnings 21 | ******************************************************************************/ 22 | package com.skype; 23 | 24 | import org.junit.Assert; 25 | import org.junit.Ignore; 26 | import org.junit.Test; 27 | 28 | @Ignore 29 | public class ChatMessageListenerTest { 30 | @Test 31 | public void testBasic() throws Exception { 32 | final boolean[] sent = new boolean[1]; 33 | Skype.addChatMessageListener(new ChatMessageAdapter() { 34 | @Override 35 | public void chatMessageSent(ChatMessage sentChatMessage) throws SkypeException { 36 | sent[0] = true; 37 | Skype.removeChatMessageListener(this); 38 | } 39 | }); 40 | TestUtils.showMessageDialog("Please, send a chat message to " + TestData.getFriendId() + "."); 41 | Assert.assertTrue(sent[0]); 42 | 43 | final boolean[] received = new boolean[1]; 44 | Skype.addChatMessageListener(new ChatMessageAdapter() { 45 | @Override 46 | public void chatMessageReceived(ChatMessage receivedChatMessage) throws SkypeException { 47 | received[0] = true; 48 | Skype.removeChatMessageListener(this); 49 | } 50 | }); 51 | TestUtils.showMessageDialog("Please, receive a chat message from " + TestData.getFriendId() + "."); 52 | Assert.assertTrue(received[0]); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/test/java/com/skype/CountryIsoByCountryNameTest.java: -------------------------------------------------------------------------------- 1 | package com.skype; 2 | 3 | import static org.junit.Assert.assertEquals; 4 | 5 | import org.junit.Test; 6 | 7 | public class CountryIsoByCountryNameTest { 8 | @Test 9 | public void onGetIsoForCountry_ShouldReturnCountryIso() 10 | { 11 | String actual = CountryIsoByCountryName.getIsoForCountry("Russia"); 12 | assertEquals("ru", actual); 13 | } 14 | } -------------------------------------------------------------------------------- /src/test/java/com/skype/GroupAPITest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 3 | * Copyright (c) 2006-2007 UBION Inc. 4 | * 5 | * Copyright (c) 2006-2007 Skype Technologies S.A. 6 | * 7 | * Skype4Java is licensed under either the Apache License, Version 2.0 or 8 | * the Eclipse Public License v1.0. 9 | * You may use it freely in commercial and non-commercial products. 10 | * You may obtain a copy of the licenses at 11 | * 12 | * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 13 | * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 14 | * 15 | * If it is possible to cooperate with the publicity of Skype4Java, please add 16 | * links to the Skype4Java web site 17 | * in your web site or documents. 18 | * 19 | * Contributors: Koji Hisano - initial API and implementation 20 | * Gabriel Takeuchi - Ignored non working tests, fixed some, removed warnings 21 | ******************************************************************************/ 22 | package com.skype; 23 | 24 | import org.junit.Assert; 25 | import org.junit.Ignore; 26 | import org.junit.Test; 27 | 28 | @Ignore 29 | public class GroupAPITest { 30 | 31 | @Test 32 | public void testGetGroup() throws Exception { 33 | TestUtils.showMessageDialog("Please create 'Test' group and add " + TestData.getFriendId() + " to it before closing this dialog."); 34 | Group group = Skype.getContactList().getGroup("Test"); 35 | Assert.assertNotNull(group); 36 | Assert.assertTrue(group.hasFriend(TestData.getFriend())); 37 | } 38 | 39 | @Test 40 | public void testAddAndRemoveGroup() throws Exception { 41 | String addedGroupName = "GroupAPITest"; 42 | Group added = Skype.getContactList().addGroup(addedGroupName); 43 | Assert.assertNotNull(Skype.getContactList().getGroup(addedGroupName)); 44 | Skype.getContactList().removeGroup(added); 45 | Assert.assertNull(Skype.getContactList().getGroup(addedGroupName)); 46 | } 47 | 48 | @Test 49 | public void testAddAndRemoveFriend() throws Exception { 50 | Group addedGroup = Skype.getContactList().addGroup("GroupAPITest"); 51 | Friend addedFriend = TestData.getFriend(); 52 | addedGroup.addFriend(addedFriend); 53 | Assert.assertTrue(addedGroup.hasFriend(addedFriend)); 54 | addedGroup.removeFriend(addedFriend); 55 | Assert.assertFalse(addedGroup.hasFriend(addedFriend)); 56 | Skype.getContactList().removeGroup(addedGroup); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/test/java/com/skype/HistoryAPITest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 3 | * Copyright (c) 2006-2007 UBION Inc. 4 | * 5 | * Copyright (c) 2006-2007 Skype Technologies S.A. 6 | * 7 | * Skype4Java is licensed under either the Apache License, Version 2.0 or 8 | * the Eclipse Public License v1.0. 9 | * You may use it freely in commercial and non-commercial products. 10 | * You may obtain a copy of the licenses at 11 | * 12 | * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 13 | * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 14 | * 15 | * If it is possible to cooperate with the publicity of Skype4Java, please add 16 | * links to the Skype4Java web site 17 | * in your web site or documents. 18 | * 19 | * Contributors: Koji Hisano - initial API and implementation 20 | * Gabriel Takeuchi - Ignored non working tests, fixed some, removed warnings 21 | ******************************************************************************/ 22 | package com.skype; 23 | 24 | import java.util.Date; 25 | 26 | import org.junit.Assert; 27 | import org.junit.Ignore; 28 | import org.junit.Test; 29 | 30 | @Ignore 31 | public class HistoryAPITest { 32 | @Test 33 | public void testGetAllMessages() throws Exception { 34 | TestUtils.showMessageDialog("Please, send a chat message 'Hello, World!' to " + TestData.getFriendId() + "."); 35 | Friend friend = TestData.getFriend(); 36 | ChatMessage[] messages = friend.getAllChatMessages(); 37 | Assert.assertTrue(0 < messages.length); 38 | } 39 | 40 | @Test 41 | public void testGetAllCalls() throws Exception { 42 | TestUtils.showMessageDialog("Please, start a call to " + TestData.getFriendId() + "and finsh it in 10 seconds."); 43 | Friend friend = TestData.getFriend(); 44 | Call[] calls = friend.getAllCalls(); 45 | Assert.assertTrue(0 < calls.length); 46 | Call latest = calls[0]; 47 | Assert.assertEquals(TestData.getFriendId(), latest.getPartnerId()); 48 | Assert.assertEquals(TestData.getFriendDisplayName(), latest.getPartnerDisplayName()); 49 | Assert.assertTrue(new Date().getTime() - 10000 <= latest.getStartTime().getTime()); 50 | Assert.assertEquals(Call.Type.OUTGOING_P2P, latest.getType()); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/test/java/com/skype/PhoneAPITest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 3 | * Copyright (c) 2006-2007 UBION Inc. 4 | * 5 | * Copyright (c) 2006-2007 Skype Technologies S.A. 6 | * 7 | * Skype4Java is licensed under either the Apache License, Version 2.0 or 8 | * the Eclipse Public License v1.0. 9 | * You may use it freely in commercial and non-commercial products. 10 | * You may obtain a copy of the licenses at 11 | * 12 | * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 13 | * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 14 | * 15 | * If it is possible to cooperate with the publicity of Skype4Java, please add 16 | * links to the Skype4Java web site 17 | * in your web site or documents. 18 | * 19 | * Contributors: Koji Hisano - initial API and implementation 20 | * Gabriel Takeuchi - Ignored non working tests, fixed some, removed warnings 21 | ******************************************************************************/ 22 | package com.skype; 23 | 24 | import org.junit.Assert; 25 | import org.junit.Ignore; 26 | import org.junit.Test; 27 | 28 | // not supported on linux 29 | @Ignore 30 | public final class PhoneAPITest { 31 | @Test 32 | public void testAudioInputDevice() throws Exception { 33 | String device = Skype.getAudioInputDevice(); 34 | Skype.setAudioInputDevice(null); 35 | Assert.assertNull(Skype.getAudioInputDevice()); 36 | Skype.setAudioInputDevice(device); 37 | Assert.assertEquals(device, Skype.getAudioInputDevice()); 38 | } 39 | 40 | @Test 41 | public void testAudioOutputDevice() throws Exception { 42 | String device = Skype.getAudioOutputDevice(); 43 | Skype.setAudioOutputDevice(null); 44 | Assert.assertNull(Skype.getAudioOutputDevice()); 45 | Skype.setAudioOutputDevice(device); 46 | Assert.assertEquals(device, Skype.getAudioOutputDevice()); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/test/java/com/skype/SMSTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 3 | * Copyright (c) 2006-2007 UBION Inc. 4 | * 5 | * Copyright (c) 2006-2007 Skype Technologies S.A. 6 | * 7 | * Skype4Java is licensed under either the Apache License, Version 2.0 or 8 | * the Eclipse Public License v1.0. 9 | * You may use it freely in commercial and non-commercial products. 10 | * You may obtain a copy of the licenses at 11 | * 12 | * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 13 | * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 14 | * 15 | * If it is possible to cooperate with the publicity of Skype4Java, please add 16 | * links to the Skype4Java web site 17 | * in your web site or documents. 18 | * 19 | * Contributors: 20 | * Koji Hisano - initial API and implementation 21 | * Gabriel Takeuchi - Ignored non working tests, fixed some, removed warnings 22 | ******************************************************************************/ 23 | package com.skype; 24 | 25 | import org.junit.Assert; 26 | import org.junit.Ignore; 27 | import org.junit.Test; 28 | 29 | @Ignore 30 | public final class SMSTest { 31 | @Test 32 | public void testSendSMS() throws SkypeException { 33 | SMS message = Skype.sendSMS(TestData.getSMSNumber(), "test"); 34 | Assert.assertEquals("test", message.getContent()); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/test/java/com/skype/SkypeObjectTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 3 | * Copyright (c) 2006-2007 UBION Inc. 4 | * 5 | * Copyright (c) 2006-2007 Skype Technologies S.A. 6 | * 7 | * Skype4Java is licensed under either the Apache License, Version 2.0 or 8 | * the Eclipse Public License v1.0. 9 | * You may use it freely in commercial and non-commercial products. 10 | * You may obtain a copy of the licenses at 11 | * 12 | * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 13 | * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 14 | * 15 | * If it is possible to cooperate with the publicity of Skype4Java, please add 16 | * links to the Skype4Java web site 17 | * in your web site or documents. 18 | * 19 | * Contributors: 20 | * Koji Hisano - initial API and implementation 21 | * Gabriel Takeuchi - Ignored non working tests, fixed some, removed warnings 22 | ******************************************************************************/ 23 | package com.skype; 24 | 25 | import org.junit.Assert; 26 | import org.junit.Ignore; 27 | import org.junit.Test; 28 | 29 | @Ignore 30 | public class SkypeObjectTest { 31 | @Test 32 | public void testBasic() throws Exception { 33 | String name = "name"; 34 | Object userData = new Object(); 35 | TestData.getFriend().setData(name, userData); 36 | Assert.assertEquals(userData, TestData.getFriend().getData(name)); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/test/java/com/skype/SkypeTest.java: -------------------------------------------------------------------------------- 1 | package com.skype; 2 | 3 | import junit.framework.Assert; 4 | 5 | import org.junit.After; 6 | import org.junit.Test; 7 | 8 | import com.skype.mocks.ConnectorMock; 9 | 10 | public class SkypeTest { 11 | @Test 12 | public void addListener_ShouldNotAddListenerIfExceptionIsThrown() throws SkypeException 13 | { 14 | Skype.setReplacementConnectorInstance(new ConnectorMock()); 15 | 16 | CallListener mockListener = createMockListener(); 17 | 18 | try { 19 | Skype.addCallListener(mockListener); 20 | Assert.fail("An exception was expected"); 21 | }catch(Exception e) { 22 | Assert.assertFalse(Skype.isCallListenerRegistered(mockListener)); 23 | } 24 | } 25 | 26 | private CallListener createMockListener() { 27 | return new CallListener() { 28 | 29 | @Override 30 | public void callReceived(Call receivedCall) throws SkypeException { 31 | } 32 | 33 | @Override 34 | public void callMaked(Call makedCall) throws SkypeException { 35 | } 36 | }; 37 | } 38 | 39 | @After 40 | public void tearDown() { 41 | Skype.setReplacementConnectorInstance(null); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/test/java/com/skype/SystemTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 3 | * Copyright (c) 2006-2007 UBION Inc. 4 | * 5 | * Copyright (c) 2006-2007 Skype Technologies S.A. 6 | * 7 | * Skype4Java is licensed under either the Apache License, Version 2.0 or 8 | * the Eclipse Public License v1.0. 9 | * You may use it freely in commercial and non-commercial products. 10 | * You may obtain a copy of the licenses at 11 | * 12 | * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 13 | * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 14 | * 15 | * If it is possible to cooperate with the publicity of Skype4Java, please add 16 | * links to the Skype4Java web site 17 | * in your web site or documents. 18 | * 19 | * Contributors: Koji Hisano - initial API and implementation 20 | * Gabriel Takeuchi - Ignored non working tests, fixed some, removed warnings 21 | ******************************************************************************/ 22 | package com.skype; 23 | 24 | import org.junit.Assert; 25 | import org.junit.Ignore; 26 | import org.junit.Test; 27 | 28 | @Ignore 29 | public class SystemTest { 30 | @Test 31 | public void testIsInstalled() throws Exception { 32 | Assert.assertTrue(Skype.isInstalled()); 33 | } 34 | 35 | @Test 36 | public void testIsRunning() throws Exception { 37 | Assert.assertTrue(Skype.isRunning()); 38 | } 39 | 40 | @Test 41 | public void testGetVersion() throws Exception { 42 | String version = Skype.getVersion(); 43 | Assert.assertNotNull(version); 44 | Assert.assertTrue(!"".equals(version)); 45 | } 46 | } -------------------------------------------------------------------------------- /src/test/java/com/skype/TestCaseProperties.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 3 | * Copyright (c) 2006-2007 UBION Inc. 4 | * 5 | * Copyright (c) 2006-2007 Skype Technologies S.A. 6 | * 7 | * Skype4Java is licensed under either the Apache License, Version 2.0 or 8 | * the Eclipse Public License v1.0. 9 | * You may use it freely in commercial and non-commercial products. 10 | * You may obtain a copy of the licenses at 11 | * 12 | * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 13 | * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 14 | * 15 | * If it is possible to cooperate with the publicity of Skype4Java, please add 16 | * links to the Skype4Java web site 17 | * in your web site or documents. 18 | * 19 | * Contributors: Koji Hisano - initial API and implementation 20 | * Gabriel Takeuchi - Ignored non working tests, fixed some, removed warnings 21 | ******************************************************************************/ 22 | package com.skype; 23 | 24 | import java.util.Properties; 25 | 26 | import org.junit.Ignore; 27 | 28 | import junit.framework.Assert; 29 | 30 | @Ignore 31 | @SuppressWarnings("rawtypes") 32 | final class TestCaseProperties { 33 | private final Class testCaseClass; 34 | 35 | private Properties properties; 36 | 37 | TestCaseProperties(Class testCaseClass) { 38 | this.testCaseClass = testCaseClass; 39 | properties = new Properties(); 40 | try { 41 | properties.load(getClass().getResourceAsStream(getPropertyFileName())); 42 | } catch (Exception e) { 43 | Assert.fail("Please, create '" + getPropertyFileName() + "' file by '" + getPropertyFileName() + ".base' file in the same directory."); 44 | } 45 | } 46 | 47 | private String getPropertyFileName() { 48 | return testCaseClass.getSimpleName() + ".properties"; 49 | } 50 | 51 | String getProperty(String key) { 52 | if (!properties.containsKey(key)) { 53 | throw new IllegalArgumentException("'" + getPropertyFileName() + "' file doesn't have '" + key + "' entry."); 54 | } 55 | return properties.getProperty(key); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/test/java/com/skype/TestData.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 3 | * Copyright (c) 2006-2007 UBION Inc. 4 | * 5 | * Copyright (c) 2006-2007 Skype Technologies S.A. 6 | * 7 | * Skype4Java is licensed under either the Apache License, Version 2.0 or 8 | * the Eclipse Public License v1.0. 9 | * You may use it freely in commercial and non-commercial products. 10 | * You may obtain a copy of the licenses at 11 | * 12 | * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 13 | * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 14 | * 15 | * If it is possible to cooperate with the publicity of Skype4Java, please add 16 | * links to the Skype4Java web site 17 | * in your web site or documents. 18 | * 19 | * Contributors: 20 | * Koji Hisano - initial API and implementation 21 | * Gabriel Takeuchi - Ignored non working tests, fixed some, removed warnings 22 | ******************************************************************************/ 23 | package com.skype; 24 | 25 | import org.junit.Ignore; 26 | 27 | import com.skype.Friend; 28 | import com.skype.Skype; 29 | import com.skype.SkypeException; 30 | 31 | @Ignore 32 | final class TestData { 33 | private static TestCaseProperties data = new TestCaseProperties(TestData.class); 34 | 35 | static Friend getFriend() throws SkypeException { 36 | return Skype.getContactList().getFriend(data.getProperty("id")); 37 | } 38 | 39 | static Friend getFriend2() throws SkypeException { 40 | return Skype.getContactList().getFriend(data.getProperty("id2")); 41 | } 42 | 43 | static String getFriendId() throws SkypeException { 44 | return getFriend().getId(); 45 | } 46 | 47 | static String getFriendDisplayName() throws SkypeException { 48 | return getFriend().getDisplayName(); 49 | } 50 | 51 | static String getSMSNumber() throws SkypeException { 52 | return data.getProperty("smsNumber"); 53 | } 54 | 55 | private TestData() { 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/test/java/com/skype/TestUtils.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 3 | * Copyright (c) 2006-2007 UBION Inc. 4 | * 5 | * Copyright (c) 2006-2007 Skype Technologies S.A. 6 | * 7 | * Skype4Java is licensed under either the Apache License, Version 2.0 or 8 | * the Eclipse Public License v1.0. 9 | * You may use it freely in commercial and non-commercial products. 10 | * You may obtain a copy of the licenses at 11 | * 12 | * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 13 | * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 14 | * 15 | * If it is possible to cooperate with the publicity of Skype4Java, please add 16 | * links to the Skype4Java web site 17 | * in your web site or documents. 18 | * 19 | * Contributors: Koji Hisano - initial API and implementation 20 | * Gabriel Takeuchi - Ignored non working tests, fixed some, removed warnings 21 | ******************************************************************************/ 22 | package com.skype; 23 | 24 | import javax.swing.JDialog; 25 | import javax.swing.JOptionPane; 26 | 27 | import org.junit.Ignore; 28 | 29 | import junit.framework.Assert; 30 | 31 | @Ignore 32 | public final class TestUtils { 33 | public static void showCheckDialog(String message) { 34 | JOptionPane pane = new JOptionPane(message, JOptionPane.QUESTION_MESSAGE, JOptionPane.YES_NO_OPTION); 35 | JDialog dialog = pane.createDialog(null, "Check by the tester"); 36 | dialog.setVisible(true); 37 | int result = ((Integer) pane.getValue()).intValue(); 38 | if (result != JOptionPane.YES_OPTION) { 39 | Assert.fail("\"" + message + "\" -> Failed"); 40 | } 41 | } 42 | 43 | public static void showMessageDialog(String message) { 44 | JOptionPane.showMessageDialog(null, message); 45 | } 46 | 47 | private TestUtils() { 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/test/java/com/skype/VideoAPITest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 3 | * Copyright (c) 2006-2007 UBION Inc. 4 | * 5 | * Copyright (c) 2006-2007 Skype Technologies S.A. 6 | * 7 | * Skype4Java is licensed under either the Apache License, Version 2.0 or 8 | * the Eclipse Public License v1.0. 9 | * You may use it freely in commercial and non-commercial products. 10 | * You may obtain a copy of the licenses at 11 | * 12 | * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 13 | * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 14 | * 15 | * If it is possible to cooperate with the publicity of Skype4Java, please add 16 | * links to the Skype4Java web site 17 | * in your web site or documents. 18 | * 19 | * Contributors: 20 | * Koji Hisano - initial API and implementation 21 | * Gabriel Takeuchi - Ignored non working tests, fixed some, removed warnings 22 | ******************************************************************************/ 23 | package com.skype; 24 | 25 | import org.junit.Ignore; 26 | import org.junit.Test; 27 | 28 | 29 | @Ignore 30 | public class VideoAPITest { 31 | @Test 32 | public void testGetVideoDevice() throws Exception { 33 | String name = Skype.getVideoDevice(); 34 | if (name == null) { 35 | name = "Default video device"; 36 | } 37 | TestUtils.showCheckDialog("Webcam is '" + name + "'?"); 38 | } 39 | @Test 40 | public void testOpenVideoTestWindow() throws Exception { 41 | SkypeClient.openVideoTestWindow(); 42 | TestUtils.showCheckDialog("Webcam test window is showed?"); 43 | TestUtils.showMessageDialog("Please, close the window before the next step."); 44 | } 45 | 46 | @Test 47 | public void testOpenVideoOptionsWindow() throws Exception { 48 | SkypeClient.openVideoOptionsWindow(); 49 | TestUtils.showCheckDialog("Options window with selectiong 'Video' page is showed?"); 50 | TestUtils.showMessageDialog("Please, close the window before the next step."); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/test/java/com/skype/VoiceMailAPITest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 3 | * Copyright (c) 2006-2007 UBION Inc. 4 | * 5 | * Copyright (c) 2006-2007 Skype Technologies S.A. 6 | * 7 | * Skype4Java is licensed under either the Apache License, Version 2.0 or 8 | * the Eclipse Public License v1.0. 9 | * You may use it freely in commercial and non-commercial products. 10 | * You may obtain a copy of the licenses at 11 | * 12 | * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 13 | * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 14 | * 15 | * If it is possible to cooperate with the publicity of Skype4Java, please add 16 | * links to the Skype4Java web site 17 | * in your web site or documents. 18 | * 19 | * Contributors: Koji Hisano - initial API and implementation 20 | * Gabriel Takeuchi - Ignored non working tests, fixed some, removed warnings 21 | ******************************************************************************/ 22 | package com.skype; 23 | 24 | import org.junit.Ignore; 25 | import org.junit.Test; 26 | 27 | @Ignore 28 | public class VoiceMailAPITest { 29 | @Test 30 | public void testLeaveVoiceMail() throws Exception { 31 | TestData.getFriend().voiceMail(); 32 | TestUtils.showCheckDialog(TestData.getFriend().getId() + " has received a voicemail?"); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/test/java/com/skype/connector/AutoPropertyTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 3 | * Copyright (c) 2006-2007 UBION Inc. 4 | * 5 | * Copyright (c) 2006-2007 Skype Technologies S.A. 6 | * 7 | * Skype4Java is licensed under either the Apache License, Version 2.0 or 8 | * the Eclipse Public License v1.0. 9 | * You may use it freely in commercial and non-commercial products. 10 | * You may obtain a copy of the licenses at 11 | * 12 | * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 13 | * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 14 | * 15 | * If it is possible to cooperate with the publicity of Skype4Java, please add 16 | * links to the Skype4Java web site 17 | * in your web site or documents. 18 | * 19 | * Contributors: Koji Hisano - initial API and implementation 20 | * Gabriel Takeuchi - Ignored non working tests, fixed some, removed warnings 21 | ******************************************************************************/ 22 | package com.skype.connector; 23 | 24 | import com.skype.connector.test.TestConnector; 25 | 26 | import junit.framework.TestCase; 27 | 28 | public class AutoPropertyTest extends TestCase { 29 | public void testBasic() throws Exception { 30 | Connector.setInstance(TestConnector.getInstance()); 31 | 32 | Connector connector = Connector.getInstance(); 33 | 34 | final String PROPERTY_NAME = "name"; 35 | final String PROPERTY_VALUE = "value"; 36 | 37 | assertNull(connector.getStringProperty(PROPERTY_NAME)); 38 | 39 | connector.setStringProperty(PROPERTY_NAME, PROPERTY_VALUE); 40 | assertEquals(PROPERTY_VALUE, connector.getStringProperty(PROPERTY_NAME)); 41 | 42 | connector.setStringProperty(PROPERTY_NAME, null); 43 | assertNull(connector.getStringProperty(PROPERTY_NAME)); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/test/java/com/skype/connector/ConnectorTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 3 | * Copyright (c) 2006-2007 UBION Inc. 4 | * 5 | * Copyright (c) 2006-2007 Skype Technologies S.A. 6 | * 7 | * Skype4Java is licensed under either the Apache License, Version 2.0 or 8 | * the Eclipse Public License v1.0. 9 | * You may use it freely in commercial and non-commercial products. 10 | * You may obtain a copy of the licenses at 11 | * 12 | * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 13 | * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 14 | * 15 | * If it is possible to cooperate with the publicity of Skype4Java, please add 16 | * links to the Skype4Java web site 17 | * in your web site or documents. 18 | * 19 | * Contributors: Koji Hisano - initial API and implementation 20 | * Gabriel Takeuchi - Ignored non working tests, fixed some, removed warnings 21 | ******************************************************************************/ 22 | package com.skype.connector; 23 | 24 | import com.skype.connector.test.TestConnector; 25 | 26 | import junit.framework.TestCase; 27 | 28 | public class ConnectorTest extends TestCase { 29 | public void testProperty() throws Exception { 30 | Connector.setInstance(TestConnector.getInstance()); 31 | 32 | Connector connector = Connector.getInstance(); 33 | 34 | final String PROPERTY_NAME = "name"; 35 | final String PROPERTY_VALUE = "value"; 36 | 37 | assertNull(connector.getStringProperty(PROPERTY_NAME)); 38 | 39 | connector.setStringProperty(PROPERTY_NAME, PROPERTY_VALUE); 40 | assertEquals(PROPERTY_VALUE, connector.getStringProperty(PROPERTY_NAME)); 41 | 42 | connector.setStringProperty(PROPERTY_NAME, null); 43 | assertNull(connector.getStringProperty(PROPERTY_NAME)); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/test/java/com/skype/connector/ConnectorUtilsTest.java: -------------------------------------------------------------------------------- 1 | package com.skype.connector; 2 | 3 | import java.io.File; 4 | 5 | import junit.framework.Assert; 6 | 7 | import org.junit.Test; 8 | 9 | import com.skype.connector.win32.Win32Connector; 10 | 11 | public class ConnectorUtilsTest { 12 | @Test 13 | public void getTempDir_ShouldReturnARandomTemporaryDirUnderTempDir() 14 | { 15 | String tempDir = System.getProperty("java.io.tmpdir"); 16 | String actual = ConnectorUtils.getSkypeTempDir(); 17 | 18 | Assert.assertTrue(actual.contains(tempDir)); 19 | Assert.assertFalse(actual.endsWith(tempDir)); 20 | File actualDir = new File(actual); 21 | Assert.assertTrue(actualDir.exists()); 22 | Assert.assertTrue(actualDir.isDirectory()); 23 | 24 | String anotherActual = ConnectorUtils.getSkypeTempDir(); 25 | Assert.assertEquals(actual, anotherActual); 26 | } 27 | 28 | @Test 29 | public void getConnectorInstance_ShouldReturnValidConnector() { 30 | ensureSkypeDirIsCleanBeforeTestingInitialization(); 31 | 32 | if (Connector.getInstance() instanceof Win32Connector) { 33 | class Win32ConnectorToTest extends Win32Connector { 34 | public void runInit() { 35 | initializeImpl(); 36 | } 37 | } 38 | new Win32ConnectorToTest().runInit(); 39 | } 40 | } 41 | 42 | private void ensureSkypeDirIsCleanBeforeTestingInitialization() { 43 | File skypeTempDir = new File(ConnectorUtils.getSkypeTempDir()); 44 | skypeTempDir.delete(); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/test/java/com/skype/connector/osx/OSXConnectorTest.java: -------------------------------------------------------------------------------- 1 | package com.skype.connector.osx; 2 | 3 | import org.junit.Assert; 4 | import org.junit.Test; 5 | 6 | public class OSXConnectorTest { 7 | @Test 8 | public void onFixLegacyMessage_ShouldAddChatPrefix() 9 | { 10 | String actual = OSXConnector.fixLegacyMessage("MESSAGE 1413257 STATUS RECEIVED"); 11 | Assert.assertEquals("CHATMESSAGE 1413257 STATUS RECEIVED", actual); 12 | 13 | actual = OSXConnector.fixLegacyMessage("USER davyjones ONLINESTATUS ONLINE"); 14 | Assert.assertEquals("USER davyjones ONLINESTATUS ONLINE", actual); 15 | 16 | actual = OSXConnector.fixLegacyMessage("#1 MESSAGE 1411049 STATUS RECEIVED"); 17 | Assert.assertEquals("#1 CHATMESSAGE 1411049 STATUS RECEIVED", actual); 18 | } 19 | } -------------------------------------------------------------------------------- /src/test/java/com/skype/connector/osx/SkypeFrameworkTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 3 | * Copyright (c) 2006-2007 UBION Inc. 4 | * 5 | * Copyright (c) 2006-2007 Skype Technologies S.A. 6 | * 7 | * Skype4Java is licensed under either the Apache License, Version 2.0 or 8 | * the Eclipse Public License v1.0. 9 | * You may use it freely in commercial and non-commercial products. 10 | * You may obtain a copy of the licenses at 11 | * 12 | * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 13 | * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 14 | * 15 | * If it is possible to cooperate with the publicity of Skype4Java, please add 16 | * links to the Skype4Java web site 17 | * in your web site or documents. 18 | * 19 | * Contributors: Koji Hisano - initial API and implementation 20 | * Gabriel Takeuchi - Ignored non working tests, fixed some, removed warnings 21 | ******************************************************************************/ 22 | package com.skype.connector.osx; 23 | 24 | import org.junit.Ignore; 25 | 26 | @Ignore 27 | public class SkypeFrameworkTest { 28 | public static void main(String[] args) throws Exception { 29 | SkypeFramework.init("Skype4Java"); 30 | 31 | System.out.println("isRunning: " + SkypeFramework.isRunning()); 32 | System.out.println("isAvabileable: " + SkypeFramework.isAvailable()); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/test/java/com/skype/connector/test/AutoConnectorTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 3 | * Copyright (c) 2006-2007 UBION Inc. 4 | * 5 | * Copyright (c) 2006-2007 Skype Technologies S.A. 6 | * 7 | * Skype4Java is licensed under either the Apache License, Version 2.0 or 8 | * the Eclipse Public License v1.0. 9 | * You may use it freely in commercial and non-commercial products. 10 | * You may obtain a copy of the licenses at 11 | * 12 | * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 13 | * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 14 | * 15 | * If it is possible to cooperate with the publicity of Skype4Java, please add 16 | * links to the Skype4Java web site 17 | * in your web site or documents. 18 | * 19 | * Contributors: Koji Hisano - initial API and implementation 20 | * Gabriel Takeuchi - Ignored non working tests, fixed some, removed warnings 21 | ******************************************************************************/ 22 | package com.skype.connector.test; 23 | 24 | import com.skype.Call; 25 | import com.skype.Skype; 26 | 27 | public final class AutoConnectorTest extends TestCaseByCSVFile { 28 | @Override 29 | protected void setUp() throws Exception { 30 | setRecordingMode(false); 31 | } 32 | 33 | public void testGetVersion() throws Exception { 34 | String result = Skype.getVersion(); 35 | if(isRecordingMode()) { 36 | System.out.println(result); 37 | } else { 38 | assertEquals("2.5.0.130", result); 39 | } 40 | } 41 | 42 | public void testCall() throws Exception { 43 | TestConnector.resetInstance(); 44 | Call call = Skype.getContactList().getFriend("echo123").call(); 45 | Thread.sleep(5000); 46 | call.finish(); 47 | 48 | String result = call.getDuration() + "," + call.getId() + "," + call.getPartnerId() + "," + call.getType(); 49 | if(isRecordingMode()) { 50 | System.out.println(result); 51 | } else { 52 | assertEquals("2,8345,echo123,OUTGOING_P2P", result); 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/test/java/com/skype/connector/test/CSVRecorder.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 3 | * Copyright (c) 2006-2007 UBION Inc. 4 | * 5 | * Copyright (c) 2006-2007 Skype Technologies S.A. 6 | * 7 | * Skype4Java is licensed under either the Apache License, Version 2.0 or 8 | * the Eclipse Public License v1.0. 9 | * You may use it freely in commercial and non-commercial products. 10 | * You may obtain a copy of the licenses at 11 | * 12 | * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 13 | * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 14 | * 15 | * If it is possible to cooperate with the publicity of Skype4Java, please add 16 | * links to the Skype4Java web site 17 | * in your web site or documents. 18 | * 19 | * Contributors: 20 | * Koji Hisano - initial API and implementation 21 | ******************************************************************************/ 22 | package com.skype.connector.test; 23 | 24 | import java.io.BufferedWriter; 25 | import java.io.File; 26 | import java.io.FileWriter; 27 | import java.io.IOException; 28 | import java.io.PrintWriter; 29 | import java.io.Writer; 30 | 31 | import com.skype.connector.ConnectorUtils; 32 | 33 | public final class CSVRecorder extends Recorder { 34 | private PrintWriter writer; 35 | 36 | public CSVRecorder(String filePath) throws IOException { 37 | this(new File(filePath)); 38 | } 39 | 40 | public CSVRecorder(File file) throws IOException { 41 | this(new FileWriter(file)); 42 | } 43 | 44 | public CSVRecorder(Writer writer) { 45 | ConnectorUtils.checkNotNull("writer", writer); 46 | this.writer = new PrintWriter(new BufferedWriter(writer)); 47 | } 48 | 49 | @Override 50 | protected void recordReceivedMessage(long time, String message) { 51 | write("received", time, message); 52 | } 53 | 54 | @Override 55 | protected void recordSentMessage(long time, String message) { 56 | write("sent", time, message); 57 | } 58 | 59 | private synchronized void write(String header, long time, String message) { 60 | writer.print(header); 61 | writer.print(','); 62 | writer.print(time); 63 | writer.print(','); 64 | writer.println(message); 65 | } 66 | 67 | public void close() { 68 | writer.close(); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/test/java/com/skype/connector/test/Player.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 3 | * Copyright (c) 2006-2007 UBION Inc. 4 | * 5 | * Copyright (c) 2006-2007 Skype Technologies S.A. 6 | * 7 | * Skype4Java is licensed under either the Apache License, Version 2.0 or 8 | * the Eclipse Public License v1.0. 9 | * You may use it freely in commercial and non-commercial products. 10 | * You may obtain a copy of the licenses at 11 | * 12 | * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 13 | * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 14 | * 15 | * If it is possible to cooperate with the publicity of Skype4Java, please add 16 | * links to the Skype4Java web site 17 | * in your web site or documents. 18 | * 19 | * Contributors: 20 | * Koji Hisano - initial API and implementation 21 | ******************************************************************************/ 22 | package com.skype.connector.test; 23 | 24 | public abstract class Player { 25 | protected void init() { 26 | } 27 | 28 | protected abstract boolean hasNextMessage(); 29 | protected abstract PlayerMessage getNextMessage(); 30 | 31 | protected void destory() { 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/test/java/com/skype/connector/test/PlayerMessage.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 3 | * Copyright (c) 2006-2007 UBION Inc. 4 | * 5 | * Copyright (c) 2006-2007 Skype Technologies S.A. 6 | * 7 | * Skype4Java is licensed under either the Apache License, Version 2.0 or 8 | * the Eclipse Public License v1.0. 9 | * You may use it freely in commercial and non-commercial products. 10 | * You may obtain a copy of the licenses at 11 | * 12 | * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 13 | * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 14 | * 15 | * If it is possible to cooperate with the publicity of Skype4Java, please add 16 | * links to the Skype4Java web site 17 | * in your web site or documents. 18 | * 19 | * Contributors: 20 | * Koji Hisano - initial API and implementation 21 | ******************************************************************************/ 22 | package com.skype.connector.test; 23 | 24 | public final class PlayerMessage { 25 | public enum Type { 26 | RECEIVED, SENT; 27 | } 28 | 29 | private final Type type; 30 | private final long time; 31 | private final String message; 32 | 33 | public PlayerMessage(final Type type, final long time, final String message) { 34 | this.type = type; 35 | this.time = time; 36 | this.message = message; 37 | } 38 | 39 | public String getMessage() { 40 | return message; 41 | } 42 | 43 | public long getTime() { 44 | return time; 45 | } 46 | 47 | public Type getType() { 48 | return type; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/test/java/com/skype/connector/test/Recorder.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 3 | * Copyright (c) 2006-2007 UBION Inc. 4 | * 5 | * Copyright (c) 2006-2007 Skype Technologies S.A. 6 | * 7 | * Skype4Java is licensed under either the Apache License, Version 2.0 or 8 | * the Eclipse Public License v1.0. 9 | * You may use it freely in commercial and non-commercial products. 10 | * You may obtain a copy of the licenses at 11 | * 12 | * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 13 | * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 14 | * 15 | * If it is possible to cooperate with the publicity of Skype4Java, please add 16 | * links to the Skype4Java web site 17 | * in your web site or documents. 18 | * 19 | * Contributors: 20 | * Koji Hisano - initial API and implementation 21 | ******************************************************************************/ 22 | package com.skype.connector.test; 23 | 24 | public abstract class Recorder { 25 | private long startTime; 26 | 27 | final boolean isStarted() { 28 | return startTime != 0; 29 | } 30 | 31 | final void setStartTime(long startTime) { 32 | this.startTime = startTime; 33 | } 34 | 35 | final long getStartTime() { 36 | return startTime; 37 | } 38 | 39 | protected abstract void recordSentMessage(long time, String message); 40 | protected abstract void recordReceivedMessage(long time, String message); 41 | } 42 | -------------------------------------------------------------------------------- /src/test/java/com/skype/connector/test/TestCaseByCSVFile.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006-2007 Koji Hisano - UBION Inc. Developer 3 | * Copyright (c) 2006-2007 UBION Inc. 4 | * 5 | * Copyright (c) 2006-2007 Skype Technologies S.A. 6 | * 7 | * Skype4Java is licensed under either the Apache License, Version 2.0 or 8 | * the Eclipse Public License v1.0. 9 | * You may use it freely in commercial and non-commercial products. 10 | * You may obtain a copy of the licenses at 11 | * 12 | * the Apache License - http://www.apache.org/licenses/LICENSE-2.0 13 | * the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html 14 | * 15 | * If it is possible to cooperate with the publicity of Skype4Java, please add 16 | * links to the Skype4Java web site 17 | * in your web site or documents. 18 | * 19 | * Contributors: Koji Hisano - initial API and implementation 20 | * Gabriel Takeuchi - Ignored non working tests, fixed some, removed warnings 21 | ******************************************************************************/ 22 | package com.skype.connector.test; 23 | 24 | import java.io.File; 25 | 26 | import junit.framework.TestCase; 27 | 28 | public abstract class TestCaseByCSVFile extends TestCase { 29 | private boolean _isRecordingMode; 30 | 31 | public final void setRecordingMode(final boolean on) { 32 | _isRecordingMode = on; 33 | } 34 | 35 | public final boolean isRecordingMode() { 36 | return _isRecordingMode; 37 | } 38 | 39 | @Override 40 | protected final void runTest() throws Throwable { 41 | TestConnector.resetInstance(); 42 | if (isRecordingMode()) { 43 | CSVRecorder recorder = null; 44 | try { 45 | recorder = new CSVRecorder(getTestDataFileName()); 46 | TestConnector.getInstance().addRecorder(recorder); 47 | super.runTest(); 48 | } finally { 49 | if (recorder != null) { 50 | recorder.close(); 51 | } 52 | } 53 | } else { 54 | try { 55 | TestConnector.getInstance().setPlayer(new CSVPlayer(getTestDataFileName())); 56 | super.runTest(); 57 | } finally { 58 | TestConnector.getInstance().clearPlayer(); 59 | } 60 | } 61 | } 62 | 63 | private String getTestDataFileName() { 64 | return File.separator + getClass().getName().replace(".", File.separator) + "_" + getName() + ".csv"; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/test/java/com/skype/connector/test/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Provides the connector for testing 3 | */ 4 | package com.skype.connector.test; 5 | -------------------------------------------------------------------------------- /src/test/java/com/skype/mocks/ConnectorMock.java: -------------------------------------------------------------------------------- 1 | package com.skype.mocks; 2 | 3 | import com.skype.connector.Connector; 4 | import com.skype.connector.ConnectorException; 5 | 6 | public class ConnectorMock extends Connector { 7 | 8 | @Override 9 | protected void initializeImpl() throws ConnectorException { 10 | throw new RuntimeException("NOT IMPLEMENTED"); 11 | } 12 | 13 | @Override 14 | protected Status connect(int timeout) throws ConnectorException { 15 | throw new RuntimeException("NOT IMPLEMENTED"); 16 | } 17 | 18 | @Override 19 | protected void disposeImpl() throws ConnectorException { 20 | throw new RuntimeException("NOT IMPLEMENTED"); 21 | } 22 | 23 | @Override 24 | protected void sendCommand(String command) { 25 | throw new RuntimeException("NOT IMPLEMENTED"); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/test/resources/com/skype/AutoAp2ApAPITest_testDoubleConnecting.csv: -------------------------------------------------------------------------------- 1 | sent,15,CREATE APPLICATION test 2 | received,15,CREATE APPLICATION test 3 | sent,15,ALTER APPLICATION test CONNECT echo123 4 | received,15,ALTER APPLICATION test CONNECT echo123 5 | received,15,APPLICATION test CONNECTING echo123 6 | received,15,APPLICATION test STREAMS echo123:1 7 | sent,15,#0 GET APPLICATION test STREAMS 8 | received,15,#0 APPLICATION test STREAMS echo123:1 9 | sent,15,#1 ALTER APPLICATION test WRITE echo123:1 TEST 10 | received,15,#1 ALTER APPLICATION test WRITE echo123:1 11 | received,15,APPLICATION test SENDING echo123:1=28 12 | received,15,APPLICATION test SENDING 13 | sent,15,DELETE APPLICATION test 14 | received,15,DELETE APPLICATION test 15 | -------------------------------------------------------------------------------- /src/test/resources/com/skype/AutoAp2ApAPITest_testRecreatingApplication.csv: -------------------------------------------------------------------------------- 1 | sent,15,CREATE APPLICATION test 2 | received,15,CREATE APPLICATION test 3 | sent,15,DELETE APPLICATION test 4 | received,15,DELETE APPLICATION test 5 | sent,15,CREATE APPLICATION test 6 | received,15,CREATE APPLICATION test 7 | sent,15,DELETE APPLICATION test 8 | received,15,DELETE APPLICATION test 9 | -------------------------------------------------------------------------------- /src/test/resources/com/skype/AutoCallAPITest_testConferenceId.csv: -------------------------------------------------------------------------------- 1 | sent,16,#0 CALL bitman, jessy 2 | received,110,#0 CALL 19502 STATUS UNPLACED 3 | sent,313,GET CALL 19502 CONF_ID 4 | received,1797,CALL 19502 CONF_ID 11676 5 | -------------------------------------------------------------------------------- /src/test/resources/com/skype/AutoCallAPITest_testSendDTMF.csv: -------------------------------------------------------------------------------- 1 | sent,2015,#0 CALL echo123 2 | received,2078,#0 CALL 32493 STATUS UNPLACED 3 | sent,2172,SET CALL 32493 DTMF 0 4 | received,2531,CALL 32493 STATUS ROUTING 5 | received,2562,CALL 32493 STATUS ROUTING 6 | received,2765,CALL 32493 STATUS RINGING 7 | received,2812,SET CALL 32493 DTMF 0 8 | sent,2812,SET CALL 32493 DTMF 1 9 | received,2812,SET CALL 32493 DTMF 1 10 | sent,2812,SET CALL 32493 DTMF 2 11 | received,2812,SET CALL 32493 DTMF 2 12 | sent,2812,SET CALL 32493 DTMF 3 13 | received,2812,SET CALL 32493 DTMF 3 14 | sent,2812,SET CALL 32493 DTMF 4 15 | received,2828,SET CALL 32493 DTMF 4 16 | sent,2828,SET CALL 32493 DTMF 5 17 | received,2828,SET CALL 32493 DTMF 5 18 | sent,2828,SET CALL 32493 DTMF 6 19 | received,2828,SET CALL 32493 DTMF 6 20 | sent,2843,SET CALL 32493 DTMF 7 21 | received,2859,CALL 32493 STATUS INPROGRESS 22 | received,2859,SET CALL 32493 DTMF 7 23 | sent,2859,SET CALL 32493 DTMF 8 24 | received,2875,SET CALL 32493 DTMF 8 25 | sent,2875,SET CALL 32493 DTMF 9 26 | received,2875,SET CALL 32493 DTMF 9 27 | sent,2875,SET CALL 32493 DTMF # 28 | received,2875,SET CALL 32493 DTMF # 29 | sent,2875,SET CALL 32493 DTMF * 30 | received,2906,SET CALL 32493 DTMF * 31 | sent,2906,#1 SET CALL 32493 STATUS FINISHED 32 | received,2968,CALL 32493 DURATION 0 33 | received,2968,CALL 32493 STATUS FINISHED 34 | received,2968,#1 CALL 32493 STATUS FINISHED 35 | -------------------------------------------------------------------------------- /src/test/resources/com/skype/AutoChatAPITest_testGetAllActiveChat.csv: -------------------------------------------------------------------------------- 1 | sent,0,SEARCH ACTIVECHATS 2 | received,0,CHATS #bitman/$jessy;eb06e65612353279, #bitman/$jdenton;9244e98f82d7d391 3 | -------------------------------------------------------------------------------- /src/test/resources/com/skype/AutoChatAPITest_testGetAllBookmarkedChat.csv: -------------------------------------------------------------------------------- 1 | sent,31,SEARCH BOOKMARKEDCHATS 2 | received,31,CHATS #bitman/$jessy;eb06e65612353279, #bitman/$jdenton;9244e98f82d7d391 3 | -------------------------------------------------------------------------------- /src/test/resources/com/skype/AutoChatAPITest_testGetAllChat.csv: -------------------------------------------------------------------------------- 1 | sent,15,SEARCH CHATS 2 | received,47,CHATS #bitman/$jessy;eb06e65612353279, #bitman/$jdenton;9244e98f82d7d391 3 | -------------------------------------------------------------------------------- /src/test/resources/com/skype/AutoChatAPITest_testGetAllMissedChat.csv: -------------------------------------------------------------------------------- 1 | sent,16,SEARCH MISSEDCHATS 2 | received,31,CHATS #bitman/$jessy;eb06e65612353279, #bitman/$jdenton;9244e98f82d7d391 3 | -------------------------------------------------------------------------------- /src/test/resources/com/skype/AutoChatAPITest_testGetAllRecentChat.csv: -------------------------------------------------------------------------------- 1 | sent,140,SEARCH RECENTCHATS 2 | received,140,CHATS #bitman/$jessy;eb06e65612353279, #bitman/$jdenton;9244e98f82d7d391 3 | -------------------------------------------------------------------------------- /src/test/resources/com/skype/AutoDebugOutTest_testBasic.csv: -------------------------------------------------------------------------------- 1 | sent,15,GET SKYPEVERSION 2 | received,15,SKYPEVERSION 3.8.0.139 3 | sent,15,GET SKYPEVERSION 4 | received,15,SKYPEVERSION 3.8.0.139 5 | sent,15,GET SKYPEVERSION 6 | received,15,SKYPEVERSION 3.8.0.139 7 | -------------------------------------------------------------------------------- /src/test/resources/com/skype/AutoMainWindowStateTest_testBasic.csv: -------------------------------------------------------------------------------- 1 | sent,0,SET WINDOWSTATE MAXIMIZED 2 | received,453,WINDOWSTATE MAXIMIZED 3 | sent,453,GET WINDOWSTATE 4 | received,453,WINDOWSTATE MAXIMIZED 5 | received,516,WINDOWSTATE MAXIMIZED 6 | sent,1453,SET WINDOWSTATE MINIMIZED 7 | received,1766,WINDOWSTATE MINIMIZED 8 | sent,1766,GET WINDOWSTATE 9 | received,1766,WINDOWSTATE MINIMIZED 10 | received,1766,WINDOWSTATE MINIMIZED 11 | sent,2766,SET WINDOWSTATE NORMAL 12 | received,3484,WINDOWSTATE NORMAL 13 | received,3484,WINDOWSTATE NORMAL 14 | sent,3484,GET WINDOWSTATE 15 | received,3563,WINDOWSTATE NORMAL 16 | sent,4484,SET WINDOWSTATE HIDDEN 17 | received,4563,WINDOWSTATE HIDDEN 18 | received,4563,WINDOWSTATE HIDDEN 19 | sent,4563,GET WINDOWSTATE 20 | received,4609,WINDOWSTATE HIDDEN 21 | -------------------------------------------------------------------------------- /src/test/resources/com/skype/AutoSkypeAPITest_testSetSilentMode.csv: -------------------------------------------------------------------------------- 1 | sent,0,#0 SEARCH USERS test 2 | sent,3000,PING 3 | received,3000,PONG 4 | sent,6016,PING 5 | received,6016,PONG 6 | sent,9016,PING 7 | received,9016,PONG 8 | received,10031,#0 USERS test-fixture-3, testtest1107, test.phone, test.bvz, testtest6634, test_sdp2, test.1212, testtest4480, test1212126, test.frank.gardes, testuseruk, testeur8, test.account77, testtest5883, test_caen, test-hd, testtest3095, test.racunar2, test.cimax, testtest8811, test_skype.1, test.12348612, testtest5335, test12242, test.frovia, testtest1934, myspace:testfestival, test.account777, testtest6965, test_connect10, axem-test, test.asd, drlenoir, fuji_test12, chatham.test, testttm, jf-martine78000, rainer.paat, particle.test, lyceetest, test_plk, wsradiotest, meeshnewman, car.test, test_zanasichina, skypeliuliu, micha_test_ghp, test429, simon.betts.citc.test, test.facility, wulfkirman79, stephen.glynn.test, vibemac_spa, pebau1, gloomyblack, blueocarina_test, testov_test, krsrao1661, myspace:testtester111, myspace:testmehctib, st_ranger71, runegoon, testtest6485, ikweetgeenanderenaam, paulys25, voip.test1, lowe_test, test-x, test12345712, signaltestinc, myspace:paigeylynn, qlin123, thebigguy24, q12test, watter82, vi_on_g4, vika_forever4, myspace:joshskorn, test.my.phone, huamei001, otto.hunziker.t, ichel-gastpc, ibm_test_english_10, testvmware, hotcho4, oldcompeter, bryontest, virtual.pc.hp, myspace:devildoq 9 | -------------------------------------------------------------------------------- /src/test/resources/com/skype/AutoSkypeClientAPITest_test.csv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taksan/skype-java-api/e7007433f851c1d233b7f7b53abfc031cc271ecd/src/test/resources/com/skype/AutoSkypeClientAPITest_test.csv -------------------------------------------------------------------------------- /src/test/resources/com/skype/AutoSkypeClientAPITest_testSetSilentMode.csv: -------------------------------------------------------------------------------- 1 | sent,0,SET SILENT_MODE ON 2 | sent,3000,PING 3 | received,3000,PONG 4 | received,4500,SILENT_MODE ON 5 | -------------------------------------------------------------------------------- /src/test/resources/com/skype/AutoVoiceMailAPITest_testGetAllVoiceMails.csv: -------------------------------------------------------------------------------- 1 | sent,0,SEARCH VOICEMAILS 2 | received,0,VOICEMAILS 65, 70, 71 3 | -------------------------------------------------------------------------------- /src/test/resources/com/skype/AutoVoiceMailAPITest_testVoiceMail.csv: -------------------------------------------------------------------------------- 1 | sent,16,#0 VOICEMAIL echo123 2 | received,94,#0 VOICEMAIL 2346 STATUS BLANK 3 | sent,250,#1 GET VOICEMAIL 2346 TYPE 4 | received,625,CALL 2342 STATUS ROUTING 5 | received,625,VOICEMAIL 2345 TYPE CUSTOM_GREETING 6 | received,625,VOICEMAIL 2345 PARTNER_HANDLE echo123 7 | received,641,VOICEMAIL 2345 PARTNER_DISPNAME Skype Test Call 8 | received,641,VOICEMAIL 2345 ALLOWED_DURATION 60 9 | received,641,VOICEMAIL 2345 SUBJECT 10 | received,641,VOICEMAIL 2345 TIMESTAMP 1156016035 11 | received,641,VOICEMAIL 2345 DURATION 0 12 | received,656,VOICEMAIL 2345 STATUS NOTDOWNLOADED 13 | received,672,VOICEMAIL 2345 STATUS DOWNLOADING 14 | received,750,VOICEMAIL 2346 TYPE OUTGOING 15 | received,781,VOICEMAIL 2346 PARTNER_HANDLE echo123 16 | received,781,VOICEMAIL 2346 PARTNER_DISPNAME Skype Test Call 17 | received,828,VOICEMAIL 2346 ALLOWED_DURATION 600 18 | received,828,VOICEMAIL 2346 SUBJECT 19 | received,828,VOICEMAIL 2346 TIMESTAMP 1156016035 20 | received,891,VOICEMAIL 2346 DURATION 0 21 | received,891,VOICEMAIL 2346 STATUS BLANK 22 | received,906,VOICEMAIL 2345 STATUS PLAYING 23 | received,922,CALL 2342 STATUS VM_BUFFERING_GREETING 24 | received,938,CALL 2342 VM_ALLOWED_DURATION 600 25 | received,938,#1 VOICEMAIL 2346 TYPE OUTGOING 26 | sent,938,GET VOICEMAIL 2346 PARTNER_HANDLE 27 | received,938,CALL 2342 VM_DURATION 0 28 | received,953,CALL 2342 STATUS VM_PLAYING_GREETING 29 | received,953,VOICEMAIL 2346 PARTNER_HANDLE echo123 30 | sent,953,GET VOICEMAIL 2346 PARTNER_DISPNAME 31 | received,953,VOICEMAIL 2346 PARTNER_DISPNAME Skype Test Call 32 | sent,953,GET VOICEMAIL 2346 TIMESTAMP 33 | received,969,VOICEMAIL 2346 TIMESTAMP 1156016035 34 | received,985,CALL 2342 STATUS VM_PLAYING_GREETING 35 | received,985,VOICEMAIL 2345 STATUS BUFFERING 36 | received,1031,CALL 2342 STATUS VM_PLAYING_GREETING 37 | sent,1031,GET VOICEMAIL 2346 DURATION 38 | received,1047,VOICEMAIL 2346 DURATION 0 39 | sent,1047,GET VOICEMAIL 2346 ALLOWED_DURATION 40 | received,1063,VOICEMAIL 2346 ALLOWED_DURATION 600 41 | -------------------------------------------------------------------------------- /src/test/resources/com/skype/AutoVoiceMailAPITest_testVoiceMailStatusChangedListener.csv: -------------------------------------------------------------------------------- 1 | sent,0,#2 VOICEMAIL echo123 2 | received,93,#2 VOICEMAIL 8014 STATUS BLANK 3 | received,547,CALL 8011 STATUS ROUTING 4 | received,562,VOICEMAIL 8014 TYPE OUTGOING 5 | received,562,VOICEMAIL 8014 PARTNER_HANDLE echo123 6 | received,578,VOICEMAIL 8014 PARTNER_DISPNAME Skype Test Call 7 | received,578,VOICEMAIL 8014 ALLOWED_DURATION 600 8 | received,593,VOICEMAIL 8014 SUBJECT 9 | received,609,VOICEMAIL 8014 TIMESTAMP 1156109450 10 | received,781,VOICEMAIL 8014 DURATION 0 11 | received,812,VOICEMAIL 8014 STATUS BLANK 12 | received,843,VOICEMAIL 7989 STATUS PLAYING 13 | received,859,CALL 8011 VM_ALLOWED_DURATION 600 14 | received,875,CALL 8011 VM_DURATION 0 15 | received,875,CALL 8011 STATUS VM_PLAYING_GREETING 16 | received,875,CALL 8011 STATUS VM_PLAYING_GREETING 17 | received,5734,VOICEMAIL 7989 STATUS PLAYED 18 | received,5734,VOICEMAIL 8014 TIMESTAMP 1156109456 19 | received,5765,VOICEMAIL 8014 STATUS RECORDING 20 | received,5765,CALL 8011 STATUS VM_RECORDING 21 | received,5984,VOICEMAIL 8014 DURATION 1 22 | received,5984,CALL 8011 VM_DURATION 1 23 | received,7000,VOICEMAIL 8014 DURATION 2 24 | received,7000,CALL 8011 VM_DURATION 2 25 | received,7484,VOICEMAIL 8014 STATUS UPLOADING 26 | received,7500,CALL 8011 STATUS VM_UPLOADING 27 | received,8843,VOICEMAIL 8014 STATUS UPLOADED 28 | -------------------------------------------------------------------------------- /src/test/resources/com/skype/FriendTest_testFriendProperties.csv: -------------------------------------------------------------------------------- 1 | sent,0,SEARCH FRIENDS 2 | received,0,USERS skype_api_for_java 3 | sent,16,GET USER skype_api_for_java FULLNAME 4 | received,47,USER skype_api_for_java FULLNAME Skype API for Java 5 | sent,78,GET USER skype_api_for_java BIRTHDAY 6 | received,78,USER skype_api_for_java BIRTHDAY 19801205 7 | sent,78,GET USER skype_api_for_java SEX 8 | received,78,USER skype_api_for_java SEX MALE 9 | sent,78,GET USER skype_api_for_java LANGUAGE 10 | received,78,USER skype_api_for_java LANGUAGE ja Japanese 11 | sent,78,GET USER skype_api_for_java LANGUAGE 12 | received,78,USER skype_api_for_java LANGUAGE ja Japanese 13 | sent,78,GET USER skype_api_for_java COUNTRY 14 | received,78,USER skype_api_for_java COUNTRY jp Japan 15 | sent,78,GET USER skype_api_for_java COUNTRY 16 | received,78,USER skype_api_for_java COUNTRY jp Japan 17 | sent,78,GET USER skype_api_for_java PROVINCE 18 | received,78,USER skype_api_for_java PROVINCE Tokyo 19 | sent,78,GET USER skype_api_for_java CITY 20 | received,78,USER skype_api_for_java CITY Chofu 21 | sent,94,GET USER skype_api_for_java PHONE_HOME 22 | received,94,USER skype_api_for_java PHONE_HOME +813-0000-0000 23 | sent,94,GET USER skype_api_for_java PHONE_OFFICE 24 | received,94,USER skype_api_for_java PHONE_OFFICE +813-0000-0000 25 | sent,94,GET USER skype_api_for_java PHONE_MOBILE 26 | received,94,USER skype_api_for_java PHONE_MOBILE +890-0000-0000 27 | sent,94,GET USER skype_api_for_java HOMEPAGE 28 | received,94,USER skype_api_for_java HOMEPAGE http://skype.sourceforge.jp/ 29 | sent,94,GET USER skype_api_for_java ABOUT 30 | received,94,USER skype_api_for_java ABOUT Please, enjoy 'Skype API for Java'. 31 | sent,94,GET USER skype_api_for_java MOOD_TEXT 32 | received,94,USER skype_api_for_java MOOD_TEXT 33 | sent,94,GET USER skype_api_for_java IS_VIDEO_CAPABLE 34 | received,94,USER skype_api_for_java IS_VIDEO_CAPABLE TRUE 35 | sent,94,GET USER skype_api_for_java BUDDYSTATUS 36 | received,94,USER skype_api_for_java BUDDYSTATUS 3 37 | sent,94,GET USER skype_api_for_java ISAUTHORIZED 38 | received,94,USER skype_api_for_java ISAUTHORIZED TRUE 39 | sent,94,GET USER skype_api_for_java ISBLOCKED 40 | received,94,USER skype_api_for_java ISBLOCKED FALSE 41 | sent,94,GET USER skype_api_for_java LASTONLINETIMESTAMP 42 | received,94,USER skype_api_for_java LASTONLINETIMESTAMP 1174559278 43 | sent,109,GET USER skype_api_for_java CAN_LEAVE_VM 44 | received,109,USER skype_api_for_java CAN_LEAVE_VM TRUE 45 | sent,125,GET USER skype_api_for_java SPEEDDIAL 46 | received,125,USER skype_api_for_java SPEEDDIAL 47 | sent,125,GET USER skype_api_for_java TIMEZONE 48 | received,125,USER skype_api_for_java TIMEZONE 86400 49 | -------------------------------------------------------------------------------- /src/test/resources/com/skype/FriendTest_testGetAllFriends.csv: -------------------------------------------------------------------------------- 1 | sent,31,SEARCH FRIENDS 2 | received,31,USERS skype_api_for_java 3 | -------------------------------------------------------------------------------- /src/test/resources/com/skype/ProfileTest_testBasic.csv: -------------------------------------------------------------------------------- 1 | sent,16,GET CURRENTUSERHANDLE 2 | received,16,CURRENTUSERHANDLE skype_api_for_java 3 | sent,16,GET USERSTATUS 4 | received,16,USERSTATUS ONLINE 5 | sent,16,GET PRIVILEGE SKYPEOUT 6 | received,16,PRIVILEGE SKYPEOUT TRUE 7 | sent,16,GET PRIVILEGE SKYPEIN 8 | received,16,PRIVILEGE SKYPEIN TRUE 9 | sent,16,GET PRIVILEGE VOICEMAIL 10 | received,16,PRIVILEGE VOICEMAIL TRUE 11 | sent,16,GET PROFILE PSTN_BALANCE 12 | received,16,PROFILE PSTN_BALANCE 1000000 13 | sent,16,GET PROFILE PSTN_BALANCE_CURRENCY 14 | received,16,PROFILE PSTN_BALANCE_CURRENCY JPY 15 | sent,16,GET PROFILE FULLNAME 16 | received,16,PROFILE FULLNAME Skype API for Java 17 | sent,78,GET PROFILE BIRTHDAY 18 | received,78,PROFILE BIRTHDAY 19801205 19 | sent,78,GET PROFILE SEX 20 | received,78,PROFILE SEX MALE 21 | sent,78,GET PROFILE LANGUAGES 22 | received,78,PROFILE LANGUAGES ja 23 | sent,78,GET PROFILE COUNTRY 24 | received,78,PROFILE COUNTRY jp Japan 25 | sent,78,GET PROFILE COUNTRY 26 | received,78,PROFILE COUNTRY jp Japan 27 | sent,78,GET PROFILE IPCOUNTRY 28 | received,78,PROFILE IPCOUNTRY jp 29 | sent,78,GET PROFILE PROVINCE 30 | received,78,PROFILE PROVINCE Tokyo 31 | sent,78,GET PROFILE CITY 32 | received,94,PROFILE CITY Chofu 33 | sent,94,GET PROFILE PHONE_HOME 34 | received,94,PROFILE PHONE_HOME +8130-0000-0000 35 | sent,94,GET PROFILE PHONE_OFFICE 36 | received,94,PROFILE PHONE_OFFICE +8130-0000-0000 37 | sent,94,GET PROFILE PHONE_MOBILE 38 | received,94,PROFILE PHONE_MOBILE +8190-0000-0000 39 | sent,94,GET PROFILE HOMEPAGE 40 | received,94,PROFILE HOMEPAGE http://skype.sourceforge.jp/ 41 | sent,94,GET PROFILE ABOUT 42 | received,94,PROFILE ABOUT Skype API for Java 43 | sent,94,GET PROFILE MOOD_TEXT 44 | received,94,PROFILE MOOD_TEXT Please, enjoy 'Skype API for Java'. 45 | sent,94,GET PROFILE TIMEZONE 46 | received,94,PROFILE TIMEZONE 118800 47 | -------------------------------------------------------------------------------- /src/test/resources/com/skype/TestData.properties: -------------------------------------------------------------------------------- 1 | id=echo123 2 | id2=echo123 3 | smsNumber=42424242 4 | -------------------------------------------------------------------------------- /src/test/resources/com/skype/TestData.properties.base: -------------------------------------------------------------------------------- 1 | id= 2 | id2= 3 | smsNumber= 4 | -------------------------------------------------------------------------------- /src/test/resources/com/skype/connector/test/AutoConnectorTest_testCall.csv: -------------------------------------------------------------------------------- 1 | sent,16,SEARCH FRIENDS 2 | received,16,USERS echo123 3 | sent,32,#0 CALL echo123 4 | received,78,#0 CALL 8345 STATUS ROUTING 5 | received,1032,CALL 8345 STATUS ROUTING 6 | received,1047,CALL 8345 STATUS ROUTING 7 | received,1047,CALL 8345 STATUS RINGING 8 | received,1047,CALL 8345 STATUS RINGING 9 | received,2875,CALL 8345 STATUS INPROGRESS 10 | received,2875,CALL 8345 VIDEO_SEND_STATUS AVAILABLE 11 | received,2891,CALL 8345 VIDEO_STATUS VIDEO_BOTH_ENABLED 12 | received,3578,CALL 8345 DURATION 1 13 | received,4547,CALL 8345 DURATION 2 14 | sent,5078,#1 SET CALL 8345 STATUS FINISHED 15 | received,5110,#1 CALL 8345 STATUS FINISHED 16 | sent,5110,GET CALL 8345 DURATION 17 | received,5110,CALL 8345 STATUS FINISHED 18 | received,5250,CALL 8345 DURATION 2 19 | sent,5250,GET CALL 8345 PARTNER_HANDLE 20 | received,5266,CALL 8345 PARTNER_HANDLE echo123 21 | sent,5266,GET CALL 8345 TYPE 22 | received,5313,CALL 8345 TYPE OUTGOING_P2P 23 | -------------------------------------------------------------------------------- /src/test/resources/com/skype/connector/test/AutoConnectorTest_testGetVersion.csv: -------------------------------------------------------------------------------- 1 | sent,0,GET SKYPEVERSION 2 | received,0,SKYPEVERSION 2.5.0.130 3 | --------------------------------------------------------------------------------