diff --git a/linphone/coreapi/callbacks.c b/my_version_to_patch/linphone_with_auto_answer_asked/coreapi/callbacks.c index 3431614..988041c 100644 --- a/linphone/coreapi/callbacks.c +++ b/my_version_to_patch/linphone_with_auto_answer_asked/coreapi/callbacks.c @@ -91,7 +91,7 @@ static void call_received(SalOp *h){ tmp=linphone_address_as_string(from_parsed); linphone_address_destroy(from_parsed); gstate_new_state(lc, GSTATE_CALL_IN_INVITE, tmp); - barmesg=ortp_strdup_printf(_("%s is contacting you"),tmp); + barmesg=ortp_strdup_printf("%s %s%s",tmp,_("is contacting you"),(sal_op_do_we_autoanswer(h)) ?_(" and asked autoanswer."):_(".")); if (lc->vtable.show) lc->vtable.show(lc); if (lc->vtable.display_status) lc->vtable.display_status(lc,barmesg); diff --git a/linphone/coreapi/sal.h b/my_version_to_patch/linphone_with_auto_answer_asked/coreapi/sal.h index e672216..0076c46 100644 --- a/linphone/coreapi/sal.h +++ b/my_version_to_patch/linphone_with_auto_answer_asked/coreapi/sal.h @@ -235,6 +235,7 @@ void sal_op_set_contact(SalOp *op, const char *contact); void sal_op_set_route(SalOp *op, const char *route); void sal_op_set_from(SalOp *op, const char *from); void sal_op_set_to(SalOp *op, const char *to); +bool_t sal_op_do_we_autoanswer(SalOp *op); void sal_op_release(SalOp *h); void sal_op_authenticate(SalOp *h, const SalAuthInfo *info); void sal_op_set_user_pointer(SalOp *h, void *up); diff --git a/linphone/coreapi/sal_eXosip2.c b/my_version_to_patch/linphone_with_auto_answer_asked/coreapi/sal_eXosip2.c index d4ce598..c0775a0 100644 --- a/linphone/coreapi/sal_eXosip2.c +++ b/my_version_to_patch/linphone_with_auto_answer_asked/coreapi/sal_eXosip2.c @@ -143,9 +143,15 @@ SalOp * sal_op_new(Sal *sal){ op->reinvite=FALSE; op->call_id=NULL; op->masquerade_via=FALSE; + op->auto_answer_asked=FALSE; return op; } +bool_t sal_op_do_we_autoanswer(SalOp *op) +{ + return op->auto_answer_asked; +} + void sal_op_release(SalOp *op){ if (op->sdp_answer) sdp_message_free(op->sdp_answer); @@ -616,6 +622,7 @@ static SalOp *find_op(Sal *sal, eXosip_event_t *ev){ static void inc_new_call(Sal *sal, eXosip_event_t *ev){ SalOp *op=sal_op_new(sal); osip_from_t *from,*to; + osip_call_info_t *call_info; char *tmp; sdp_message_t *sdp=eXosip_get_sdp_info(ev->request); @@ -636,7 +643,19 @@ static void inc_new_call(Sal *sal, eXosip_event_t *ev){ osip_from_to_str(to,&tmp); sal_op_set_to(op,tmp); osip_free(tmp); - + + osip_message_get_call_info(ev->request,0,&call_info); + if(call_info) + { + osip_call_info_to_str(call_info,&tmp); + if( strstr(tmp,"answer-after=") != NULL) + { + op->auto_answer_asked=TRUE; + ms_message("the caller asked to automatically answer the call(Emergency??)\n"); + } + osip_free(tmp); + } + op->tid=ev->tid; op->cid=ev->cid; op->did=ev->did; diff --git a/linphone/coreapi/sal_eXosip2.h b/my_version_to_patch/linphone_with_auto_answer_asked/coreapi/sal_eXosip2.h index 8c4bd24..1dd11e6 100644 --- a/linphone/coreapi/sal_eXosip2.h +++ b/my_version_to_patch/linphone_with_auto_answer_asked/coreapi/sal_eXosip2.h @@ -58,6 +58,7 @@ struct SalOp{ bool_t sdp_offering; bool_t reinvite; bool_t masquerade_via; + bool_t auto_answer_asked; }; void sal_remove_out_subscribe(Sal *sal, SalOp *op);