diff --git a/home/bouin/linphone_sources/git/linphone/coreapi/exevents.c b/../linphone_answer-after/coreapi/exevents.c index 36ed2b6..f96a2c0 100644 --- a/home/bouin/linphone_sources/git/linphone/coreapi/exevents.c +++ b/../linphone_answer-after/coreapi/exevents.c @@ -336,7 +336,7 @@ int linphone_inc_new_call(LinphoneCore *lc, eXosip_event_t *ev) tmp=ms_strdup("Unknown user"); } gstate_new_state(lc, GSTATE_CALL_IN_INVITE, tmp); - barmesg=ortp_strdup_printf("%s %s",tmp,_("is contacting you.")); + barmesg=ortp_strdup_printf("%s %s%s",tmp,_("is contacting you"),lc->call->asked_autoanswer?_(" and asked autoanswer."):_(".")); lc->vtable.show(lc); lc->vtable.display_status(lc,barmesg); diff --git a/home/bouin/linphone_sources/git/linphone/coreapi/linphonecore.c b/../linphone_answer-after/coreapi/linphonecore.c index b76992e..ed6d69a 100644 --- a/home/bouin/linphone_sources/git/linphone/coreapi/linphonecore.c +++ b/../linphone_answer-after/coreapi/linphonecore.c @@ -120,6 +120,10 @@ LinphoneCall * linphone_call_new_outgoing(struct _LinphoneCore *lc, LinphoneAddr return call; } +bool_t linphone_do_we_autoanswer(LinphoneCall *call) +{ + return call->asked_autoanswer; +} LinphoneCall * linphone_call_new_incoming(LinphoneCore *lc, LinphoneAddress *from, LinphoneAddress *to, eXosip_event_t *ev){ LinphoneCall *call=ms_new0(LinphoneCall,1); @@ -144,6 +148,23 @@ LinphoneCall * linphone_call_new_incoming(LinphoneCore *lc, LinphoneAddress *fro linphone_address_destroy(me); osip_message_header_get_byname(ev->request,"Session-expires",0,&h); if (h) call->supports_session_timers=TRUE; + { + osip_call_info_t *call_info; + char *call_info_text; + osip_message_get_call_info(ev->request,0,&call_info); + if(call_info) + { + osip_call_info_to_str(call_info,&call_info_text); + if(strstr(call_info_text,"answer-after=0") != NULL) + { + call->asked_autoanswer=TRUE; + ms_message("we could auto answer the incoming call !!!!!\n"); + } + } + if(call_info_text) + osip_free(call_info_text); + + } return call; } diff --git a/home/bouin/linphone_sources/git/linphone/coreapi/linphonecore.h b/../linphone_answer-after/coreapi/linphonecore.h index 9ce8670..b895bb0 100644 --- a/home/bouin/linphone_sources/git/linphone/coreapi/linphonecore.h +++ b/../linphone_answer-after/coreapi/linphonecore.h @@ -939,6 +939,7 @@ void linphone_core_start_waiting(LinphoneCore *lc, const char *purpose); void linphone_core_update_progress(LinphoneCore *lc, const char *purpose, float progresses); void linphone_core_stop_waiting(LinphoneCore *lc); +bool_t linphone_do_we_autoanswer(struct _LinphoneCall *call); #ifdef __cplusplus } diff --git a/home/bouin/linphone_sources/git/linphone/coreapi/private.h b/../linphone_answer-after/coreapi/private.h index 93b1c77..9d850bc 100644 --- a/home/bouin/linphone_sources/git/linphone/coreapi/private.h +++ b/../linphone_answer-after/coreapi/private.h @@ -94,6 +94,7 @@ typedef struct _LinphoneCall LCState state; bool_t auth_pending; bool_t supports_session_timers; + bool_t asked_autoanswer; } LinphoneCall; LinphoneCall * linphone_call_new_outgoing(struct _LinphoneCore *lc, LinphoneAddress *from, LinphoneAddress *to);