I'd never had a reason to before, but on a deployment I need http messages to go out a specific interface. Curl has an --interface option, but I don't see how to do the same with http_client. Unless I'm missing something...
Anyone ever do something like this?
I assume that a route table entry won't work because you don't want to change the route to the http server for other reasons? I know it's not a direct answer to the question of how to explicitly declare it on demand for the request, but it might address the underlying issue.
Ben Kaufman ben.kaufman@altigen.com Cloud Operations Manager AltiGen Communications, Inc.
STATEMENT OF CONFIDENTIALITY: The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, or the person responsible for delivering the e-mail to the intended recipient, be advised you have received this message in error and that any use, dissemination, forwarding, printing, or copying is strictly prohibited. Please notify AltiGen Communications immediately at either (888)258-4436 or via email to administrator@altigen.com, and destroy all copies of this message and any attachments.
The libcurl seems to offer an option for that as well:
- https://curl.haxx.se/libcurl/c/CURLOPT_INTERFACE.html
So it can be a small patch to the module and support it in the future.
If you look for a solution on current stable, maybe one of the embedded scripting languages can help, you can execute inline a small script in Lua/Python/Perl with app_lua_run() & equivalents. In the past I used the http client from lua to do more complex http api queries (e.g., with specific headers, ...).
Cheers, Daniel
On 13.01.20 17:00, Fred Posner wrote:
I'd never had a reason to before, but on a deployment I need http messages to go out a specific interface. Curl has an --interface option, but I don't see how to do the same with http_client. Unless I'm missing something...
Anyone ever do something like this?
On 1/16/20 4:56 PM, Daniel-Constantin Mierla wrote:
The libcurl seems to offer an option for that as well:
- https://curl.haxx.se/libcurl/c/CURLOPT_INTERFACE.html
So it can be a small patch to the module and support it in the future.
If you look for a solution on current stable, maybe one of the embedded scripting languages can help, you can execute inline a small script in Lua/Python/Perl with app_lua_run() & equivalents. In the past I used the http client from lua to do more complex http api queries (e.g., with specific headers, ...).
Cheers, Daniel
Thank you Daniel,
I implemented a work around (little proxy in go) but would love if the option was added for the future.
Fred Posner fred@qxork.com https://qxork.com Direct/SMS: +1 (336) 439-3733
Need Fred? Call Fred. 336-HEY-FRED Matrix: @fred:matrix.lod.com
Hello,
I just pushed a commit to master git branch adding the feature via a modparam, however I didn't test it, therefore some assistance here will be appreciated.
If all works ok, very likely that the commit can be cherry-picked on a local clone of 5.3 branch and work fine on that version as well.
Not being the developer of the http_client module, I am not very familiar with it and it seems that there is an alternative to set curl lib options via a dedicated config file, that part was not enhanced. But the http_query() function should work with the new modparam, if not report it back and I will fix it.
Cheers, Daniel
On 16.01.20 23:11, Fred Posner wrote:
On 1/16/20 4:56 PM, Daniel-Constantin Mierla wrote:
The libcurl seems to offer an option for that as well:
- https://curl.haxx.se/libcurl/c/CURLOPT_INTERFACE.html
So it can be a small patch to the module and support it in the future.
If you look for a solution on current stable, maybe one of the embedded scripting languages can help, you can execute inline a small script in Lua/Python/Perl with app_lua_run() & equivalents. In the past I used the http client from lua to do more complex http api queries (e.g., with specific headers, ...).
Cheers, Daniel
Thank you Daniel,
I implemented a work around (little proxy in go) but would love if the option was added for the future.
Fred Posner fred@qxork.com https://qxork.com Direct/SMS: +1 (336) 439-3733
Need Fred? Call Fred. 336-HEY-FRED Matrix: @fred:matrix.lod.com
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users