following commit will introduce possibility to add User-Agent header for http_query by adding utils module parameter - user_agent, if none is defined then no User-Agent header is added. You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/670
-- Commit Summary --
* utils: introduced the ability to add User-Agent header in HTTP requests.
-- File Changes --
M modules/utils/doc/utils_admin.xml (19) M modules/utils/functions.c (1) M modules/utils/utils.c (2) M modules/utils/utils.h (1)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/670.patch https://github.com/kamailio/kamailio/pull/670.diff
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/670
Passing str when char* expected looks not correct for me.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/670#issuecomment-225891262
I'm very sorry, this is my first commit, so I might ask not so very clever questions. :) I tried to use same logic for user_agent as for xcap_table, which is string.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/670#issuecomment-225897354
@sipidronov good catch, indeed. It should be user_agent.s and only set if the user_agent.len>0. Even in the current form works because .s is the firs field in the str structure, that is not safe for future.
I also think the variable and parameter should be prefixed with http_, as those related to the http query of utils are (e.g., timeout), to be more clear that it refers to the http functionality from the module.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/670#issuecomment-225897805
This already exists in the http_client module. We're planning to remove http from utils, so why extend it with something you can already get in http_client?
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/670#issuecomment-225903391
@miconda or use PARAM_STRING from the very beginning. BTW looks like passing NULL to API call is ok for curl.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/670#issuecomment-225906082
Historically we are using this module and we need possibility to add user-agent header for HTTP requests, if you plan to remove this module and you think that nobody needs such functionality, then probably we can drop this pull request. Thank you!
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/670#issuecomment-225907366
The functionality will only be added to coming releases and the plan is to delete the function from the utils module in favour of the new modules. The functionality already exist in 4.4 http_client module. Closing pull request.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/670#issuecomment-225910600
Closed #670.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/670#event-691963950