implement support for TC-UNI.req
This commit is contained in:
parent
ebe4d4bb33
commit
b03abafcc4
|
@ -11,6 +11,7 @@
|
|||
#include <osmocom/tcap/TCMessage.h>
|
||||
#include <osmocom/tcap/ExternalPDU.h>
|
||||
#include <osmocom/tcap/DialoguePDU.h>
|
||||
#include <osmocom/tcap/UniDialoguePDU.h>
|
||||
|
||||
#include "tcap.h"
|
||||
|
||||
|
@ -25,19 +26,55 @@ static BIT_STRING_t dial_version1 = {
|
|||
/* TC-UNI.req from TCU */
|
||||
int tcap_csl_tc_uni_req(struct tcap_dialogue *td, OBJECT_IDENTIFIER_t *app_ctx, struct user_information *user_info)
|
||||
{
|
||||
struct TCMessage tcm;
|
||||
struct ComponentPortion cp;
|
||||
ExternalPDU_t ext;
|
||||
UniDialoguePDU_t dial;
|
||||
ANY_t any;
|
||||
struct tcap_invocation *ti;
|
||||
uint32_t trans_id, comp_count = 0;
|
||||
int rc;
|
||||
|
||||
if (app_ctx || user_info) {
|
||||
if (app_ctx) {
|
||||
AUDT_apdu_t *audt;
|
||||
/* build AUDT apdu */
|
||||
memset(&dial, 0, sizeof(dial));
|
||||
dial.present = UniDialoguePDU_PR_unidialoguePDU;
|
||||
audt = &dial.choice.unidialoguePDU;
|
||||
if (user_info)
|
||||
audt->user_information = user_info;
|
||||
memcpy(&audt->application_context_name, app_ctx, sizeof(audt->application_context_name));
|
||||
audt->protocol_version = &dial_version1;
|
||||
|
||||
fprintf(stdout, "\nDialogue portion:\n");
|
||||
xer_fprint(stdout, &asn_DEF_UniDialoguePDU, &dial);
|
||||
|
||||
memset(&ext, 0, sizeof(ext));
|
||||
ANY_fromType(&ext.dialog, &asn_DEF_UniDialoguePDU, &dial);
|
||||
ANY_fromType(&any, &asn_DEF_ExternalPDU, &ext);
|
||||
tcm.choice.begin.dialoguePortion = (OCTET_STRING_t *) &any;
|
||||
}
|
||||
/* Request components to CHA */
|
||||
/* Process components */
|
||||
memset(&cp, 0, sizeof(cp));
|
||||
llist_for_each_entry(ti, &td->ism_list, list) {
|
||||
if (!ti->comp)
|
||||
continue;
|
||||
|
||||
ASN_SEQUENCE_ADD(&cp.list, ti->comp);
|
||||
comp_count++;
|
||||
}
|
||||
/* Assemble TSL user data */
|
||||
if (comp_count)
|
||||
tcm.choice.begin.components = &cp;
|
||||
|
||||
/* TR-UNI-REQ to TSL */
|
||||
//rc = tcap_tco_tr_uni_req(&td->trans, tcm, mse);
|
||||
rc = tcap_tco_tr_uni_req(&td->trans, &tcm);
|
||||
/* Dialogue terminated to CHA */
|
||||
tcap_cha_dialg_term(td);
|
||||
/* Free Dialogue ID */
|
||||
/* FIXME: Free Dialogue ID */
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
/* TC-BEGIN.req from TCU */
|
||||
|
@ -285,13 +322,14 @@ int tcap_csl_tc_end_req(struct tcap_dialogue *td, OBJECT_IDENTIFIER_t *app_ctx,
|
|||
rc = tcap_tco_tr_end_req(&td->trans, &tcm);
|
||||
/* Dialogue terminated to CHA */
|
||||
tcap_cha_dialg_term(td);
|
||||
/* Free Dialogue ID */
|
||||
/* FIXME: Free Dialogue ID */
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
/* TC-U-APORT.req from TCU */
|
||||
int tcap_csl_tc_u_abort_req(struct tcap_dialogue *td, uint32_t *abrt_reason, OBJECT_IDENTIFIER_t *app_ctx, struct user_information *user_info)
|
||||
int tcap_csl_tc_u_abort_req(struct tcap_dialogue *td, uint32_t *abrt_reason,
|
||||
OBJECT_IDENTIFIER_t *app_ctx, struct user_information *user_info)
|
||||
{
|
||||
struct tcap_transaction *tt = &td->trans;
|
||||
void *app_ctx_mode;
|
||||
|
|
Loading…
Reference in New Issue