Skip to content

[bug]: callee_local_norefersub fails intermittently when Asterisk sends an extra connected line re-INVITE #181

Backlog

Description

@kobaz

Severity

Minor

Versions

testsuite master; Asterisk master

Components/Modules

tests/channels/pjsip/transfers/attended_transfer/nominal/callee_local_norefersub

Operating Environment

GitHub Actions PR checks for asterisk/asterisk (master-pjs2 gate). Reproduced locally on Debian 12 with SIPp v3.7.5 and Asterisk master, using ./run-local.

Frequency of Occurrence

Occasional

Issue Description

Issue Description:

channels/pjsip/transfers/attended_transfer/nominal/callee_local_norefersub fails intermittently in the master-pjs2 gate, on PRs whose changes are unrelated to PJSIP. The failing scenario is uac-no-hangup.xml (alice), not the transfer legs.

What happens:

Alice calls bob through Dial(PJSIP/bob). On answer, Dial sends a connected line update ("Bob") to alice's channel.
Usually that update is applied before Asterisk sends the 200 OK to alice's INVITE, so the 200 OK carries P-Asserted-Identity: "Bob" and no re-INVITE follows.
Under load, the update reaches alice's channel just after the 200 OK. Asterisk then queues a session refresh and sends alice a re-INVITE with the same "Bob" identity (sip_session_refresh: ... Queued? yes).
After the transfer, Asterisk sends the expected "Charlie" connected line re-INVITE.
uac-no-hangup.xml cannot handle step 3:

The first re-INVITE is checked with check_it="true" for "Charlie", so a "Bob" re-INVITE marks the call failed.
The second re-INVITE goes to the optional second_invite branch, which sends a 200 OK and then waits for a BYE with no . Asterisk's ACK for that 200 OK aborts the call: while expecting 'BYE' (index 11), received 'ACK ...'.
uas.xml (charlie) is exposed to the same race on the referee's Dial(PJSIP/charlie), and also hard-checks its first re-INVITE.

The same early connected line re-INVITE was previously addressed on the referee leg of callee_local (#115), but the alice and charlie legs were never changed.

To reproduce deterministically, change the test's extensions.conf to force an early connected line update on both legs:

[default]
exten => call_c,1,NoOp()
same => n,Dial(PJSIP/charlie,,U(early_colp))
same => n,Hangup()

exten => alice,1,NoOp()
same => n,Answer()
same => n,Set(CONNECTEDLINE(all)="Bob" )
same => n,Dial(PJSIP/bob)
same => n,Hangup()

[early_colp]
exten => s,1,Set(CONNECTEDLINE(all)="Bob" )
same => n,Return()
With that dialplan the test fails 3 out of 3 times with the same signature as CI.

callee_local/sipp/uac-no-hangup.xml has the same second_invite branch with no ACK, and the same hard check.

Relevant log output

asterisk.sipp:599 processEnded: ... Aborting call on unexpected message for Call-Id '1-53445@127.0.0.1': while expecting 'BYE' (index 11), received 'ACK sip:127.0.0.1:5068;transport=UDP SIP/2.0
...
There were more errors, enable -trace_err to log them.
asterisk.sipp:702 __scenario_callback: SIPp Scenario uac-no-hangup.xml Failed [1]

SIP to/from alice (port 5068) in the failing CI run:
03:26:26.502  <- INVITE                          (alice -> bob)
03:26:26.512  -> 200 OK   PAI "Bob"
03:26:26.512  <- ACK
03:26:26.515  -> INVITE   PAI "Bob"              (queued session refresh, unexpected)
03:26:26.516  <- 200 OK
03:26:26.517  -> ACK
03:26:27.529  REFER (Refer-Sub: false) from the referer, transfer completes
03:26:27.533  -> INVITE   PAI "Charlie"          (expected connected line update)
03:26:27.533  <- 200 OK                          (sent from the second_invite branch)
03:26:27.534  -> ACK                             (scenario is waiting for BYE: abort)

Asterisk:
res_pjsip_session.c: sip_session_refresh: PJSIP/alice-00000000: New SDP? yes  Queued? yes

Asterisk Issue Guidelines

  • Yes, I have read the Asterisk Issue Guidelines

Activity

  1. transferred this issue fromasterisk/asteriskon Nov 26, 2026
  2. jcolp commented on Nov 26, 2026

    @jcolp
    Member

    Yes, already known and in queue to be fixed. There were other tests that were failing far more often that got fixed first.

  3. kobaz commented on Nov 26, 2026

    @kobaz
    Author

    Ah, gottcha.

    I got:
    Pull request creation failed. Validation failed: must be a collaborator

    Happy Thanksgiving

  4. jcolp commented on Nov 26, 2026

    @jcolp
    Member

    You've given me absolutely no context as to what you are referring to.

  5. kobaz commented on Nov 26, 2026

    @kobaz
    Author

    Oh, sorry. The context was this issue report.
    I can't create a pull request to resolve this issue. It gives me the error I pasted earlier.

  6. jcolp commented on Nov 26, 2026

    @jcolp
    Member

    You have a tendency to use multiple Github accounts. Are you using the same account for where the fork is, and for creating the PR? If you don't then you will get the message you provided.

  7. kobaz commented on Nov 26, 2026

    @kobaz
    Author

    Gottcha. I'm trying to cut down on that. My thinking was keeping like 'company/asterisk' stuff on its own would make things more organized. It's just been a pain actually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions