Commit 11749e5f authored by Guillaume Beraudo's avatar Guillaume Beraudo
Browse files

Added function to request other side to send VFU.

parent b8221a04
......@@ -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){
......
......@@ -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);
}
......@@ -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);
......
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment