[Offer]
v=0
o=alice 2890844526 2890844526 IN IP4 host.atlanta.example.com
s=
c=IN IP4 host.atlanta.example.com
t=0 0
m=audio 49170 RTP/AVP 0 8 97
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:97 iLBC/8000
m=video 51372 RTP/AVP 31 32
a=rtpmap:31 H261/90000
a=rtpmap:32 MPV/90000
[Answer]
v=0
o=bob 2808844564 2808844564 IN IP4 host.biloxi.example.com
s=
c=IN IP4 host.biloxi.example.com
t=0 0
m=audio 49172 RTP/AVP 0 8
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
m=video 0 RTP/AVP 31
a=rtpmap:31 H261/90000
I'm sending INVITE with 3 audio supported codecs, as result I receive 2 codecs which match my setup. PCMU and PCMA.
Which codec should I use eventually to avoid transcoding on the other side? I believe I can determine codec of incoming stream simply looking into the payload of RTP packet. However it's not clear which codec should I use to encode outgoing stream ? First from the list ? Any from the list ? Or same codec which was used for incoming stream
Is it ok if I encode outgoing stream with PCMA and decode incoming with PCMU ?
I disagree with Liviu and Rajesh.. You should be prepared to receive on BOTH (PCMU and PCMA) at any time. (They could alternate if the Far End wanted too). You have established and accepted BOTH codec.. I will presume you also ACK-ed both aswell.
If you want to have only a single Codec; you must re-invite with just the one you want to use. (See section 2.2 of RFC 4317) for the "second-Answer".
In the "real world" because both sides of the call are capable of using "Either" of the codec provided and agreed too, then picking the first is allowed. but you should be also allowing the second if the far end chooses to use it. And I dont think you provide for that. However; re-invite with only one codec, will ensure that only that one will ever be used.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With