You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
libtcap/tests/encode.c

31 lines
608 B

#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include "libtcap.h"
#include "TCMessage.h"
#include "ComponentPortion.h"
#include "Component.h"
#include "ConnectArg.h"
#include "CalledPartyNumber.h"
int main() {
char *buf;
int ret;
const uint8_t number[] = "1234567890";
ret = tcap_encode_with_routing(&buf, number, sizeof(number) - 1);
fprintf(stderr, "ret: %i\n", ret);
if (ret < 0) {
fprintf(stderr, "failed to encode tcap\n");
} else {
printf("buffer: ");
for (int i = 0; i < ret; i++)
printf("0x%02x ", (unsigned char)buf[i]);
printf("\n");
}
free(buf);
return 0;
}