Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions modules/b2b_logic/b2b_logic.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ struct b2b_ctx_val *local_ctx_vals;

unsigned int ent_term_interval;
struct b2b_term_timer *ent_term_timer;
int use_lifetime_of_bridge = 0;

static const cmd_export_t cmds[]=
{
Expand Down Expand Up @@ -301,6 +302,7 @@ static const param_export_t params[]=
{"b2bl_th_init_timeout",INT_PARAM, &b2bl_th_init_timeout },
{"b2bl_early_update",INT_PARAM, &b2b_early_update },
{"old_entity_term_delay",INT_PARAM, &ent_term_interval },
{"use_lifetime_of_bridge",INT_PARAM, &use_lifetime_of_bridge },
{0, 0, 0 }
};

Expand Down
1 change: 1 addition & 0 deletions modules/b2b_logic/bridging.c
Original file line number Diff line number Diff line change
Expand Up @@ -1643,6 +1643,7 @@ int b2bl_bridge(struct sip_msg* msg, b2bl_tuple_t* tuple,

if (lifetime)
{
tuple->lifetime_bridge_flag = lifetime;
tuple->lifetime = lifetime + get_ticks();
LM_DBG("Lifetime defined = [%d]\n", tuple->lifetime);
}
Expand Down
13 changes: 9 additions & 4 deletions modules/b2b_logic/logic.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ extern struct b2b_ctx_val *local_ctx_vals;

extern int req_routeid;
extern int reply_routeid;
extern int use_lifetime_of_bridge;

struct b2bl_route_ctx cur_route_ctx;

Expand Down Expand Up @@ -161,10 +162,14 @@ int b2b_add_dlginfo(str* key, str* entity_key, int src, b2b_dlginfo_t* dlginfo,
return -1;
}
/* a connected call */
if(max_duration)
tuple->lifetime = get_ticks() + max_duration;
else
tuple->lifetime = 0;
if (tuple->lifetime_bridge_flag && use_lifetime_of_bridge) {
tuple->lifetime = get_ticks() + tuple->lifetime_bridge_flag;
} else {
if(max_duration)
tuple->lifetime = get_ticks() + max_duration;
else
tuple->lifetime = 0;
}
entity = b2bl_search_entity(tuple, entity_key, src, &ent_head);
if(entity == NULL)
{
Expand Down
1 change: 1 addition & 0 deletions modules/b2b_logic/records.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ typedef struct b2bl_tuple
struct b2bl_tuple* next;
struct b2bl_tuple* prev;
unsigned int lifetime;
unsigned int lifetime_bridge_flag;
str local_contact;
int db_flag;
int repl_flag; /* sent/received through entities replication */
Expand Down