]> sjero.net Git - linphone/commitdiff
Implement some conference functions.
authorGuillaume Beraudo <guillaume.beraudo@linphone.org>
Tue, 20 Sep 2011 12:41:48 +0000 (14:41 +0200)
committerGuillaume Beraudo <guillaume.beraudo@linphone.org>
Tue, 20 Sep 2011 12:41:48 +0000 (14:41 +0200)
coreapi/conference.c
coreapi/linphonecore.c
coreapi/linphonecore_jni.cc
java/common/org/linphone/core/LinphoneCall.java
java/common/org/linphone/core/LinphoneCore.java
mediastreamer2

index 695fc61216b06fa6ace9af25e53d6ad76797b5ec..53abfab816ab6f2a56525cd613c4e5e6e11ce50a 100644 (file)
@@ -157,6 +157,30 @@ int linphone_core_enter_conference(LinphoneCore *lc){
        return 0;
 }
 
-int linphone_core_add_all_to_conference(LinphoneCore *lc) {return 0;}
-int linphone_core_terminate_conference(LinphoneCore *lc) {return 0;}
-int linphone_core_get_conference_size(LinphoneCore *lc) {return 0;}
+int linphone_core_add_all_to_conference(LinphoneCore *lc) {
+       MSList *calls=lc->calls;
+       while (calls) {
+               LinphoneCall *call=(LinphoneCall*)calls->data;
+               calls=calls->next;
+               if (!call->current_params.in_conference) {
+                       linphone_core_add_to_conference(lc, call);
+               }
+       }
+       return 0;
+}
+
+int linphone_core_terminate_conference(LinphoneCore *lc) {
+       MSList *calls=lc->calls;
+       while (calls) {
+               LinphoneCall *call=(LinphoneCall*)calls->data;
+               calls=calls->next;
+               if (call->current_params.in_conference) {
+                       linphone_core_terminate_call(lc, call);
+               }
+       }
+       return 0;
+}
+
+int linphone_core_get_conference_size(LinphoneCore *lc) {
+       return ms_audio_conference_size(lc->conf_ctx.conf);
+}
index b042a1398a06c74311a0ba85f8ec731d63cd9136..f7e1d129bf32d09c6795d1434542da509eb7c45e 100644 (file)
@@ -2425,13 +2425,13 @@ int linphone_core_terminate_call(LinphoneCore *lc, LinphoneCall *the_call)
  * @param lc The LinphoneCore
 **/
 int linphone_core_terminate_all_calls(LinphoneCore *lc){
-       while(lc->calls)
-       {
-               LinphoneCall *the_call = lc->calls->data;
-               linphone_core_terminate_call(lc,the_call);
+       MSList *calls=lc->calls;
+       while(calls) {
+               LinphoneCall *c=(LinphoneCall*)calls->data;
+               calls=calls->next;
+               linphone_core_terminate_call(lc,c);
        }
-       ms_list_free(lc->calls);
-       return -1;
+       return 0;
 }
 
 /**
index d5bd4ef46cd77aa07d39db3bef291a74da50c493..0642e141f4e0ee48f72be75ee13681379027a69a 100644 (file)
@@ -1363,6 +1363,14 @@ extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_getCallsNb(JNIEnv *env,j
        return ms_list_size(linphone_core_get_calls((LinphoneCore *) pCore));
 }
 
+extern "C" void Java_org_linphone_core_LinphoneCoreImpl_transferCall(JNIEnv *env,jobject thiz,jlong pCore, jlong pCall, jstring jReferTo) {
+       const char* cReferTo=env->GetStringUTFChars(jReferTo, NULL);
+       linphone_core_transfer_call((LinphoneCore *) pCore, (LinphoneCall *) pCall, cReferTo);
+       env->ReleaseStringUTFChars(jReferTo, cReferTo);
+}
+extern "C" void Java_org_linphone_core_LinphoneCoreImpl_transferCallToAnother(JNIEnv *env,jobject thiz,jlong pCore, jlong pCall, jlong pDestCall) {
+       linphone_core_transfer_call_to_another((LinphoneCore *) pCore, (LinphoneCall *) pCall, (LinphoneCall *) pDestCall);
+}
 
 extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setZrtpSecretsCache(JNIEnv *env,jobject thiz,jlong pCore, jstring jFile) {
        if (jFile) {
index 5f8745979f53cd96c08020758b20833d6b20a838..bac236dff32a4a3d08ccba536f528c74ba749664 100644 (file)
@@ -35,12 +35,6 @@ public interface LinphoneCall {
                static private Vector values = new Vector();
                private final int mValue;
                public final int value() {return mValue;}
-               public static final int ID_INCOMING_RECEIVED=1;
-               public static final int ID_OUTGOING_RINGING=4;
-               public static final int ID_STREAMS_RUNNING=7;
-               public static final int ID_PAUSED=9;
-               public static final int ID_CALL_END=13;
-               public static final int ID_PAUSED_BY_REMOTE=14;
 
                private final String mStringValue;
                /**
@@ -50,7 +44,7 @@ public interface LinphoneCall {
                /**
                 * Incoming call received.
                 */
-               public final static State IncomingReceived = new State(ID_INCOMING_RECEIVED,"IncomingReceived");
+               public final static State IncomingReceived = new State(1,"IncomingReceived");
                /**
                 * Outgoing call initialiazed.
                 */
@@ -62,7 +56,7 @@ public interface LinphoneCall {
                /**
                 * Outgoing call ringing.
                 */
-               public final static State OutgoingRinging = new State(ID_OUTGOING_RINGING,"OutgoingRinging");
+               public final static State OutgoingRinging = new State(4,"OutgoingRinging");
                /**
                 * Outgoing call early media
                 */
@@ -74,7 +68,7 @@ public interface LinphoneCall {
                /**
                 * Streams running
                 */
-               public final static State StreamsRunning = new State(ID_STREAMS_RUNNING,"StreamsRunning");
+               public final static State StreamsRunning = new State(7,"StreamsRunning");
                /**
                 * Paussing
                 */
@@ -82,7 +76,7 @@ public interface LinphoneCall {
                /**
                 * Paused
                 */
-               public final static State Paused = new State(ID_PAUSED,"Paused");
+               public final static State Paused = new State(9,"Paused");
                /**
                 * Resuming
                 */
@@ -98,12 +92,12 @@ public interface LinphoneCall {
                /**
                 * Call end
                 */
-               public final static State CallEnd = new State(ID_CALL_END,"CallEnd");
+               public final static State CallEnd = new State(13,"CallEnd");
                
                /**
                 * Paused by remote
                 */
-               public final static State PausedByRemote = new State(ID_PAUSED_BY_REMOTE,"PausedByRemote");
+               public final static State PausedByRemote = new State(14,"PausedByRemote");
                
                /**
                 * The call's parameters are updated, used for example when video is asked by remote
index 9f4e3d5a743360964649be802be88cb20dc3bb11..aec4e60af5e09990b008ac7593871d49cc464c6a 100644 (file)
@@ -610,4 +610,8 @@ public interface LinphoneCore {
        void terminateAllCalls();
        @SuppressWarnings("unchecked") List getCalls();
        int getCallsNb();
+
+
+       void transferCall(LinphoneCall call, String referTo);
+       void transferCallToAnother(LinphoneCall callToTransfer, LinphoneCall destination);
 }
index 90be72f669f3c5067c571b0f29f22eda21166006..bd3e6772c9636002aed44f3056b20f265fd35281 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 90be72f669f3c5067c571b0f29f22eda21166006
+Subproject commit bd3e6772c9636002aed44f3056b20f265fd35281