linphone_address_clean(from);
linphone_core_get_local_ip(lc,linphone_address_get_domain(from),call->localip);
linphone_call_init_common(call, from, to);
+ call->log->call_id=ms_strdup(sal_op_get_call_id(op)); /*must be known at that time*/
linphone_core_init_default_params(lc, &call->params);
call->params.has_video &= !!lc->video_policy.automatically_accept;
call->params.has_video &= linphone_core_media_description_contains_video_stream(sal_call_get_remote_media_description(op));
if (cl->refkey) lp_config_set_string(cfg,logsection,"refkey",cl->refkey);
lp_config_set_float(cfg,logsection,"quality",cl->quality);
lp_config_set_int(cfg,logsection,"video_enabled", cl->video_enabled);
+ lp_config_set_string(cfg,logsection,"call_id",cl->call_id);
}
for(;i<lc->max_call_logs;++i){
snprintf(logsection,sizeof(logsection),"call_log_%i",i);
if (tmp) cl->refkey=ms_strdup(tmp);
cl->quality=lp_config_get_float(cfg,logsection,"quality",-1);
cl->video_enabled=lp_config_get_int(cfg,logsection,"video_enabled",0);
+ cl->call_id=lp_config_get_string(cfg,logsection,"call_id",NULL);
+ if(cl->call_id) cl->call_id=ms_strdup(cl->call_id);
lc->call_logs=ms_list_append(lc->call_logs,cl);
}else break;
}
if (cl->from!=NULL) linphone_address_destroy(cl->from);
if (cl->to!=NULL) linphone_address_destroy(cl->to);
if (cl->refkey!=NULL) ms_free(cl->refkey);
+ if (cl->call_id) ms_free((void*)cl->call_id);
ms_free(cl);
}
real_url=linphone_address_as_string(call->log->to);
from=linphone_address_as_string(call->log->from);
err=sal_call(call->op,from,real_url);
+ call->log->call_id=ms_strdup(sal_op_get_call_id(call->op)); /*must be known at that time*/
if (lc->sip_conf.sdp_200_ack){
call->media_pending=TRUE;
LinphoneCallStatus status; /**< The status of the call*/
LinphoneAddress *from; /**<Originator of the call as a LinphoneAddress object*/
LinphoneAddress *to; /**<Destination of the call as a LinphoneAddress object*/
- char start_date[128]; /**<Human readable string containg the start date*/
+ char start_date[128]; /**<Human readable string containing the start date*/
int duration; /**<Duration of the call in seconds*/
char *refkey;
void *user_pointer;
int video_enabled;
struct _LinphoneCore *lc;
time_t start_date_time; /**Start date of the call in seconds as expressed in a time_t */
+ const char* call_id; /**unique id of a call*/
} LinphoneCallLog;
const char *sal_op_get_network_origin(const SalOp *op){
return ((SalOpBase*)op)->origin;
}
-
+const char* sal_op_get_call_id(const SalOp *op) {
+ return ((SalOpBase*)op)->call_id;
+}
void __sal_op_init(SalOp *b, Sal *sal){
memset(b,0,sizeof(SalOpBase));
((SalOpBase*)b)->root=sal;
sal_media_description_unref(b->local_media);
if (b->remote_media)
sal_media_description_unref(b->remote_media);
+ if (b->call_id)
+ ms_free((void*)b->call_id);
ms_free(op);
}
SalMediaDescription *local_media;
SalMediaDescription *remote_media;
void *user_pointer;
+ const char* call_id;
} SalOpBase;
/*returns far-end "User-Agent" string */
const char *sal_op_get_remote_ua(const SalOp *op);
void *sal_op_get_user_pointer(const SalOp *op);
+const char* sal_op_get_call_id(const SalOp *op);
/*Call API*/
int sal_call_set_local_media_description(SalOp *h, SalMediaDescription *desc);
int err;
const char *route;
osip_message_t *invite=NULL;
+ osip_call_id_t *callid;
sal_op_set_from(h,from);
sal_op_set_to(h,to);
sal_exosip_fix_route(h);
ms_error("Fail to send invite ! Error code %d", err);
return -1;
}else{
+ callid=osip_message_get_call_id(invite);
+ osip_call_id_to_str(callid,(char **)(&h->base.call_id));
sal_add_call(h->base.root,h);
}
return 0;
osip_call_info_t *call_info;
char *tmp;
sdp_message_t *sdp=eXosip_get_sdp_info(ev->request);
+ osip_call_id_t *callid=osip_message_get_call_id(ev->request);
+ osip_call_id_to_str(callid,(char**)(&op->base.call_id));
set_network_origin(op,ev->request);
set_remote_ua(op,ev->request);
op->tid=ev->tid;
op->cid=ev->cid;
op->did=ev->did;
-
sal_add_call(op->base.root,op);
sal->callbacks.call_received(op);
}
* @return the call duration, in seconds
*/
public int getCallDuration();
+ /**
+ * @return the call id from signaling
+ */
+ public int getCallId();
}