res_pjsip_header_funcs.c: Add new PJSIP_HANGUP_HEADER(S) functions#1409
res_pjsip_header_funcs.c: Add new PJSIP_HANGUP_HEADER(S) functions#1409IgorrG wants to merge 1 commit into
Conversation
|
Workflow PRCheck completed successfully |
|
This feature 100% based on existing PJSIP_HEADER and PJSIP_RESPONSE_HEADER implementation. |
gtjoseph
left a comment
There was a problem hiding this comment.
The cherry-pick-to lines must be in a comment by themselves and must include the 23 branch.
You should also add a UserNote so the new capability shows up at the top of the ChangeLog.
See:
https://docs.asterisk.org/Development/Policies-and-Procedures/Code-Contribution/
https://docs.asterisk.org/Development/Policies-and-Procedures/Commit-Messages/
|
cherry-pick-to: 20 |
These new functions allow retrieving information from headers in BYE message of add additional headers in outbound BYE. Implementation based on existing PJSIP_HEADER and PJSIP_RESPONSE_HEADER implementation. Functions could be used for better integration with SIP proxies and sending custom call data to remote party in SIP on call hangup. UserNote: Functions PJSIP_HANGUP_HEADERS() and PJSIP_HANGUP_HEADER() added. To get headers from incoming BYE functions could be called from the hangup handler. To set headers use add or update options before call hangup.
0a7c280 to
035e691
Compare
|
Workflow PRCheck completed successfully |
|
@IgorrG You need to fix up the PR description to match the commit message. Just copy and paste. |
Thanks. Updated. |
|
What about the CANCEL method? CANCEL is used when the caller hangs up before the callee answers. With the current naming (PJSIP_HANGUP_HEADERS() / PJSIP_HANGUP_HEADER()), it isn’t clear whether these functions cover only BYE or also CANCEL. To avoid confusion, maybe: |
Yes, we think about this, but decided that 'HANGUP' name fit the case, because often used of already established call being disconnected. Neither PJSIP_HEADER nor PJSIP_RESPONSE_HEADER function use SIP method name in its name also. |
We keep accepting more functions for specific situations. I think we've reached the point where functionality needs to be defined and implemented which allows access to headers for every point of the SIP exchange, and to add headers to them. Perhaps a new dialplan function that supersedes the others (though they won't be removed or deprecated) that allows type (request or response) to be specified, and the SIP method or SIP response code alongside the header name (and value for setting). A count function could also be provided to return how many messages there are matching, and a value for which one to use could be provided to the get function (it could also accept first or last as an argument). Thoughts? |
100% agree |
These new functions allow retrieving information from headers in
BYE message of add additional headers in outbound BYE. Implementation
based on existing PJSIP_HEADER and PJSIP_RESPONSE_HEADER
implementation. Functions could be used for better integration with
SIP proxies and sending custom call data to remote party in SIP on
call hangup.
UserNote: Functions PJSIP_HANGUP_HEADERS() and PJSIP_HANGUP_HEADER()
added. To get headers from incoming BYE functions could be called from
the hangup handler. To set headers use add or update options before call
hangup.