Browse code

modules: readme files regenerated - http_client ... [skip ci]

Kamailio Dev authored on 13/08/2019 07:32:20
Showing 1 changed files
... ...
@@ -56,8 +56,10 @@ Hugh Waite
56 56
               3.13. tlsversion (int)
57 57
               3.14. authmethod (int)
58 58
               3.15. keep_connections (int)
59
-              3.16. httpcon (string)
60
-              3.17. config_file (string)
59
+              3.16. query_result (int)
60
+              3.17. query_maxdatasize (int)
61
+              3.18. httpcon (string)
62
+              3.19. config_file (string)
61 63
 
62 64
         4. Functions
63 65
 
... ...
@@ -115,13 +117,15 @@ Hugh Waite
115 115
    1.13. Set tlsversion parameter
116 116
    1.14. Set authmethod parameter
117 117
    1.15. Set keep_connections parameter
118
-   1.16. Set httpcon parameter
119
-   1.17. Set config_file parameter
120
-   1.18. Short http_client config file
121
-   1.19. http_connect() usage
122
-   1.20. http_connect_raw() usage
123
-   1.21. http_get_redirect() usage
124
-   1.22. http_client_query() usage
118
+   1.16. Set query_result parameter
119
+   1.17. Set query_maxdatasize parameter
120
+   1.18. Set httpcon parameter
121
+   1.19. Set config_file parameter
122
+   1.20. Short http_client config file
123
+   1.21. http_connect() usage
124
+   1.22. http_connect_raw() usage
125
+   1.23. http_get_redirect() usage
126
+   1.24. http_client_query() usage
125 127
 
126 128
 Chapter 1. Admin Guide
127 129
 
... ...
@@ -150,8 +154,10 @@ Chapter 1. Admin Guide
150 150
         3.13. tlsversion (int)
151 151
         3.14. authmethod (int)
152 152
         3.15. keep_connections (int)
153
-        3.16. httpcon (string)
154
-        3.17. config_file (string)
153
+        3.16. query_result (int)
154
+        3.17. query_maxdatasize (int)
155
+        3.18. httpcon (string)
156
+        3.19. config_file (string)
155 157
 
156 158
    4. Functions
157 159
 
... ...
@@ -196,10 +202,10 @@ Chapter 1. Admin Guide
196 196
 
197 197
    Like in SIP, the HTTP URL may need encoding to be transported safely
198 198
    over the network. Check the string encoding functions in the
