summaryrefslogtreecommitdiffstats
path: root/src/tcu.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tcu.c')
-rw-r--r--src/tcu.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/tcu.c b/src/tcu.c
index e736d42..6bc8d74 100644
--- a/src/tcu.c
+++ b/src/tcu.c
@@ -249,6 +249,7 @@ static int _tcu_comp_ind(enum tcap_primitive prim, struct tcap_invocation *ti, s
tcci->dialg_id = ti->dialogue->dialogue_id;
tcci->invoke_id = ti->invoke_id;
+ tcpb->user_ref = ti->user_ref;
if (ti->linked_id) {
tcci->_linked_id = ti->_linked_id;
tcci->linked_id = &tcci->_linked_id;
@@ -361,19 +362,20 @@ static ErrorCode_t *generate_errcode(struct tcap_dialogue *td, struct tcap_compo
return err;
}
-LIB_EXPORTED int tcap_user_req_comp(enum tcap_primitive prim, struct tcap_component_ind *tcci)
+static int tcap_user_req_comp(struct tcap_prim_buf *tcpb)
{
+ struct tcap_component_ind *tcci = &tcpb->comp;
struct tcap_dialogue *td;
OPERATION_t *op = NULL;
ErrorCode_t *err = NULL;
int rc = 0;
- fprintf(stdout, "<- USER_REQ_COMP(%s)\n", tcap_prim_name(prim));
+ fprintf(stdout, "<- USER_REQ_COMP(%s)\n", tcap_prim_name(tcpb->prim));
/* Resolve (or allocate) the dialogue/transaction state */
td = tcap_dialg_by_dialg_id(tcci->dialg_id);
if (!td) {
- switch (prim) {
+ switch (tcpb->prim) {
case TCAP_PR_TC_INVOKE:
td = tcap_dialg_alloc(tcci->dialg_id);
break;
@@ -383,12 +385,13 @@ LIB_EXPORTED int tcap_user_req_comp(enum tcap_primitive prim, struct tcap_compon
}
/* Actually dispatch the primitive */
- switch (prim) {
+ switch (tcpb->prim) {
case TCAP_PR_TC_INVOKE:
op = generate_op(td, tcci);
rc = tcap_cha_tc_invoke_req(td, tcci->op_class, tcci->invoke_id,
tcci->linked_id, op, tcci->parameter.data,
- tcci->parameter.data_len, tcci->timeout_secs);
+ tcci->parameter.data_len, tcci->timeout_secs,
+ tcpb->user_ref);
break;
case TCAP_PR_TC_RESULT_L:
op = generate_op(td, tcci);
@@ -413,7 +416,7 @@ LIB_EXPORTED int tcap_user_req_comp(enum tcap_primitive prim, struct tcap_compon
break;
case TCAP_PR_TC_TIMER_RESET:
default:
- fprintf(stderr, "unsupported dialogue primitive %s\n", tcap_prim_name(prim));
+ fprintf(stderr, "unsupported dialogue primitive %s\n", tcap_prim_name(tcpb->prim));
return -EINVAL;
}
@@ -427,7 +430,7 @@ LIB_EXPORTED int tcap_user_req_comp(enum tcap_primitive prim, struct tcap_compon
LIB_EXPORTED int tcap_user_req(struct tcap_prim_buf *tcpb)
{
if (tcpb->prim > _TCAP_PR_COMP_BASE)
- return tcap_user_req_comp(tcpb->prim, &tcpb->comp);
+ return tcap_user_req_comp(tcpb);
else
return tcap_user_req_dialg(tcpb->prim, &tcpb->dialg);
}