diff options
author | Harald Welte <laforge@gnumonks.org> | 2010-07-19 19:54:16 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2010-07-19 19:54:16 +0200 |
commit | e7c849d4f064f956d8e2125ed900d61c00efb16a (patch) | |
tree | 35cad350f23c1f3661a8e0b3b1fa52b5691fb52d | |
parent | fead1fffd4960c1f30eba7cec7c6e39209674b00 (diff) |
implement TC-U-CANCEL.req
-rw-r--r-- | src/csl_cha_cco.c | 14 | ||||
-rw-r--r-- | src/tcap.h | 7 | ||||
-rw-r--r-- | src/tcu.c | 4 |
3 files changed, 22 insertions, 3 deletions
diff --git a/src/csl_cha_cco.c b/src/csl_cha_cco.c index fca653a..474cd7b 100644 --- a/src/csl_cha_cco.c +++ b/src/csl_cha_cco.c @@ -122,6 +122,20 @@ int tcap_cha_tc_invoke_req(struct tcap_dialogue *td, uint8_t op_class, int8_t in } /* TC-U-CANCEL.req (TCU -> CHA) */ +int tcap_cha_tc_cancel_req(struct tcap_dialogue *td, int8_t inv_id) +{ + struct tcap_invocation *ti = tcap_ism_lookup(td, inv_id); + + if (!ti || ti->state != TCAP_IS_IDLE) + return -EINVAL; + + /* FIXME: Iterate over Component list of this dialogue + * and evict any INVOKE component */ + + tcap_ism_terminate(ti); + + return 0; +} /* Dialogue Terminated (CHA <- DHA) */ int tcap_cha_dialg_term(struct tcap_dialogue *td) @@ -151,9 +151,12 @@ int tcap_cha_tc_u_error_req(struct tcap_dialogue *td, int8_t inv_id, /* Dialogue Terminated (CHA <- DHA) */ int tcap_cha_dialg_term(struct tcap_dialogue *td); +/* TC-U-CANCEL.req (TCU -> CHA) */ +int tcap_cha_tc_cancel_req(struct tcap_dialogue *td, int8_t inv_id); + /* TC-RESULT-NL / TC-RESULT-L req (TCL -> CHA) */ -int tcap_cha_tc_result_l_req(struct tcap_dialogue *td, int8_t inv_id, int last, - struct OPERATION *op, uint8_t *param, uint32_t param_len); +int tcap_cha_tc_result_req(struct tcap_dialogue *td, int8_t inv_id, int last, + struct OPERATION *op, uint8_t *param, uint32_t param_len); /* TC-U-REJECT.req (TCU -> CHA) */ int tcap_cha_tc_u_rej_req(struct tcap_dialogue *td, int8_t *invoke_id, @@ -387,7 +387,7 @@ LIB_EXPORTED int tcap_user_req_comp(enum tcap_primitive prim, struct tcap_compon case TCAP_PR_TC_RESULT_L: op = generate_op(td, tcci); rc = tcap_cha_tc_result_req(td, tcci->invoke_id, 1, op, - &tcci->parameter.data, tcci->parameter.data_len); + tcci->parameter.data, tcci->parameter.data_len); break; case TCAP_PR_TC_RESULT_NL: op = generate_op(td, tcci); @@ -403,6 +403,8 @@ LIB_EXPORTED int tcap_user_req_comp(enum tcap_primitive prim, struct tcap_compon tcci->reject.problem_code); break; case TCAP_PR_TC_CANCEL: + rc = tcap_cha_tc_cancel_req(td, tcci->invoke_id); + break; case TCAP_PR_TC_TIMER_RESET: default: fprintf(stderr, "unsupported dialogue primitive %s\n", tcap_prim_name(prim)); |