diff --git a/linphone/console/linphonec.c b/linphone/console/linphonec.c index 6136eac3e..6618ce3b5 100644 --- a/linphone/console/linphonec.c +++ b/linphone/console/linphonec.c @@ -109,6 +109,7 @@ static void linphonec_text_received(LinphoneCore *lc, LinphoneChatRoom *cr, const char *from, const char *msg); static void linphonec_display_status (LinphoneCore * lc, const char *something); static void linphonec_general_state (LinphoneCore * lc, LinphoneGeneralState *gstate); +static void linphonec_dtmf_received(LinphoneCore *lc, int dtmf); static void print_prompt(LinphoneCore *opm); /*************************************************************************** * @@ -146,23 +147,24 @@ static ortp_socket_t server_sock; LinphoneCoreVTable linphonec_vtable = { - show:(ShowInterfaceCb) stub, - inv_recv: linphonec_call_received, - bye_recv: linphonec_bye_received, - notify_recv: linphonec_notify_received, - new_unknown_subscriber: linphonec_new_unknown_subscriber, - auth_info_requested: linphonec_prompt_for_auth, - display_status:linphonec_display_status, - display_message:linphonec_display_something, + .show =(ShowInterfaceCb) stub, + .inv_recv = linphonec_call_received, + .bye_recv = linphonec_bye_received, + .notify_recv = linphonec_notify_received, + .new_unknown_subscriber = linphonec_new_unknown_subscriber, + .auth_info_requested = linphonec_prompt_for_auth, + .display_status = linphonec_display_status, + .display_message=linphonec_display_something, #ifdef VINCENT_MAURY_RSVP /* the yes/no dialog box */ - display_yes_no: (DisplayMessageCb) stub, + .display_yes_no= (DisplayMessageCb) stub, #endif - display_warning:linphonec_display_warning, - display_url:linphonec_display_url, - display_question:(DisplayQuestionCb)stub, - text_received:linphonec_text_received, - general_state:linphonec_general_state + .display_warning=linphonec_display_warning, + .display_url=linphonec_display_url, + .display_question=(DisplayQuestionCb)stub, + .text_received=linphonec_text_received, + .general_state=linphonec_general_state, + .dtmf_received=linphonec_dtmf_received }; /*************************************************************************** @@ -297,6 +299,10 @@ linphonec_text_received(LinphoneCore *lc, LinphoneChatRoom *cr, } +static void linphonec_dtmf_received(LinphoneCore *lc, int dtmf){ + printf("Receiving tone %c",dtmf); +} + static void linphonec_general_state (LinphoneCore * lc, LinphoneGeneralState *gstate) { diff --git a/linphone/coreapi/exevents.c b/linphone/coreapi/exevents.c index 95057eca4..29546d49a 100644 --- a/linphone/coreapi/exevents.c +++ b/linphone/coreapi/exevents.c @@ -867,27 +867,59 @@ void linphone_call_ringing(LinphoneCore *lc, eXosip_event_t *ev){ } +static void linphone_process_media_control_xml(LinphoneCore *lc, eXosip_event_t *ev){ + osip_body_t *body=NULL; + osip_message_get_body(ev->request,0,&body); + if (body && body->body!=NULL && + strstr(body->body,"picture_fast_update")){ + osip_message_t *ans=NULL; + ms_message("Receiving VFU request !"); + if (lc->videostream) + video_stream_send_vfu(lc->videostream); + eXosip_call_build_answer(ev->tid,200,&ans); + if (ans) + eXosip_call_send_answer(ev->tid,200,ans); + } +} + +static void linphone_process_dtmf_relay(LinphoneCore *lc, eXosip_event_t *ev){ + osip_body_t *body=NULL; + osip_message_get_body(ev->request,0,&body); + if (body && body->body!=NULL){ + osip_message_t *ans=NULL; + const char *name=strstr(body->body,"Signal"); + if (name==NULL) name=strstr(body->body,"signal"); + if (name==NULL) { + ms_warning("Could not extract the dtmf name from the SIP INFO."); + }else{ + char tmp[2]; + name+=strlen("signal"); + if (sscanf(name," = %1s",tmp)==1){ + ms_message("Receiving dtmf %s via SIP INFO.",tmp); + if (lc->vtable.dtmf_received != NULL) + lc->vtable.dtmf_received(lc, tmp[0]); + } + } + + eXosip_call_build_answer(ev->tid,200,&ans); + if (ans) + eXosip_call_send_answer(ev->tid,200,ans); + } +} + void linphone_call_message_new(LinphoneCore *lc, eXosip_event_t *ev){ #ifdef VIDEO_ENABLED if (ev->request){ if (MSG_IS_INFO(ev->request)){ osip_content_type_t *ct; ct=osip_message_get_content_type(ev->request); - if (ct && ct->subtype && - strcmp(ct->subtype,"media_control+xml")==0){ - osip_body_t *body=NULL; - osip_message_get_body(ev->request,0,&body); - if (body && body->body!=NULL && - strstr(body->body,"picture_fast_update")){ - osip_message_t *ans=NULL; - ms_message("Receiving VFU request !"); - if (lc->videostream) - video_stream_send_vfu(lc->videostream); - eXosip_call_build_answer(ev->tid,200,&ans); - if (ans) - eXosip_call_send_answer(ev->tid,200,ans); - } - } + if (ct && ct->subtype){ + if (strcmp(ct->subtype,"media_control+xml")==0) + linphone_process_media_control_xml(lc,ev); + else if (strcmp(ct->subtype,"dtmf-relay")==0) + linphone_process_dtmf_relay(lc,ev); + else ms_message("Unhandled SIP INFO."); + } } }else ms_warning("linphone_call_message_new: No request ?"); #endif diff --git a/linphone/mediastreamer2/src/videoout.c b/linphone/mediastreamer2/src/videoout.c index 974aa10ab..b448aca02 100644 --- a/linphone/mediastreamer2/src/videoout.c +++ b/linphone/mediastreamer2/src/videoout.c @@ -146,9 +146,11 @@ static bool_t sdl_display_init(MSDisplay *obj, MSPicture *fbuf){ fbuf->planes[0]=lay->pixels[0]; fbuf->planes[1]=lay->pixels[2]; fbuf->planes[2]=lay->pixels[1]; + fbuf->planes[3]=NULL; fbuf->strides[0]=lay->pitches[0]; fbuf->strides[1]=lay->pitches[2]; fbuf->strides[2]=lay->pitches[1]; + fbuf->strides[3]=0; fbuf->w=lay->w; fbuf->h=lay->h; obj->data=lay; @@ -376,9 +378,11 @@ static bool_t win_display_init(MSDisplay *obj, MSPicture *fbuf){ fbuf->planes[0]=wd->fb.planes[0]=(uint8_t*)ms_malloc0(ysize+2*usize); fbuf->planes[1]=wd->fb.planes[1]=wd->fb.planes[0]+ysize; fbuf->planes[2]=wd->fb.planes[2]=wd->fb.planes[1]+usize; + fbuf->planes[3]=NULL; fbuf->strides[0]=wd->fb.strides[0]=wd->fb.w; fbuf->strides[1]=wd->fb.strides[1]=wd->fb.w/2; fbuf->strides[2]=wd->fb.strides[2]=wd->fb.w/2; + fbuf->strides[3]=0; wd->rgb_len=ysize*3; wd->rgb=(uint8_t*)ms_malloc0(wd->rgb_len);