Commit 66de4dc0 authored by jehan's avatar jehan

fix refresher issue when forced refreshed is chalanged

parent c82f25ab
......@@ -40,6 +40,7 @@ const char *belle_sip_transaction_get_branch_id(const belle_sip_transaction_t *t
belle_sip_transaction_state_t belle_sip_transaction_get_state(const belle_sip_transaction_t *t);
void belle_sip_transaction_terminate(belle_sip_transaction_t *t);
BELLESIP_EXPORT belle_sip_request_t *belle_sip_transaction_get_request(const belle_sip_transaction_t *t);
BELLESIP_EXPORT belle_sip_response_t *belle_sip_transaction_get_response(const belle_sip_transaction_t *t);
BELLESIP_EXPORT belle_sip_dialog_t* belle_sip_transaction_get_dialog(const belle_sip_transaction_t *t);
BELLESIP_EXPORT void belle_sip_server_transaction_send_response(belle_sip_server_transaction_t *t, belle_sip_response_t *resp);
......
......@@ -153,7 +153,7 @@ int belle_sip_refresher_refresh(belle_sip_refresher_t* refresher,int expires) {
belle_sip_header_contact_t* contact;
/*first remove timer if any*/
belle_sip_refresher_stop(refresher);
refresher->expires=expires;
if (!dialog) {
/*create new request*/
request=belle_sip_client_transaction_create_authenticated_request(refresher->transaction);
......@@ -179,10 +179,10 @@ int belle_sip_refresher_refresh(belle_sip_refresher_t* refresher,int expires) {
/*update expires in any cases*/
expires_header = belle_sip_message_get_header_by_type(request,belle_sip_header_expires_t);
if (expires_header)
belle_sip_header_expires_set_expires(expires_header,expires);
belle_sip_header_expires_set_expires(expires_header,refresher->expires);
contact=belle_sip_message_get_header_by_type(request,belle_sip_header_contact_t);
if (belle_sip_header_contact_get_expires(contact)>=0)
belle_sip_header_contact_set_expires(contact,expires);
belle_sip_header_contact_set_expires(contact,refresher->expires);
client_transaction = belle_sip_provider_create_client_transaction(prov,request);
client_transaction->base.is_internal=1;
......
......@@ -92,7 +92,9 @@ void belle_sip_transaction_terminate(belle_sip_transaction_t *t){
belle_sip_request_t *belle_sip_transaction_get_request(const belle_sip_transaction_t *t){
return t->request;
}
belle_sip_response_t *belle_sip_transaction_get_response(const belle_sip_transaction_t *t) {
return t->last_response;
}
void belle_sip_transaction_notify_timeout(belle_sip_transaction_t *t){
belle_sip_timeout_event_t ev;
ev.source=t->provider;
......
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