-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Additionally return reason header protocol and cause #2935
Additionally return reason header protocol and cause #2935
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't use the SIP plugin much, but I think it makes sense, especially in case those properties are indeed of use to users/developers. I agree that renaming them all would be better (possibly grouped in an object) but we do indeed have to preserve backwards compatibility, so I have no opinion on the names of the properties.
src/plugins/janus_sip.c
Outdated
@@ -7157,4 +7195,4 @@ gpointer janus_sip_sofia_thread(gpointer user_data) { | |||
JANUS_LOG(LOG_VERB, "Leaving sofia loop thread...\n"); | |||
g_thread_unref(g_thread_self()); | |||
return NULL; | |||
} | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like your editor ate the last newline?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, it's back now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Thanks for the fix, I'll make a couple of tests and, if everything is fine (which I expect it to be), I'll merge 👍 |
Looks good here: I'll merge and backport the same fix to the |
Current syntax for reporting on SIP code, reason, and reason header looks as:
reason_header, although its name suggests differently, returns only the value of the text parameter from the reason header, (correspond to the value of the text parameter returned by Sofia, re_text). Looking at the example below, the current response would return "reason_header": "Terminated".
As an additional two parameters from the common syntax of the header could provide more context to what has happened (and enhance reason header mappings on the user side), the pull request suggests adding two new optional fields, reason_header_protocol, and reason_header_cause. Both of these are contained in Sofia's sip reason structure sip_reason_s as re_protocol and re_cause, and are read and returned in the same way as the current reason_header.
After the update, the new syntax would be as:
I would appreciate feedback on naming both of these fields, as reason_header may be misleading having protocol and cause separately, but cannot be simply renamed not to introduce breaking change.