Commit f9e07825 authored by Simon Morlat's avatar Simon Morlat
Browse files

enable generic publish not to be refreshed automatically

parent a1ec7d69
......@@ -96,6 +96,7 @@ struct SalOp{
bool_t auto_answer_asked;
bool_t sdp_offering;
bool_t call_released;
bool_t manual_refresher;
};
......
......@@ -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);
......
......@@ -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;
}
......@@ -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;
}
......
......@@ -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 =
......
......@@ -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);
......
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