actually call the DER encoder for TC-END message

This commit is contained in:
Harald Welte 2010-07-20 12:23:08 +02:00
parent 933af61ba5
commit fa4f469558
1 changed files with 13 additions and 0 deletions

View File

@ -141,6 +141,7 @@ int tcap_tsm_end_trans(struct tcap_transaction *tt, struct TCMessage *tcmsg)
{
struct tcap_dialogue *td = dialg_by_trans(tt);
struct msgb *msg;
asn_enc_rval_t ar;
int rc;
switch (tt->state) {
@ -149,6 +150,18 @@ int tcap_tsm_end_trans(struct tcap_transaction *tt, struct TCMessage *tcmsg)
if (1 /* FIXME: !prearranged */) {
/* FIXME: Assemble TR-portion of END message */
msg = tcap_msgb_alloc();
fprintf(stdout, "TC-CONTINUE.req:\n");
xer_fprint(stdout, &asn_DEF_TCMessage, tcmsg);
/* Assemble TR-portion of CONTINUE message */
ar = der_encode_to_buffer(&asn_DEF_TCMessage, tcmsg, msg->data, msgb_tailroom(msg));
if (ar.encoded < 0) {
fprintf(stdout, "some error during encode\n");
msgb_free(msg);
return -EIO;
}
msgb_put(msg, ar.encoded);
/* Send N-UNITDATA.req to SCCP / SUA */
rc = tcap_scXp_n_unitdata_req(td->transp_ent, msg);
}