199
-   Transformation Cookbook (as used in the http_client_query example
199
+   Transformation Cookbook (as used in the http_client_query() example
200 200
    below).
201 201
 
202
-   The function http_client_query allows Kamailio to issue an HTTP GET
202
+   The function http_client_query() allows Kamailio to issue an HTTP GET
203 203
    request and get access to parts of the reply. This function has been
204 204
    ported from the utils module and now use the same libcurl functions. We
205 205
    recommend using the new functionality provided by this module.
... ...
@@ -244,8 +250,10 @@ Chapter 1. Admin Guide
244 244
    3.13. tlsversion (int)
245 245
    3.14. authmethod (int)
246 246
    3.15. keep_connections (int)
247
-   3.16. httpcon (string)
248
-   3.17. config_file (string)
247
+   3.16. query_result (int)
248
+   3.17. query_maxdatasize (int)
249
+   3.18. httpcon (string)
250
+   3.19. config_file (string)
249 251
 
250 252
 3.1. httpredirect (int)
251 253
 
... ...
@@ -481,7 +489,35 @@ modparam("http_client", "authmethod", 3)
481 481
 modparam("http_client", "keep_connections", 1)
482 482
 ...
483 483
 
484
-3.16. httpcon (string)
484
+3.16. query_result (int)
485
+
486
+   Control what is returned by the http_client_query(...) in the result
487
+   variable.
488
+
489
+   Valid values are:
490
+     * 0 - Return the entire HTTP result body
491
+     * 1 - Return the first oine from HTTP result body
492
+
493
+   Default value: 1 (return first line).
494
+
495
+   Example 1.16. Set query_result parameter
496
+...
497
+modparam("http_client", "query_result", 0)
498
+...
499
+
500
+3.17. query_maxdatasize (int)
501
+
502
+   Control the size in bytes of the data to be returned by the
503
+   http_client_query(...) in the result variable.
504
+
505
+   Default value: 0 (disabled, unlimited size).
506
+
507
+   Example 1.17. Set query_maxdatasize parameter
508
+...
509
+modparam("http_client", "query_maxdatasize", 2048)
510
+...
511
+
512
+3.18. httpcon (string)
485 513
 
486 514
    Defines a connection and credentials for the connection for use in a
487 515
    connection-oriented function call in this module.
... ...
@@ -529,7 +565,7 @@ modparam("http_client", "keep_connections", 1)
529 529
        Failure is either a connection failure or a response code of 500 or
530 530
        above.
531 531
 
532
-   Example 1.16. Set httpcon parameter
532
+   Example 1.18. Set httpcon parameter
533 533
 ...
534 534
 modparam("http_client", "httpcon", "apione=>http://atlanta.example.com")
535 535
 modparam("http_client", "httpcon", "apitwo=>http://atlanta.example.com/api/12")
... ...
@@ -539,7 +575,7 @@ modparam("http_client", "httpcon", "apifour=>http://stockholm.example.com/api/ge
539 539
 tstuff;timeout=12;failover=apione")
540 540
 ...
541 541
 
542
-3.17. config_file (string)
542
+3.19. config_file (string)
543 543
 
544 544
    The file name of a configuration file containing definitions of http
545 545
    connections. This is an alternative to the "httpcon" module parameter -
... ...
@@ -595,12 +631,12 @@ tstuff;timeout=12;failover=apione")
595 595
    you can specify an value of "" - two quotation marks. In order to
596 596
    disable a http proxy setting you can set the port to zero.
597 597
 
598
-   Example 1.17. Set config_file parameter
598
+   Example 1.19. Set config_file parameter
599 599
 ...
600 600
 modparam("http_client", "config_file", "httpconnections.cfg)
601 601
 ...
602 602
 
603
-   Example 1.18. Short http_client config file
603
+   Example 1.20. Short http_client config file
604 604
 [authapiserver]
605 605
 url = https://api.runbo.example.com/v4.2/auth
606 606
 timeout = 1
... ...
@@ -641,7 +677,7 @@ http_follow_redirect = no
641 641
    This function can be used from REQUEST_ROUTE, ONREPLY_ROUTE,
642 642
    FAILURE_ROUTE, and BRANCH_ROUTE.
643 643
 
644
-   Example 1.19. http_connect() usage
644
+   Example 1.21. http_connect() usage
645 645
 ...
646 646
 modparam("http_client", "httpcon", "apiserver=>http://kamailio.org/api/");
647 647
 ...
... ...
@@ -682,7 +718,7 @@ xlog("L_INFO", "API-server HTTP connection: $avp(route) Result code $var(res)\n"
682 682
    This function can be used from REQUEST_ROUTE, ONREPLY_ROUTE,
683 683
    FAILURE_ROUTE, and BRANCH_ROUTE.
684 684
 
685
-   Example 1.20. http_connect_raw() usage
685
+   Example 1.22. http_connect_raw() usage
686 686
 ...
687 687
 modparam("http_client", "httpcon", "apiserver=>http://kamailio.org/api/");
688 688
 ...
... ...
@@ -709,7 +745,7 @@ xlog("L_INFO", "API-server HTTP connection: $avp(route) Result code $var(res)\n"
709 709
        result - The name of a pseudo variable that will contain the last
710 710
        used URL.
711 711
 
712
-   Example 1.21. http_get_redirect() usage
712
+   Example 1.23. http_get_redirect() usage
713 713
 ...
714 714
 modparam("http_client", "httpredirect", 1);
715 715
 ...
... ...
@@ -730,21 +766,21 @@ http_get_redirect("apiserver", "$var(targeturl)");
730 730
    Either of “post-data” or “hdrs” can be also set to empty string in
731 731
    order to be ignored.
732 732
 
733
-   If HTTP server returns a class 2xx, 3xx or 4xx reply, the first line of
734
-   the reply's body (if any) is stored in “result” parameter, which must
735
-   be a writable pseudo variable.
733
+   If HTTP server returns a class 2xx, 3xx or 4xx reply, the first line or
734
+   the entire reply body (if any) is stored in “result” parameter, which
735
+   must be a writable pseudo variable. See the query_result parameter for
736
+   controling what value to be stored in the result variable.
736 737
 
737 738
    Function returns reply code of HTTP reply or -1 if something went
738 739
    wrong.
739 740
 
740
-   This function can be used from REQUEST_ROUTE, ONREPLY_ROUTE,
741
-   FAILURE_ROUTE, and BRANCH_ROUTE.
741
+   This function can be used from ANY_ROUTE.
742 742
 
743 743
    Note that this function is based on the http_query function in the
744 744
    utils module. It is changed to use the same base library and settings
745 745
    as the rest of the functions in this module.
746 746
 
747
-   Example 1.22. http_client_query() usage
747
+   Example 1.24. http_client_query() usage
748 748
 ...
749 749
 # GET-Request
750 750
 http_client_query("http://api.com/index.php?r_uri=$(ru{s.escape.param})&f_uri=$(