Skip to content

Commit 56d91a4

Browse files
committed
b2b_entities: enable reINVITE authentication
1 parent b257123 commit 56d91a4

File tree

1 file changed

+45
-0
lines changed
  • modules/b2b_entities

1 file changed

+45
-0
lines changed

modules/b2b_entities/dlg.c

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3256,6 +3256,51 @@ void b2b_tm_cback(struct cell *t, b2b_table htable, struct tmcb_params *ps)
32563256
LM_DBG("Non final negative reply for reINVITE\n");
32573257
current_dlg = dlg;
32583258
dlg_state = dlg->state;
3259+
if(uac_auth_loaded)
3260+
{
3261+
switch(statuscode)
3262+
{
3263+
case WWW_AUTH_CODE:
3264+
parse_www_authenticate_header(msg,
3265+
DAUTH_AHFM_ANYSUP, &auth);
3266+
break;
3267+
case PROXY_AUTH_CODE:
3268+
parse_proxy_authenticate_header(msg,
3269+
DAUTH_AHFM_ANYSUP, &auth);
3270+
break;
3271+
}
3272+
ret = RETURN_CONTINUE;
3273+
if(auth)
3274+
ret = b2b_send_indlg_auth_req(statuscode, auth, msg, t, dlg, etype, b2b_key);
3275+
switch(ret)
3276+
{
3277+
case RETURN_GOTO_DONE:
3278+
goto done;
3279+
break;
3280+
case RETURN_GOTO_ERROR:
3281+
B2BE_LOCK_RELEASE(htable, hash_index);
3282+
goto error;
3283+
break;
3284+
case RETURN_CONTINUE:
3285+
break;
3286+
case RETURN_GOTO_B2B_ROUTE:
3287+
B2BE_LOCK_RELEASE(htable, hash_index);
3288+
3289+
/* run the b2b route */
3290+
if(ref_script_route_is_valid(reply_route_ref)) {
3291+
msg->flags = t->uac[0].br_flags;
3292+
swap_route_type(old_route_type, ONREPLY_ROUTE);
3293+
run_top_route(sroutes->request[reply_route_ref->idx], msg);
3294+
set_route_type(old_route_type);
3295+
b2b_apply_lumps(msg);
3296+
}
3297+
goto b2b_route;
3298+
break;
3299+
default:
3300+
LM_ERR("Unexpected return code [%d] from b2b_send_indlg_auth_req()\n", ret);
3301+
goto error;
3302+
}
3303+
}
32593304
B2BE_LOCK_RELEASE(htable, hash_index);
32603305
if(msg == FAKED_REPLY)
32613306
goto dummy_reply;

0 commit comments

Comments
 (0)