Skip to content

Fix ACK using a random To tag instead of echoing the remote's - #317

Open
hainesdev wants to merge 1 commit into
tayler6000:masterfrom
hainesdev:bugfix/Issue-312
Open

Fix ACK using a random To tag instead of echoing the remote's#317
hainesdev wants to merge 1 commit into
tayler6000:masterfrom
hainesdev:bugfix/Issue-312

Conversation

@hainesdev

Copy link
Copy Markdown

Fixes #312

gen_ack() generated a brand-new random tag for the ACK's To header instead of echoing the tag the remote UAS assigned in its 2xx response. Per RFC 3261 17.1.1.3 the ACK must reuse that exact tag, or the remote can't match it to the dialog it created -- it just keeps retransmitting the 2xx (Timer G) until it gives up and tears the call down (Timer H).

Confirmed live against a real Asterisk 22 / FreePBX 17 PBX with pjsip set logger on: the call rang, was answered, and then hold music played and the call died a few seconds later instead of connecting -- the PBX trace showed it retransmitting the same 200 OK 11 times, each one followed by an ACK from our side that it never recognized as satisfying the transaction, before giving up.

Fix mirrors the same tag-echoing pattern already used correctly elsewhere in this file (e.g. gen_bye): use request.headers["To"]["tag"] when present, fall back to gen_tag() only if it's genuinely empty.

Fixes tayler6000#312

[FIX] Fixed gen_ack generating a random To tag instead of echoing the
      one the remote UAS assigned in its 2xx response, per RFC 3261
      17.1.1.3. The mismatched tag meant the remote couldn't match the
      ACK to its dialog, so it kept retransmitting the 2xx until it
      gave up and tore the call down. Confirmed live against a real
      Asterisk PBX: call rings, gets answered, then dies after ~30s
      instead of connecting.
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

Successfully merging this pull request may close these issues.

Calls terminating because messages apply randomly generated "To" tags

1 participant