Codec negociation

Hello

i’m trying to use incoming_call_offer_pref in pfsip.conf but the result for remote and remote_first seems wrong

According to the the SIP SDP and the pjsip config here under, should the result be g711a that is the first in the SDP and present in the conf ?

it’s g711u that is choosen :
ast_sip_session_create_joint_call_cap: ‘XXX’ Caps for incoming audio call with pref ‘remote_first’ - remote: (ulaw|gsm|g723|alaw|g722|g729) local: (g729|ulaw|alaw) joint: (ulaw)

Thanks for your help

SIP SDP
a=sendrecv
a=rtpmap:4 G723/8000
a=rtpmap:9 G722/8000
a=rtpmap:3 GSM/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:18 G729/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ssrc:1999845743 cname:496602cc2fec2dc5

pjsip.conf
allow = g729
allow = ulaw
allow = alaw

There is an issue open[1] and codec negotiation is still being worked on.

[1] [ASTERISK-29171] codec list in INVITE is reversed when using remote - Digium/Asterisk JIRA

Thank you for your feeedback

You haven’t included the m line, which is where the preferences are indicated.

It seems reasonable that, for an incoming call, the caller’s preferences should be honoured, if possible.

Here is the m line that show the same preference than the codec list
m=audio 4004 RTP/AVP 4 9 3 8 0 18 101
We can see that 8 (alaw) is before 0 (ulaw) but it’s ulaw that is choosen

As staten by jcolp, it’s a still open bug that is documented in JIRA