Skip to content

Commit 862fa53

Browse files
committed
b2b: add support for pass-legs-upstream flag
1 parent 2810543 commit 862fa53

12 files changed

Lines changed: 466 additions & 80 deletions

File tree

modules/b2b_entities/b2b_entities.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -774,8 +774,8 @@ str *b2b_get_b2bl_key(str* callid, str* from_tag, str* to_tag, str* entity_key)
774774
tuple_key->len = dlg->logic_key.len;
775775
if (entity_key) {
776776
if (table == server_htable) {
777-
entity_key->s = to_tag->s;
778-
entity_key->len = to_tag->len;
777+
*entity_key = *to_tag;
778+
b2b_get_server_entity_key(entity_key);
779779
} else {
780780
entity_key->s = callid->s;
781781
entity_key->len = callid->len;
@@ -836,6 +836,7 @@ int b2b_entities_bind(b2b_api_t* api)
836836
api->get_b2bl_key = b2b_get_b2bl_key;
837837
api->apply_lumps = b2b_apply_lumps;
838838
api->get_context = b2b_get_context;
839+
api->get_reply_leg = b2b_get_reply_leg;
839840

840841
return 0;
841842
}
@@ -1057,4 +1058,3 @@ static mi_response_t *mi_b2be_list(const mi_params_t *params,
10571058
free_mi_response(resp);
10581059
return NULL;
10591060
}
1060-

modules/b2b_entities/b2be_load.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ typedef struct b2b_req_data
100100
unsigned int maxfwd;
101101
unsigned int no_cb;
102102
str *contact_hdr_params;
103+
int leg_idx;
103104
}b2b_req_data_t;
104105

105106
typedef struct b2b_rpl_data
@@ -114,6 +115,7 @@ typedef struct b2b_rpl_data
114115
str* contact_hdr_params;
115116
str* contact;
116117
b2b_dlginfo_t* dlginfo;
118+
int leg_idx;
117119
}b2b_rpl_data_t;
118120

119121

@@ -169,6 +171,8 @@ typedef str *(*b2b_get_b2bl_key_t)(str* callid, str* from_tag, str* to_tag,
169171
typedef int (*b2b_apply_lumps_t)(struct sip_msg* msg);
170172

171173
typedef void* (*b2b_get_context_t)(void);
174+
typedef int (*b2b_get_reply_leg_t)(enum b2b_entity_type et, str *b2b_key,
175+
str *to_tag);
172176

173177
typedef struct b2b_api
174178
{
@@ -185,6 +189,7 @@ typedef struct b2b_api
185189
b2b_get_b2bl_key_t get_b2bl_key;
186190
b2b_apply_lumps_t apply_lumps;
187191
b2b_get_context_t get_context;
192+
b2b_get_reply_leg_t get_reply_leg;
188193
}b2b_api_t;
189194

190195
typedef int(*load_b2b_f) (b2b_api_t* api);

0 commit comments

Comments
 (0)