]> sjero.net Git - linphone/commitdiff
Added function to request other side to send VFU.
authorGuillaume Beraudo <guillaume.beraudo@linphone.org>
Thu, 20 Jan 2011 11:42:09 +0000 (12:42 +0100)
committerGuillaume Beraudo <guillaume.beraudo@linphone.org>
Thu, 20 Jan 2011 11:42:09 +0000 (12:42 +0100)
console/commands.c
coreapi/linphonecall.c
coreapi/sal.h
coreapi/sal_eXosip2.c

index 6d0d005f27e312e8d4c467de98b970656ea31988..4fdd4e715f58377ecdc8b49fbb500482697385f8 100644 (file)
@@ -298,6 +298,7 @@ static LPC_COMMAND advanced_commands[] = {
        { "snapshot", lpc_cmd_snapshot, "Take a snapshot of currently received video stream",
                "'snapshot <file path>': take a snapshot and records it in jpeg format into the supplied path\n"
        },
+       { "vfureq", lpc_cmd_vfureq, "Request the other side to send VFU for the current call"},
 #endif
        { "states", lpc_cmd_states, "Show internal states of liblinphone, registrations and calls, according to linphonecore.h definitions",
                "'states global': shows global state of liblinphone \n"
@@ -2433,12 +2434,21 @@ static int lpc_cmd_snapshot(LinphoneCore *lc, char *args){
        if (!args) return 0;
        call=linphone_core_get_current_call(lc);
        if (call!=NULL){
-               linphone_call_take_video_snapshot (call,args);
-               linphonec_out("Taking video snaphot in file %s\n", args);
+               linphone_call_take_video_snapshot(call,args);
+               linphonec_out("Taking video snapshot in file %s\n", args);
        }else linphonec_out("There is no active call.\n");
        return 1;
 }
 
+static int lpc_cmd_vfureq(LinphoneCore *lc){
+       LinphoneCall *call;
+       call=linphone_core_get_current_call(lc);
+       if (call!=NULL){
+               linphone_call_send_vfu_request(call);
+               linphonec_out("VFU request sent\n");
+       }else linphonec_out("There is no active call.\n");
+       return 1;
+}
 #endif
 
 static int lpc_cmd_identify(LinphoneCore *lc, char *args){
index 89e730a74f470c98b50725e6a7bf236a86092c48..393305f5439afb72e35dcc18af8b232480c47fea 100644 (file)
@@ -973,3 +973,11 @@ void linphone_call_stop_media_streams(LinphoneCall *call){
        }
 }
 
+/**
+ * Request remote side to send us VFU.
+**/
+void linphone_call_send_vfu_request(LinphoneCall *call)
+{
+       LinphoneCall *call=linphone_core_get_current_call(lc);
+               sal_call_send_vfu_request(call->op);
+}
index 4086dd1edbf80708b3607b642fd0b4aba3240776..359d81883a3ea9f56132c13c8ca67eb44cbaf554 100644 (file)
@@ -298,6 +298,7 @@ SalOp *sal_call_get_replaces(SalOp *h);
 int sal_call_send_dtmf(SalOp *h, char dtmf);
 int sal_call_terminate(SalOp *h);
 bool_t sal_call_autoanswer_asked(SalOp *op);
+void sal_call_send_vfu_request(SalOp *h);
 
 /*Registration*/
 int sal_register(SalOp *op, const char *proxy, const char *from, int expires);
index 315c566a6db5566d38a1c7b431f944948677b7d0..28f05da378af1212efb6a168b516adffb33dd50e 100644 (file)
@@ -1237,6 +1237,33 @@ static bool_t call_failure(Sal *sal, eXosip_event_t *ev){
        return TRUE;
 }
 
+/* Request remote side to send us VFU */
+static void sal_call_send_vfu_request(SalOp *h){
+       osip_message_t *msg=NULL;
+       char info_body[] =
+                       "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n"
+                        "<media_control>\n"
+                        "  <vc_primitive>\n"
+                        "    <to_encoder>\n"
+                        "      <picture_fast_update/>\n"
+                        "    </to_encoder>\n"
+                        "  </vc_primitive>\n"
+                        "</media_control>\n";
+
+       char clen[10];
+
+       eXosip_lock();
+       eXosip_call_build_info(h->did,&msg);
+       if (msg){
+               osip_message_set_body(msg,info_body,strlen(info_body));
+               osip_message_set_content_type(msg,"application/media_control+xml");
+               snprintf(clen,sizeof(clen),"%lu",(unsigned long)strlen(info_body));
+               osip_message_set_content_length(msg,clen);
+               eXosip_call_send_request(h->did,msg);
+       }
+       eXosip_unlock();
+       return 0;
+}
 
 static void process_media_control_xml(Sal *sal, eXosip_event_t *ev){
        SalOp *op=find_op(sal,ev);