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

Function script_trigger_scenario

modules/b2b_logic/logic.c:3620–3876  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3618}
3619
3620int script_trigger_scenario(struct sip_msg* msg, str *id, str * params,
3621 str *ent1, pv_spec_t *ent1_hnames, pv_spec_t *ent1_hvals,
3622 str *ent2, pv_spec_t *ent2_hnames, pv_spec_t *ent2_hvals)
3623{
3624 csv_record *list1 = NULL, *list2 = NULL, *param_list = NULL;
3625 int rc = -1;
3626 int ret;
3627 str *s;
3628 str *e1_id = NULL, *e2_id = NULL;
3629 str *e1_to = NULL, *e2_to = NULL;
3630 str *e1_proxy = NULL, *e2_proxy = NULL;
3631 str *e1_dname = NULL, *e2_dname = NULL;
3632 unsigned int hash_index, local_index, remote_tuple_hash_index;
3633 b2bl_tuple_t* tuple= NULL;
3634 b2bl_tuple_t* cur_tuple= NULL;
3635 str* b2bl_key;
3636 struct b2bl_new_entity *new_br_ent[2] = {NULL, NULL};
3637 struct b2b_params init_params;
3638 b2bl_entity_id_t *entity;
3639 b2bl_entity_id_t** entity_head = NULL;
3640
3641 str * remote_tuple = NULL;
3642 int remote_tuple_party = 0;
3643
3644 memset(&init_params, 0, sizeof init_params);
3645 init_params.id = id;
3646 init_params.req_route = global_req_rt_ref;
3647 init_params.reply_route = global_reply_rt_ref;
3648
3649 list1 = parse_csv_record(ent1);
3650 if (!list1) {
3651 LM_ERR("Failed to parse CSV record for entitity 1: %.*s\n", ent1->len, ent1->s);
3652 rc = -1;
3653 goto end;
3654 }
3655
3656 s = &list1->s;
3657 if (!s->s || !s->len) {
3658 LM_ERR("Failed to parse CSV record for entitity 1: %.*s - no entity name (first parameter)\n", ent1->len, ent1->s);
3659 rc = -1;
3660 goto end;
3661 }
3662 e1_id = s;
3663
3664 s = list1->next ? &list1->next->s : NULL;
3665 if (!s || !s->s || !s->len) {
3666 LM_ERR("Failed to parse CSV record for entitity 1: %.*s - no to_uri (second parameter)\n", ent1->len, ent1->s);
3667 rc = -1;
3668 goto end;
3669 }
3670 e1_to = s;
3671
3672 s = list1->next->next ? &list1->next->next->s : NULL;
3673 if (s && s->s && s->len) {
3674 e1_proxy = s;
3675 s = list1->next->next->next ? &list1->next->next->next->s : NULL;
3676 if (s && s->s && s->len) {
3677 e1_dname = s;

Callers

nothing calls this directly

Calls 10

tmp_client_newFunction · 0.85
core_hashFunction · 0.85
b2bl_insert_newFunction · 0.85
get_ticksFunction · 0.85
b2bl_get_tuple_keyFunction · 0.85
b2bl_search_tuple_safeFunction · 0.85
send_bridge_notifyFunction · 0.85
b2bl_search_entityFunction · 0.85
b2bl_bridgeFunction · 0.85
free_csv_recordFunction · 0.85

Tested by

no test coverage detected