# Codec negotiation on Reinvite (version 18)

**URL:** <https://community.asterisk.org/t/codec-negotiation-on-reinvite-version-18/87716>\
**Category:** Asterisk SIP\
**Created:** [February 26, 2021, 9:38pm UTC](https://community.asterisk.org/t/codec-negotiation-on-reinvite-version-18/87716 "2021-02-26T21:38:35Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![quintana](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/quintana/32/4382_2.png) [@quintana](https://community.asterisk.org/u/quintana)\
**Post date:** [February 26, 2021, 9:38pm UTC](https://community.asterisk.org/t/codec-negotiation-on-reinvite-version-18/87716/1 "2021-02-26T21:38:35Z")

</div>

Hello,

On Asterisk 18.2 when you sent a reinvite in mid-call looks like Asterisk make a response with a different codecs ordering and change the codec for the call. Is there is a specific changes or configuration for asterisk 18 about that ? I don’t remember the 17 version have the same behaviour.

 ![Screen Shot 2021-02-26 at 4.20.00 PM](https://global.discourse-cdn.com/asterisk/original/2X/9/922e7f19d5b0fbbb05aa4127a72205febe7ba3fd.png)

Thanks fo the feedback.

---

<div class="post-metadata">

**Author:** ![jcolp](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/jcolp/32/8848_2.png) [@jcolp](https://community.asterisk.org/u/jcolp)\
**Post date:** [February 26, 2021, 9:50pm UTC](https://community.asterisk.org/t/codec-negotiation-on-reinvite-version-18/87716/2 "2021-02-26T21:50:19Z")

</div>

There isn’t enough information here to be able to answer that. Asterisk logging would show the actual codec negotiation that is going on and why it is doing what it is doing. In general, though, the behavior should be the same.

---

<div class="post-metadata">

**Author:** ![quintana](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/quintana/32/4382_2.png) [@quintana](https://community.asterisk.org/u/quintana)\
**Post date:** [February 26, 2021, 9:53pm UTC](https://community.asterisk.org/t/codec-negotiation-on-reinvite-version-18/87716/3 "2021-02-26T21:53:22Z")

</div>

Ok thank you for your feedback, what logs or traces i need to check or share to help to understand this behavior?

---

<div class="post-metadata">

**Author:** ![quintana](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/quintana/32/4382_2.png) [@quintana](https://community.asterisk.org/u/quintana)\
**Post date:** [February 26, 2021, 10:06pm UTC](https://community.asterisk.org/t/codec-negotiation-on-reinvite-version-18/87716/4 "2021-02-26T22:06:12Z")

</div>

ok i check the CLI logging and i got:

`[2021-02-26 23:04:37.1160] DEBUG[26090][C-00000004]: chan_pjsip.c:883 chan_pjsip_read_stream: Oooh, got a frame with format of ulaw on channel 'PJSIP/kjs6nq5s-0000000a' when we're sending 'opus', switching to match`

---

<div class="post-metadata">

**Author:** ![jcolp](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/jcolp/32/8848_2.png) [@jcolp](https://community.asterisk.org/u/jcolp)\
**Post date:** [February 26, 2021, 10:33pm UTC](https://community.asterisk.org/t/codec-negotiation-on-reinvite-version-18/87716/5 "2021-02-26T22:33:46Z")

</div>

If debug is enabled then the res\_pjsip\_sdp\_rtp module will output information about the negotiation process, including codecs, when it occurs. I don’t have a specific thing to point at because you have to look at everything as a whole - configuration, the SDP aspect, the debug messages, and see what precisely is going on and where it may be going wrong. The wiki[1] has information on collecting debug logs. The precise configuration would also be needed.

[1] [Collecting Debug Information - Asterisk Project - Asterisk Project Wiki](https://wiki.asterisk.org/wiki/display/AST/Collecting+Debug+Information)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/asterisk/original/2X/4/475d0c889911cfb84ac4881ad6df8b523e3f9105.png) [@system](https://community.asterisk.org/u/system)\
**Post date:** [March 28, 2021, 10:34pm UTC](https://community.asterisk.org/t/codec-negotiation-on-reinvite-version-18/87716/6 "2021-03-28T22:34:24Z")

</div>

Closed on March 28, 2021, 10:34pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
