68 lines
1.3 KiB
C
68 lines
1.3 KiB
C
|
|
#include <stdint.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
#include "tcap_user.h"
|
|
|
|
int tcap_user_ind_dialg(enum tcap_primitive prim, struct tcap_dialg_ind *tcdi)
|
|
{
|
|
printf("-> USER_IND_DIALG(%s)\n", tcap_prim_name(prim));
|
|
|
|
return 0;
|
|
}
|
|
|
|
int tcap_user_ind_comp(enum tcap_primitive prim, struct tcap_component_ind *tcci)
|
|
{
|
|
printf("-> USER_IND_COMP(%s)\n", tcap_prim_name(prim));
|
|
|
|
return 0;
|
|
}
|
|
|
|
static void tcap_gen_oper_local(struct OPERATION *op, uint32_t local_value)
|
|
{
|
|
op->present = OPERATION_PR_localValue;
|
|
asn_long2INTEGER(&op->choice.localValue, local_value);
|
|
}
|
|
|
|
static uint8_t invoke_parameter[8];
|
|
|
|
static int send_invoke(int8_t invoke_id)
|
|
{
|
|
struct tcap_component_ind tcci;
|
|
|
|
|
|
memset(&tcci, 0, sizeof(tcci));
|
|
tcci.dialg_id = 1234;
|
|
tcci.invoke_id = invoke_id;
|
|
tcci.linked_id = NULL;
|
|
tcap_gen_oper_local(&tcci.operation, 1);
|
|
tcci.timeout_secs = 10;
|
|
tcci.op_class = 1;
|
|
|
|
memset(invoke_parameter, invoke_id, sizeof(invoke_parameter));
|
|
tcci.parameter.buf = invoke_parameter;
|
|
tcci.parameter.size = sizeof(invoke_parameter);
|
|
|
|
return tcap_user_req_comp(TCAP_PR_TC_INVOKE, &tcci);
|
|
}
|
|
|
|
static int send_begin(void)
|
|
{
|
|
struct tcap_dialg_ind tcdi;
|
|
|
|
memset(&tcdi, 0, sizeof(tcdi));
|
|
tcdi.dialg_id = 1234;
|
|
|
|
return tcap_user_req_dialg(TCAP_PR_TC_BEGIN, &tcdi);
|
|
}
|
|
|
|
|
|
int main(int argc, char **argv)
|
|
{
|
|
send_invoke(0);
|
|
send_invoke(1);
|
|
send_invoke(-1);
|
|
send_begin();
|
|
}
|