ensure traceId is set on CallRecord#1531
Open
rhondahollis wants to merge 1 commit intomainfrom
Open
Conversation
c91327f to
72c1c62
Compare
72c1c62 to
d8c17fc
Compare
rhondahollis
commented
Mar 30, 2026
| addKey(`callid:${externalCallId}`, traceId, 300) | ||
| .catch((err) => logger.error(err, 'createRootSpan: error writing traceId to Redis')); | ||
| } | ||
|
|
Contributor
Author
There was a problem hiding this comment.
@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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.