From: Guillaume Beraudo Date: Thu, 20 Jan 2011 11:42:09 +0000 (+0100) Subject: Added function to request other side to send VFU. X-Git-Url: http://sjero.net/git/?p=linphone;a=commitdiff_plain;h=11749e5f8cb764f1cc1791f5b9a734bbc7ffe1bf Added function to request other side to send VFU. --- diff --git a/console/commands.c b/console/commands.c index 6d0d005f..4fdd4e71 100644 --- a/console/commands.c +++ b/console/commands.c @@ -298,6 +298,7 @@ static LPC_COMMAND advanced_commands[] = { { "snapshot", lpc_cmd_snapshot, "Take a snapshot of currently received video stream", "'snapshot ': 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){ diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index 89e730a7..393305f5 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -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); +} diff --git a/coreapi/sal.h b/coreapi/sal.h index 4086dd1e..359d8188 100644 --- a/coreapi/sal.h +++ b/coreapi/sal.h @@ -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); diff --git a/coreapi/sal_eXosip2.c b/coreapi/sal_eXosip2.c index 315c566a..28f05da3 100644 --- a/coreapi/sal_eXosip2.c +++ b/coreapi/sal_eXosip2.c @@ -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[] = + "\n" + "\n" + " \n" + " \n" + " \n" + " \n" + " \n" + "\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);