Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

oRTP extension header usage #10

Open
pnikic opened this issue Jun 12, 2020 · 1 comment
Open

oRTP extension header usage #10

pnikic opened this issue Jun 12, 2020 · 1 comment

Comments

@pnikic
Copy link

pnikic commented Jun 12, 2020

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:
1

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

@wmailn
Copy link

wmailn commented Oct 25, 2022

@pnikic I have the same problem. Have you solved it? Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants