Skip to content

ensure traceId is set on CallRecord#1531

Open
rhondahollis wants to merge 1 commit intomainfrom
fix/missing-app-sid-and-trace
Open

ensure traceId is set on CallRecord#1531
rhondahollis wants to merge 1 commit intomainfrom
fix/missing-app-sid-and-trace

Conversation

@rhondahollis
Copy link
Copy Markdown
Contributor

@rhondahollis rhondahollis commented Mar 26, 2026

Fix for #1505
Corresponding change in sbc-inbound: jambonz/sbc-inbound#240

These changes ensure an X-Trace-Id is added to the error responses sent to sbc-inbound.
I also added a Redis entry with the traceId keyed to the callId, so that there is still a traceId on Call Records when either the user hangs up before the call is answered or the application doesn't provide an actionHook to handle a failed dial, thereby resulting in the caller hanging up due to lack of a final response making it back to sbc-inbound.

@davehorton davehorton force-pushed the fix/missing-app-sid-and-trace branch from 72c1c62 to d8c17fc Compare March 29, 2026 20:20
Comment thread lib/middleware.js
addKey(`callid:${externalCallId}`, traceId, 300)
.catch((err) => logger.error(err, 'createRootSpan: error writing traceId to Redis'));
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@davehorton @sammachin Theses changes in middleware.js to add the Redis call are particular to handling scenarios where the final response is not propagated back to sbc_inbound:

  • caller hangs up before receiving a final response
  • no actionHook on a dial verb, which results in a timeout and feature-server generating a CANCEL. This is what I kept hitting in my own test scenario, but I don't know frequent this would be for customers.

If we decide to remove just these changes (and the corresponding one in sbc-inbound), the changes in the other files on this PR would still ensure application and trace ID are added to the Call Record in the scenarios where a final response is returned to sbc-inbound.

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.

1 participant