int sal_message_send(SalOp *op, const char *from, const char *to, const char* content_type, const char *msg){
osip_message_t *sip=NULL;
- time_t t=time(NULL);
- char buf[26];
+ char t[26];
+ time_t curtime=time(NULL);
+
+ my_ctime_r(&curtime,t);
if(op->cid == -1)
{
sal_op_get_from(op),sal_op_get_route(op));
if (sip!=NULL){
sal_exosip_add_custom_headers(sip,op->base.custom_headers);
- osip_message_set_date(sip,my_ctime_r(&t,buf));
+ osip_message_set_date(sip,t);
osip_message_set_content_type(sip,content_type);
if (msg) osip_message_set_body(sip,msg,strlen(msg));
sal_add_other(op->base.root,op,sip);
eXosip_unlock();
return -1;
}
+ sal_exosip_add_custom_headers(sip,op->base.custom_headers);
+ osip_message_set_date(sip,t);
osip_message_set_content_type(sip,content_type);
if (msg) osip_message_set_body(sip,msg,strlen(msg));
eXosip_call_send_request(op->did,sip);
mk_presence_body (presence_mode, from, buf, sizeof (buf), presence_style);
- i = eXosip_build_publish(&pub,from, to, NULL, "presence", "300",
+ i = eXosip_build_publish(&pub,from, to, sal_op_get_route(op), "presence", "300",
presence_style ? "application/xpidf+xml" : "application/pidf+xml", buf);
if (i<0){
ms_warning("Failed to build publish request.");