ortp
ortp copied to clipboard
oRTP extension header usage
Hello,
I was checking out the RTP extension header functionality in oRTP and I am struggling to understand how to use it.
After establishing an RTP session with another client, this is how I tried to send RTP packets with an extension header in each (for testing purposes):
// ...
FILE *infile = fopen(wav_filename, "rb");
int i;
uint32_t user_ts = 0;
unsigned char buffer[160];
while ((i = fread(buffer, 1, 160, infile)) > 0)
{
// a)
mblk_t* packet = rtp_session_create_packet(session, RTP_FIXED_HEADER_SIZE, buffer, i);
// b)
// mblk_t* packet = rtp_session_create_packet(session, RTP_FIXED_HEADER_SIZE + 20, buffer, i);
// c)
// mblk_t* packet = rtp_session_create_packet(session, RTP_FIXED_HEADER_SIZE, NULL, 0);
// RFC 8285: One-byte header
int extension_id = 7;
char *data = "StringOfLength16";
uint8_t *ptr = (uint8_t *)(data);
rtp_add_extension_header(packet, extension_id, strlen(data), ptr);
rtp_session_sendm_with_ts(session, packet, user_ts);
user_ts += 160;
}
fclose(infile);
I also inspected the packets with Wireshark to see what happens and this is what I found out:
I would like to know how is one supposed to send a RTP packet with data and with extension header using oRTP, if that's possible.
I cloned oRTP from the git repo so I am using the newest version. I built oRTP as a static library and I'm using it on CentOS 8 VM.
Thank you and best regards, Patrick
@pnikic I have the same problem. Have you solved it? Thank you