I have an Asterisk 16.8.0 with PJSIP that I use as a gateway. The problem occurs as follows:
Leg A sends INVITE to Asterisk and Asterisk passes to Leg B.
Leg B responds to 100 trying and then to 183 SDP.
Asterisk sends to Leg A, 100 trying and twice the 183 SDP.
Your trace shows valid SIP protocol; there is no restriction on the number of 183s.
Note that Asterisk is a back to back user agent, not a proxy, so the 183s on the A side don’t have to correspond with one on the B side.
However, someone else recently had problems with this behaviour, so you should have a look through recent postings.
Also, where there is a real problem, it is almost always essential to have the full text of the SIP dialogue, and it is generally best to get that from Asterisk, as people are used to reading it that way.
It’s a re-INVITE, without seeing the full SIP trace it could be a media update or it could be a connected line update. It could also be the result of a change that was recently fixed[1].
It is trying to upgrade the session to alaw audio, as you have allowed alaw on the configured endpoint. The remote side is sending a 481 for some reason when they should send a 488. You can either disable alaw as a codec on the endpoint, or apply the patch from the issue I linked.
Patches aren’t normally evaluated for compatibility against earlier sub-versions, as one is expected to use the latest sub-version when trying to resolve a problem.
If the patch is simple, one would expect it to successfully apply against an older sub-version, but no-one is going to spend time checking that.
I think you will find that is is only chan_pjsip that does this.
Why is it a problem? While I suspect it isn’t the intended behaviour, it isn’t invalid behaviour and is something that any compliant UAC should treat as normal.
In fact, because it is UDP, I think it could happen even if it hadn’t been explicitly re transmitted. UDP doesn’t guarantee that packets won’t be lost, won’t be duplicated, and won’t arrive out of sequence.
Agreed, but the point was that the client has to cope with duplication in the network, so it should not cause any problems, if identical ones are transmitted by Asterisk.