Skip to content

Commit

Permalink
Fix passing the auth AVPs from server to client.
Browse files Browse the repository at this point in the history
Fixes #134, testing still required.
  • Loading branch information
bogdan-iancu committed Apr 22, 2014
1 parent 5972f2d commit 4ccebfe
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions modules/b2b_entities/client.c
Expand Up @@ -226,6 +226,8 @@ str* client_new(client_info_t* ci,b2b_notify_t b2b_cback,
if(ci->dst_uri.len)
td.obp = ci->dst_uri;

td.avps = ci->avps;

tmb.setlocalTholder(&dlg->uac_tran);

/* send request */
Expand Down
1 change: 1 addition & 0 deletions modules/b2b_entities/dlg.h
Expand Up @@ -140,6 +140,7 @@ typedef struct client_info
str local_contact;
unsigned int cseq;
struct socket_info* send_sock;
struct usr_avp *avps;
}client_info_t;

typedef struct b2b_entry
Expand Down
14 changes: 14 additions & 0 deletions modules/b2b_logic/logic.c
Expand Up @@ -2640,6 +2640,7 @@ str* create_top_hiding_entities(struct sip_msg* msg, b2bl_cback_f cbf,
qvalue_t q;
str from_tag_gen= {0, 0};
str new_body={0, 0};
struct usr_avp **avp_head;

if(b2b_msg_get_from(msg, &from_uri, &from_dname)< 0 || b2b_msg_get_to(msg, &to_uri, params->flags)< 0)
{
Expand Down Expand Up @@ -2710,6 +2711,11 @@ str* create_top_hiding_entities(struct sip_msg* msg, b2bl_cback_f cbf,
ci.body = (body.s?&body:NULL);
ci.send_sock = msg->force_send_socket?msg->force_send_socket:msg->rcv.bind_address;
get_local_contact( ci.send_sock, &ci.local_contact);
/* grab all AVPs from the server side and push them into the client */
avp_head = get_avp_list( );
ci.avps = *avp_head;
*avp_head = 0;


dlginfo = tuple->servers[0]->dlginfo;
gen_fromtag(&dlginfo->callid, &dlginfo->fromtag, &ci.req_uri, msg, &from_tag_gen);
Expand Down Expand Up @@ -3015,6 +3021,7 @@ str* b2b_process_scenario_init(b2b_scenario_t* scenario_struct,
str to_uri={NULL, 0}, from_uri, from_dname;
int eno = 0;
str new_body={0, 0};
struct usr_avp **avp_head;

if(b2b_msg_get_from(msg, &from_uri, &from_dname)< 0 ||
b2b_msg_get_to(msg, &to_uri, params->flags)< 0)
Expand Down Expand Up @@ -3207,6 +3214,13 @@ str* b2b_process_scenario_init(b2b_scenario_t* scenario_struct,
ci.send_sock = msg->force_send_socket?
msg->force_send_socket:msg->rcv.bind_address;
get_local_contact( ci.send_sock, &ci.local_contact);
if (clients_no==0) {
/* grab all AVPs from the server side and push them
* into the first client */
avp_head = get_avp_list( );
ci.avps = *avp_head;
*avp_head = 0;
}

if (str2int( &(get_cseq(msg)->number), &ci.cseq)!=0 )
{
Expand Down

0 comments on commit 4ccebfe

Please sign in to comment.