Commit 46965b6c authored by Simon Morlat's avatar Simon Morlat
Browse files

merge patch to report asked auto-answer for incoming calls.

parent 2ba960db
......@@ -91,7 +91,8 @@ 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_call_autoanswer_asked(h)) ?_(" and asked autoanswer."):_("."));
if (lc->vtable.show) lc->vtable.show(lc);
if (lc->vtable.display_status)
lc->vtable.display_status(lc,barmesg);
......
......@@ -258,6 +258,7 @@ SalMediaDescription * sal_call_get_final_media_description(SalOp *h);
int sal_refer(SalOp *h, const char *refer_to);
int sal_call_send_dtmf(SalOp *h, char dtmf);
int sal_call_terminate(SalOp *h);
bool_t sal_call_autoanswer_asked(SalOp *op);
/*Registration*/
int sal_register(SalOp *op, const char *proxy, const char *from, int expires);
......
......@@ -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_call_autoanswer_asked(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;
......
......@@ -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);
......
mediastreamer2 @ 2d8f269f
Subproject commit af7bfe348919a44cec3f10cc3a3b5ade3483784f
Subproject commit 2d8f269f26a6e945ed1b7bfe7d880877b93875a7
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