MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / b2bl_script_init_request

Function b2bl_script_init_request

modules/b2b_logic/logic.c:3481–3528  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3479
3480
3481int b2bl_script_init_request(struct sip_msg *msg, str *id, struct b2b_params *init_params,
3482 void *req_route_ref, void *reply_route_ref)
3483{
3484 str* key;
3485 str auth_header;
3486 str* cust_headers;
3487 int ret = -1;
3488
3489 if (cur_route_ctx.flags & (B2BL_RT_REQ_CTX|B2BL_RT_RPL_CTX)) {
3490 LM_ERR("The 'b2b_init_request' function cannot be used from the "
3491 "b2b_logic dedicated routes\n");
3492 return -1;
3493 }
3494
3495 if (b2bl_key_avp_name >= 0)
3496 destroy_avps( b2bl_key_avp_type, b2bl_key_avp_name, 1);
3497
3498 b2b_api.apply_lumps(msg);
3499
3500 cust_headers = NULL;
3501 if (init_params->flags & B2BL_FLAG_TRANSPARENT_AUTH)
3502 {
3503 if (msg->authorization)
3504 {
3505 auth_header.s = msg->authorization->name.s;
3506 auth_header.len = msg->authorization->len;
3507 cust_headers = &auth_header;
3508 }
3509 if (msg->proxy_auth)
3510 {
3511 auth_header.s = msg->proxy_auth->name.s;
3512 auth_header.len = msg->proxy_auth->len;
3513 cust_headers = &auth_header;
3514 }
3515 }
3516
3517 init_params->id = id;
3518 init_params->req_route = req_route_ref ?
3519 (struct script_route_ref *)req_route_ref : global_req_rt_ref;
3520 init_params->reply_route = reply_route_ref ?
3521 (struct script_route_ref *)reply_route_ref : global_reply_rt_ref;
3522
3523 /* call the scenario init processing function */
3524 key = b2bl_init_request(msg, init_params, 0, NULL, 0, cust_headers);
3525 if(key) ret = 1;
3526
3527 return ret;
3528}
3529
3530static struct b2bl_new_entity *tmp_client_new(struct sip_msg *msg, str *id,
3531 str *dest_uri, str *proxy, pv_spec_t *hnames, pv_spec_t *hvals, str *from_dname)

Callers

nothing calls this directly

Calls 2

destroy_avpsFunction · 0.85
b2bl_init_requestFunction · 0.85

Tested by

no test coverage detected