From f9e0782528bd292ad35c3a3b2b66c4bd99338829 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Mon, 16 Sep 2013 20:30:34 +0200 Subject: [PATCH] enable generic publish not to be refreshed automatically --- coreapi/bellesip_sal/sal_impl.h | 1 + coreapi/bellesip_sal/sal_op_events.c | 1 + coreapi/bellesip_sal/sal_op_impl.c | 6 ++++++ coreapi/event.c | 1 + coreapi/help/Doxyfile.in | 2 +- include/sal/sal.h | 2 ++ 6 files changed, 12 insertions(+), 1 deletion(-) diff --git a/coreapi/bellesip_sal/sal_impl.h b/coreapi/bellesip_sal/sal_impl.h index befbb3fda..4b9120196 100644 --- a/coreapi/bellesip_sal/sal_impl.h +++ b/coreapi/bellesip_sal/sal_impl.h @@ -96,6 +96,7 @@ struct SalOp{ bool_t auto_answer_asked; bool_t sdp_offering; bool_t call_released; + bool_t manual_refresher; }; diff --git a/coreapi/bellesip_sal/sal_op_events.c b/coreapi/bellesip_sal/sal_op_events.c index b43e3d579..6f20c1f92 100644 --- a/coreapi/bellesip_sal/sal_op_events.c +++ b/coreapi/bellesip_sal/sal_op_events.c @@ -84,6 +84,7 @@ static void subscribe_response_event(void *op_base, const belle_sip_response_eve } if (expires>0){ op->refresher=belle_sip_client_transaction_create_refresher(client_transaction); + if (op->refresher) belle_sip_refresher_enable_manual_mode(op->refresher,op->manual_refresher); } if (sss==SalSubscribeNone) sss=SalSubscribeActive; /*without Subscription-state header, consider subscription is accepted.*/ op->base.root->callbacks.subscribe_response(op,sss,SalErrorNone,SalReasonUnknown); diff --git a/coreapi/bellesip_sal/sal_op_impl.c b/coreapi/bellesip_sal/sal_op_impl.c index e31ec7a4d..bf6b5f152 100644 --- a/coreapi/bellesip_sal/sal_op_impl.c +++ b/coreapi/bellesip_sal/sal_op_impl.c @@ -25,6 +25,7 @@ SalOp * sal_op_new(Sal *sal){ __sal_op_init(op,sal); op->type=SalOpUnknown; op->privacy=SalPrivacyNone; + op->manual_refresher=FALSE;/*tells that requests with expiry (SUBSCRIBE, PUBLISH) will be automatically refreshed*/ sal_op_ref(op); return op; } @@ -478,6 +479,7 @@ int sal_op_send_and_create_refresher(SalOp* op,belle_sip_request_t* req, int exp if ((op->refresher = belle_sip_client_transaction_create_refresher(op->pending_client_trans))) { belle_sip_refresher_set_listener(op->refresher,listener,op); belle_sip_refresher_set_retry_after(op->refresher,op->base.root->refresher_retry_after); + belle_sip_refresher_enable_manual_mode(op->refresher,op->manual_refresher); return 0; } else { return -1; @@ -573,3 +575,7 @@ bool_t sal_op_is_secure(const SalOp* op) { return from && to && strcasecmp("sips",sal_address_get_scheme(from))==0 && strcasecmp("sips",sal_address_get_scheme(to))==0; } + +void sal_op_set_manual_refresher_mode(SalOp *op, bool_t enabled){ + op->manual_refresher=enabled; +} diff --git a/coreapi/event.c b/coreapi/event.c index 557560011..5f850e0de 100644 --- a/coreapi/event.c +++ b/coreapi/event.c @@ -157,6 +157,7 @@ LinphoneEvent *linphone_core_publish(LinphoneCore *lc, const LinphoneAddress *re SalBody salbody; LinphoneEvent *lev=linphone_event_new(lc,LinphoneSubscriptionInvalidDir, event); linphone_configure_op(lc,lev->op,resource,NULL,lp_config_get_int(lc->config,"sip","publish_msg_with_contact",0)); + sal_op_set_manual_refresher_mode(lev->op,lp_config_get_int(lc->config,"sip","refresh_generic_publish",1)); sal_publish(lev->op,NULL,NULL,event,expires,sal_body_from_content(&salbody,body)); return lev; } diff --git a/coreapi/help/Doxyfile.in b/coreapi/help/Doxyfile.in index 03dbf91a0..dce1804b2 100644 --- a/coreapi/help/Doxyfile.in +++ b/coreapi/help/Doxyfile.in @@ -165,7 +165,7 @@ MAN_LINKS = NO #--------------------------------------------------------------------------- # configuration options related to the XML output #--------------------------------------------------------------------------- -GENERATE_XML = NO +GENERATE_XML = YES XML_OUTPUT = xml XML_SCHEMA = XML_DTD = diff --git a/include/sal/sal.h b/include/sal/sal.h index 4305e4df0..da97bf7ec 100644 --- a/include/sal/sal.h +++ b/include/sal/sal.h @@ -499,6 +499,8 @@ const char* sal_op_get_call_id(const SalOp *op); const SalAddress* sal_op_get_service_route(const SalOp *op); void sal_op_set_service_route(SalOp *op,const SalAddress* service_route); +void sal_op_set_manual_refresher_mode(SalOp *op, bool_t enabled); + /*Call API*/ int sal_call_set_local_media_description(SalOp *h, SalMediaDescription *desc); int sal_call(SalOp *h, const char *from, const char *to);